bitcoin / bitcoin

Bitcoin Core integration/staging tree
https://bitcoincore.org/en/download
MIT License
79.28k stars 36.33k forks source link

[qt] using walletpassphrase command in debug console crashes client #3100

Closed laanwj closed 11 years ago

laanwj commented 11 years ago

At least when -server is not enabled. The following assertion fails:

bitcoin-qt: bitcoinrpc.cpp:900: void RPCRunLater(const string&, boost::function<void()>, int64): Assertion `rpc_io_service != __null' failed.
Aborted (core dumped)
Diapolo commented 11 years ago

@laanwj Is this still the case? AFAIK Gavin recently fixed a RPC shutdown problem related to a NULL pointer.

laanwj commented 11 years ago

Well it was an issue when I tried about a week ago. I don't think anything has changed to the RPC handling since then. You can't reproduce it?

Diapolo commented 11 years ago

Indeed, with server=0 it gives me an assertion in bitcoinrpc.cpp: rpc_io_service != NULL

Caused by RPCRunLater() call in walletpassphrase() (in rpcwallet.cpp), because StartRPCThreads() isn't called when fServer is false, which inits rpc_io_service.

Diapolo commented 11 years ago

@laanwj What is the best way to fix this? Check for fServer in walletpassphrase()? Are there more RPC commands that fail when fServer is false?

laanwj commented 11 years ago

Only walletpassphrase uses RPCRunLater at the moment. So adding a check to that command specifically will do.