qt: Fix random segfault when closing "Choose data directory" dialog #8540

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2016_08_qt_choosedatadir_crash changing 3 files +10 −5
  1. laanwj commented at 3:02 PM on August 18, 2016: member

    The pickDataDirectory() function was calling exit(0) to quit the application when the user closes the dialog without choosing a data directory.

    This is a bad idea because a background thread is created (to check free space on the drive of the currently selected datadir). The thread is not stopped and unwound properly, resulting in a potential race condition somewhere deep in Qt (while running exit-triggered destructors).

    So replace the exit() by a boolean return value, and let the stack unwind normally.

  2. qt: Fix random segfault when closing "Choose data directory" dialog
    The `pickDataDirectory()` function was calling `exit(0)` to quit
    the application when the user closes the dialog without choosing
    a data directory.
    
    This is a bad idea because a background thread is created (to
    check free space on the drive of the currently selected datadir).
    The thread is not stopped and unwound properly, resulting in a potential
    race condition somewhere deep in Qt.
    
    So replace the `exit()` by a boolean return value, and let the
    stack unwind normally.
    b4a9aa511c
  3. laanwj added the label Bug on Aug 18, 2016
  4. laanwj added the label GUI on Aug 18, 2016
  5. MarcoFalke commented at 4:01 PM on August 18, 2016: member

    Concept ACK b4a9aa511c95a1bd0da8ae363b3b9c0b3b7afe4e. Is this something for 13.1?

  6. laanwj added this to the milestone 0.13.1 on Aug 18, 2016
  7. laanwj added the label Needs backport on Aug 18, 2016
  8. laanwj commented at 4:03 PM on August 18, 2016: member

    Concept ACK b4a9aa5. Is this something for 13.1?

    yes, probably

  9. laanwj merged this on Aug 19, 2016
  10. laanwj closed this on Aug 19, 2016

  11. laanwj referenced this in commit 36404aeec8 on Aug 19, 2016
  12. MarcoFalke removed the label Needs backport on Sep 9, 2016
  13. sickpig referenced this in commit decc308a8f on Mar 31, 2017
  14. sickpig referenced this in commit db3cc0b388 on Apr 5, 2017
  15. codablock referenced this in commit c4a35b1dd8 on Sep 19, 2017
  16. codablock referenced this in commit ea8beb88be on Dec 29, 2017
  17. codablock referenced this in commit 80573f2bf4 on Jan 8, 2018
  18. andvgal referenced this in commit ab958c5dd9 on Jan 6, 2019
  19. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

Milestone
0.13.1


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-13 15:15 UTC

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