RPC: do not launch Shutdown in a new thread in case we are running the UI #633

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:qtrpcconflict changing 1 files +7 −2
  1. laanwj commented at 1:07 PM on November 12, 2011: member

    This leads to the bitcoin core being shut down while the UI is accessing it, and generally results in a segmentation fault or crash. In case it is desirable to make it possible to shutdown the GUI from its RPC server, we'll need to implement a signal for it. For the mean time, this is a safe stopgap.

    Reproducing the bug:

    bitcoin-qt -testnet -server -datadir=<new directory>
    

    Output:

    Warning: To use the "-server" option, you must set rpcpassword=<password>
    in the configuration file: /tmp/test/testnet/bitcoin.conf
    If the file does not exist, create it with owner-readable-only file permissions.
    Segmentation fault
    

    Also changes the Warning to an Error (as it is kind of fatal, terminating the rpc thread).

  2. Do not launch Shutdown in a new thread in case we are running the UI.
    This leads to the bitcoin core being shut down while the UI is accessing it, and generally results in a segmentation fault or crash. In case it is desirable to make it possible to shutdown the GUI from its RPC server, we'll need to implement a signal for it. For the mean time, this is a safe stopgap.
    19197d5e29
  3. in src/bitcoinrpc.cpp:None in 19197d5e29
     164 | +#ifndef QT_GUI
     165 |      // Shutdown will take long enough that the response should get back
     166 |      CreateThread(Shutdown, NULL);
     167 |      return "bitcoin server stopping";
     168 | +#else
     169 | +    throw runtime_error("NYI: cannot shut down GUI with RPC command");
    


    gavinandresen commented at 7:13 PM on November 12, 2011:

    I'm not familiar with the acronym "NYI" -- Nubile Young Icelanders ?


    laanwj commented at 7:47 PM on November 12, 2011:

    Not Yet Implemented

  4. gavinandresen referenced this in commit 88a1b89452 on Nov 14, 2011
  5. gavinandresen merged this on Nov 14, 2011
  6. gavinandresen closed this on Nov 14, 2011

  7. coblee referenced this in commit 82ac11cda3 on Jul 17, 2012
  8. ptschip referenced this in commit 08f6aa465a on Jun 15, 2017
  9. fjahr referenced this in commit fa33017135 on Jul 24, 2019
  10. rajarshimaitra referenced this in commit 0ab75213d5 on Aug 5, 2021
  11. DrahtBot locked this on Sep 8, 2021
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-13 15:16 UTC

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