0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-04 10:07:27 -05:00
bitcoin-bitcoin-core/src
Cory Fields 89f71c68c0 c++11: don't throw from the reverselock destructor
noexcept is default for destructors as of c++11. By throwing in reverselock's
destructor if it's lock has been tampered with, the likely result is
std::terminate being called. Indeed that happened before this change.

Once reverselock has taken another lock (its ctor didn't throw), it makes no
sense to try to grab or lock the parent lock. That is be broken/undefined
behavior depending on the parent lock's implementation, but it shouldn't cause
the reverselock to fail to re-lock when destroyed.

To avoid those problems, simply swap the parent lock's contents with a dummy
for the duration of the lock. That will ensure that any undefined behavior is
caught at the call-site rather than the reverse lock's destruction.

Barring a failed mutex unlock which would be indicative of a larger problem,
the destructor should now never throw.
2016-01-05 17:17:29 -05:00
..
bench [Trivial] ensure minimal header conventions 2015-10-27 17:44:13 +01:00
compat Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
config
consensus Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
crypto
leveldb Update LevelDB 2015-11-04 23:46:47 +01:00
obj
obj-test
policy Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
primitives Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
qt Merge pull request #7205 2016-01-05 14:11:40 +01:00
script Merge pull request #7205 2016-01-05 14:11:40 +01:00
secp256k1 Merge commit '5ad54630935d1f340666de7bc9ffef9b8a1df296' into HEAD 2015-11-24 09:22:18 +01:00
support Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
test c++11: don't throw from the reverselock destructor 2016-01-05 17:17:29 -05:00
univalue Merge commit '982709199f1b4e9e35211c419a81938f9f1dd4ed' into bitcoin 2015-12-02 12:28:48 +01:00
wallet c++11: detect and correct for boost builds with an incompatible abi 2016-01-05 17:17:29 -05:00
zmq zmq: prepend zmq to debug messages 2015-11-19 13:32:14 +11:00
.clang-format [trivial] clang-format: Set AlignAfterOpenBracket: false 2015-11-05 23:28:02 +01:00
addrman.cpp Creates unittests for addrman, makes addrman testable. 2015-09-24 15:20:48 -04:00
addrman.h Creates unittests for addrman, makes addrman testable. 2015-09-24 15:20:48 -04:00
alert.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
alert.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
amount.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
amount.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
arith_uint256.cpp
arith_uint256.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
base58.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
base58.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
bitcoin-cli-res.rc Update Windows resource files (and add one for bitcoin-tx) 2015-05-22 02:56:55 +00:00
bitcoin-cli.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
bitcoin-tx-res.rc Update Windows resource files (and add one for bitcoin-tx) 2015-05-22 02:56:55 +00:00
bitcoin-tx.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
bitcoind-res.rc Update Windows resource files (and add one for bitcoin-tx) 2015-05-22 02:56:55 +00:00
bitcoind.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
bloom.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
bloom.h Merge pull request #7205 2016-01-05 14:11:40 +01:00
chain.cpp Allow block announcements with headers 2015-11-29 11:59:23 +01:00
chain.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
chainparams.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
chainparams.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
chainparamsbase.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
chainparamsbase.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
chainparamsseeds.h Hardcoded seeds update June 2015 2015-06-25 08:05:52 +02:00
checkpoints.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
checkpoints.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
checkqueue.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
clientversion.cpp
clientversion.h Merge pull request #7205 2016-01-05 14:11:40 +01:00
coincontrol.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
coins.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
coins.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
compat.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
compressor.cpp
compressor.h
core_io.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
core_memusage.h Prevector type 2015-11-13 18:15:20 +01:00
core_read.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
core_write.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
dbwrapper.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
dbwrapper.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
hash.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
hash.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
httprpc.cpp Added additional config option for multiple RPC users. 2015-11-29 08:34:20 -05:00
httprpc.h evhttpd implementation 2015-09-03 10:59:18 +02:00
httpserver.cpp http: add Boost 1.49 compatibility 2015-11-20 10:14:21 +01:00
httpserver.h http: speed up shutdown 2015-11-13 11:10:48 +01:00
init.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
init.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
key.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
key.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
keystore.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
keystore.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
limitedmap.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
main.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
main.h Merge pull request #7205 2016-01-05 14:11:40 +01:00
Makefile.am Merge pull request #7133 2015-12-03 13:16:46 +01:00
Makefile.bench.include build: Split hardening/fPIE options out 2015-11-09 22:50:31 -05:00
Makefile.qt.include qt: Final translation update before 0.12 fork 2015-12-02 14:28:35 +01:00
Makefile.qttest.include build: Use fPIC rather than fPIE for qt objects. 2015-11-09 22:50:31 -05:00
Makefile.test.include Merge pull request #7133 2015-12-03 13:16:46 +01:00
memusage.h Prevector type 2015-11-13 18:15:20 +01:00
merkleblock.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
merkleblock.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
miner.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
miner.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
net.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
net.h Merge pull request #7205 2016-01-05 14:11:40 +01:00
netbase.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
netbase.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
noui.cpp
noui.h
pow.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
pow.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
prevector.h Name union to prevent compiler warning 2015-12-02 08:40:47 +01:00
protocol.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
protocol.h Merge pull request #7205 2016-01-05 14:11:40 +01:00
pubkey.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
pubkey.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
random.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
random.h
rest.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
reverselock.h c++11: don't throw from the reverselock destructor 2016-01-05 17:17:29 -05:00
rpcblockchain.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
rpcclient.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
rpcclient.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
rpcmining.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
rpcmisc.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
rpcnet.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
rpcprotocol.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
rpcprotocol.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
rpcrawtransaction.cpp rpc: remove cs_main lock from createrawtransaction 2015-12-02 13:42:47 +01:00
rpcserver.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
rpcserver.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
scheduler.cpp Replace boost::reverse_lock with our own. 2015-09-03 15:13:40 -04:00
scheduler.h More robust CScheduler unit test 2015-05-16 17:59:23 -04:00
serialize.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
streams.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
sync.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
sync.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
threadsafety.h
timedata.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
timedata.h
tinyformat.h
torcontrol.cpp torcontrol debug: Change to a blanket message that covers both cases 2015-12-16 12:57:06 +01:00
torcontrol.h torcontrol improvements and fixes 2015-11-12 17:58:15 +01:00
txdb.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
txdb.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
txmempool.cpp Merge pull request #7205 2016-01-05 14:11:40 +01:00
txmempool.h Merge pull request #7205 2016-01-05 14:11:40 +01:00
ui_interface.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
uint256.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
uint256.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
undo.h
util.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
util.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
utilmoneystr.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
utilmoneystr.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
utilstrencodings.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
utilstrencodings.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
utiltime.cpp Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
utiltime.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
validationinterface.cpp Add ZeroMQ support. Notify blocks and transactions via ZeroMQ 2015-09-16 11:01:35 +01:00
validationinterface.h Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
version.h Allow block announcements with headers 2015-11-29 11:59:23 +01:00