bitcoin/src/rpc
fanquake b9c504cbc4
Merge #18742: miner: Avoid stack-use-after-return in validationinterface
7777f2a4bb miner: Avoid stack-use-after-return in validationinterface (MarcoFalke)
fa5ceb25fc test: Remove UninterruptibleSleep from test and replace it by SyncWithValidationInterfaceQueue (MarcoFalke)
fa770ce7fe validationinterface: Rework documentation, Rename pwalletIn to callbacks (MarcoFalke)
fab6d060ce test: Add unregister_validation_interface_race test (MarcoFalke)

Pull request description:

  When a validationinterface has itself unregistered in one thread, but is about to get executed in another thread [1], there is a race:

  * The validationinterface destructing itself
  * The validationinterface getting dereferenced for execution

  [1] 64139803f1/src/validationinterface.cpp (L82-L83)

  This happens in the miner. More generally it happens everywhere where at least one thread is generating notifications and another one is unregistering a validationinterface.

  This issue has been fixed in commit ab31b9d6fe, but the fix has not been applied to the miner.

  Example where this happened in practice: https://travis-ci.org/github/bitcoin/bitcoin/jobs/675322230#L4414

ACKs for top commit:
  promag:
    Code review ACK 7777f2a4bb.
  laanwj:
    Code review ACK 7777f2a4bb

Tree-SHA512: 8087119243c71ba18a823a63515f3730d127162625d8729024278b447af29e2ff206f4840ee3d90bf84f93a2c5ab73b76c7e7044c83aa93b5b51047a166ec3d3
2020-05-14 20:40:55 +08:00
..
blockchain.cpp rpc: Do not advertise dumptxoutset as a way to flush the chainstate 2020-04-28 20:40:47 -04:00
blockchain.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
client.cpp add importdescriptors RPC and tests for native descriptor wallets 2020-04-23 13:59:48 -04:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp miner: Avoid stack-use-after-return in validationinterface 2020-05-13 19:58:20 -04:00
misc.cpp Merge #18669: log: Use Join() helper when listing log categories 2020-04-26 19:57:41 -04:00
net.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
protocol.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
rawtransaction.cpp Merge #17509: gui: save and load PSBT 2020-04-23 13:16:23 +12:00
rawtransaction_util.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
rawtransaction_util.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
register.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
request.cpp rpc: migrate JSONRPCRequest functionality into request.cpp 2019-07-05 11:22:02 +09:00
request.h rpc: migrate JSONRPCRequest functionality into request.cpp 2019-07-05 11:22:02 +09:00
server.cpp rpc: Add mutex to guard deadlineTimers 2020-04-29 11:47:57 +01:00
server.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
util.cpp Merge #18607: rpc: Fix named arguments in documentation 2020-04-17 12:16:42 -04:00
util.h Merge #18607: rpc: Fix named arguments in documentation 2020-04-17 12:16:42 -04:00