Renaming main thread causes issues with UNIX utilities #17036

issue laanwj openend this issue on October 3, 2019
  1. laanwj commented at 3:05 am on October 3, 2019: member

    Renaming the main thread (e.g., the one the program spawns with) causes the name of the daemon in utilities such as “top” to show as “b-init” instead of bitcoind. This is surprising, as it doesn’t show the other thread names (by default), you’d expect it to show program names.

    This doesn’t only affect top: killall does no longer recognize the program name

    0$ killall bitcoind
    1bitcoind: no process found
    2$ killall b-init
    3(no output, succesful)
    

    In contrast to bitcoin-qt, which doesn’t suffer from this problem because it has a separate init thread, initialization happens in the main thread in bitcoind, and it’s renamed due to util::ThreadRename("init"); in AppInit. If we want to name the init thread, this should only be done in bitcoin-qt.

    (not sure when this was introduced, but #16984 made the issue more visible because ther’s no bitcoin in the name anymore)

  2. laanwj added the label Utils/log/libs on Oct 3, 2019
  3. sipa commented at 4:02 am on October 3, 2019: member
    “killall bitcoind” hasn’t worked for a while (before #16984 you had to use “killall bitcoin-init” or so, which was somewhat strange as well).
  4. laanwj commented at 4:03 am on October 3, 2019: member

    Yes, I’m not sure when it was introduced, but I think this is clearly the wrong behavior.

    Edit: it seems broken for bitcoin-qt as well.

  5. laanwj referenced this in commit 98b6d19664 on Oct 3, 2019
  6. laanwj renamed this:
    Do not rename the main thread
    Renaming main thread causes issues with UNIX utilities
    on Oct 3, 2019
  7. laanwj added the label Linux/Unix on Oct 3, 2019
  8. laanwj referenced this in commit 07e4bdba3b on Oct 3, 2019
  9. jonatack commented at 10:46 am on October 3, 2019: member
    I’ve been seeing the same issue with bitcoind and bitcoin-qt. Reproduced the issue just now on master a689c119076c7b8dc5b4dea4539e4cbf5adfb72f.
  10. MarcoFalke added this to the milestone 0.18.2 on Oct 3, 2019
  11. MarcoFalke removed this from the milestone 0.18.2 on Oct 3, 2019
  12. MarcoFalke added this to the milestone 0.19.0 on Oct 3, 2019
  13. laanwj closed this on Oct 3, 2019

  14. laanwj referenced this in commit 4715037796 on Oct 3, 2019
  15. laanwj referenced this in commit 9fdaaecf49 on Oct 3, 2019
  16. sidhujag referenced this in commit b0d1e03aab on Oct 4, 2019
  17. sidhujag referenced this in commit 04b06427bf on Oct 4, 2019
  18. hebasto commented at 5:49 am on October 5, 2019: member
    Also #16007
  19. HashUnlimited referenced this in commit 3fa7513e06 on Nov 17, 2019
  20. fxtc referenced this in commit de31dc95d3 on Nov 25, 2019
  21. fxtc referenced this in commit ce2b1d6dcc on Nov 25, 2019
  22. PastaPastaPasta referenced this in commit 769974f3db on Sep 21, 2021
  23. kittywhiskers referenced this in commit 72e2e244eb on Oct 12, 2021
  24. vijaydasmp referenced this in commit 6f4bf99236 on Dec 6, 2021
  25. MarcoFalke locked this on Dec 16, 2021
  26. gades referenced this in commit 07d251c58b on May 22, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-30 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me