Failed assertion during shutdown #23186

issue hebasto opened this issue on October 5, 2021
  1. hebasto commented at 1:29 PM on October 5, 2021: member

    On master (9013f23b0a6e0e450c4603f9d0f050ff10d552f6) observed a failed assertion after trying to quit immediately after the GUI open:

    $ src/qt/bitcoin-qt
    bitcoin-qt: init.cpp:183: auto Shutdown(NodeContext &)::(anonymous class)::operator()() const: Assertion `"node.args" && check' failed.
    Aborted (core dumped)
    
  2. hebasto added the label Bug on Oct 5, 2021
  3. hebasto commented at 1:29 PM on October 5, 2021: member
  4. ryanofsky commented at 1:44 PM on October 5, 2021: contributor
  5. ryanofsky commented at 1:47 PM on October 5, 2021: contributor

    So initexecutor is somehow shutting down before MakeNodeInit is called?

    This seems impossible actually. More likely might be that Shutdown() is being called twice, and second call fails because the first call resets args to null:

    https://github.com/bitcoin/bitcoin/blob/9013f23b0a6e0e450c4603f9d0f050ff10d552f6/src/init.cpp#L298

  6. ryanofsky commented at 1:54 PM on October 5, 2021: contributor

    If the problem is that Shutdown() is being called twice, it would be good to figure out why Shutdown is being called twice, and whether that is happening in a thread safe way, and whether GUI shutdown logic can be simplified so this doesn't happen.

    But whether or not you actually want the GUI to call Shutdown multiple times, it would probably be good to make the Shutdown function idempotent and just delete the node.args = nullptr; line since it doesn't really belong there anyway:

    https://github.com/bitcoin/bitcoin/blob/9013f23b0a6e0e450c4603f9d0f050ff10d552f6/src/init.cpp#L298

  7. hebasto commented at 4:39 PM on April 13, 2022: member

    This bug is 100% reproducible in my Qt 6 branch.

    If the problem is that Shutdown() is being called twice

    ~No. Shutdown() is being called once.~ Sorry. Confirmed. It is being called twice.

  8. ryanofsky commented at 4:46 PM on April 13, 2022: contributor

    Confirmed. It is being called twice.

    I don't remember all the details here but it does seem like making it idempotent and deleting the node.args = nullptr; line could be a good fix

  9. ryanofsky referenced this in commit 76343aa03f on Apr 14, 2022
  10. ryanofsky commented at 4:42 AM on April 14, 2022: contributor

    Deleting that line also fixed a test crash in 76343aa03f0c66de8ef4b5eebe4ba65743d63d2d from #15936

  11. hebasto commented at 2:02 PM on April 16, 2022: member

    This bug is 100% reproducible in my Qt 6 branch.

    It's unrelated to the initial issue, as it appears Qt 6 specific.

  12. ryanofsky referenced this in commit e666b969ac on Apr 19, 2022
  13. ryanofsky referenced this in commit 1e1ccabf0d on Apr 23, 2022
  14. ryanofsky referenced this in commit eec10bf945 on May 2, 2022
  15. ryanofsky referenced this in commit 1f405a8a1e on May 16, 2022
  16. ryanofsky referenced this in commit 19e2f91df1 on May 17, 2022
  17. ryanofsky referenced this in commit dede336c39 on May 19, 2022
  18. ryanofsky referenced this in commit 9dd3817ee2 on May 19, 2022
  19. ryanofsky referenced this in commit f7464d8e34 on May 19, 2022
  20. ryanofsky referenced this in commit cbf12706f7 on May 19, 2022
  21. ryanofsky referenced this in commit d0ff88b742 on May 20, 2022
  22. ryanofsky referenced this in commit 54eb46dcd8 on May 20, 2022
  23. ryanofsky referenced this in commit 77fabffef4 on May 23, 2022
  24. ryanofsky referenced this in commit 8b997592ec on May 23, 2022
  25. ryanofsky referenced this in commit 7ded45d1c9 on May 26, 2022
  26. ryanofsky referenced this in commit c1ea11a52d on May 31, 2022
  27. ryanofsky referenced this in commit 01f5142960 on Jun 6, 2022
  28. janus referenced this in commit 2e4e9910e5 on Aug 4, 2022
  29. Fabcien referenced this in commit 012cad14f4 on Jan 4, 2024
  30. fanquake commented at 11:00 AM on May 31, 2024: member

    Is this still an issue? If yes. How is it reproduced? If it's GUI/qt only, then move it to the GUI repo?

  31. hebasto commented at 11:02 AM on May 31, 2024: member

    Closing for now. Will reopen after being able to reproduce.

  32. hebasto closed this on May 31, 2024

  33. bitcoin locked this on May 31, 2025
Labels

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: 2026-04-24 21:14 UTC

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