Exit cleanly if AppInit2 returns false #2606

pull gavinandresen wants to merge 1 commits into bitcoin:master from gavinandresen:threadfix changing 2 files +6 −3
  1. gavinandresen commented at 4:33 PM on May 2, 2013: contributor

    Bitcoin-Qt could core dump if application initialization failed in certain ways.

    I double-fixed this:

    1. qt/bitcoin.cpp now shuts down core threads cleanly if AppInit2 returns false
    2. init.cpp now exits before StartNode() if strErrors is set (no reason to StartNode if we're just going to exit immediately anyway).

    Tested by triggering all of the various ways AppInit2 can fail, either by passing bogus command-line arguments or just recompiling tweaked code to simulate failure.

    This is a partial fix for #2480

  2. Exit cleanly if AppInit2 returns false
    Bitcoin-Qt could core dump if application initialization failed in certain ways.
    
    I double-fixed this:
    1) qt/bitcoin.cpp now shuts down core threads cleanly if AppInit2 returns false
    2) init.cpp now exits before StartNode() if strErrors is set (no reason to StartNode if we're just going to exit immediately anyway).
    
    Tested by triggering all of the various ways AppInit2 can fail, either by passing bogus command-line arguments or just recompiling tweaked code to simulate failure.
    
    This is a partial fix for #2480
    d605bc4cd1
  3. BitcoinPullTester commented at 5:40 PM on May 2, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/d605bc4cd13716fde9c34d79a01f4ee128f8814f for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  4. sipa commented at 9:10 PM on May 3, 2013: member

    ACK, tested an artificial error in Bitcoin-Qt under valgrind.

  5. laanwj commented at 1:06 PM on May 4, 2013: member

    ACK

    BTW I don't remember before that Shutdown() was called when AppInit2 fails, was this changed in init.cpp recently?

  6. sipa commented at 2:42 PM on May 4, 2013: member

    @laanwj This commit added that Shutdown() call?

  7. sipa referenced this in commit f309cb76c2 on May 4, 2013
  8. sipa merged this on May 4, 2013
  9. sipa closed this on May 4, 2013

  10. laanwj commented at 8:01 AM on May 5, 2013: member

    @sipa that's not what I meant. When I initially wrote bitcoin-qt I'm pretty sure that Shutdown() was not called (in the bitcoind case, in init.cpp) in case AppInit2() failed. At least I remember checking this. So it must have been added in the meantime.

  11. gavinandresen deleted the branch on Nov 4, 2013
  12. laudney referenced this in commit 884171a2cc on Mar 19, 2014
  13. DrahtBot locked this on Sep 8, 2021

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 21:16 UTC

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