wallet: Fix segfault in CreateWalletFromFile#16796
wallet: Fix segfault in CreateWalletFromFile#16796meshcollider merged 3 commits intobitcoin:masterfrom
Conversation
|
ACK fa73460 |
| parser.add_argument( | ||
| '--data_wallets_dir', | ||
| default=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data/wallets/'), | ||
| help='Test data with wallet directories (default: %(default)s)', |
There was a problem hiding this comment.
I'm not 100% fluent in python and haven't tested this but don't you need to use e.g. % locals() at the end to fill the %(default)s?
There was a problem hiding this comment.
This is done by the argparse module. It can be tested with
$ ./test/functional/wallet_multiwallet.py --help|tail -4
--data_wallets_dir DATA_WALLETS_DIR
Test data with wallet directories (default: /home/marc
o/workspace/btc_bitcoin_core/test/functional/data/wall
ets/)
meshcollider
left a comment
There was a problem hiding this comment.
LGTM, code-read ACK fa73460
ryanofsky
left a comment
There was a problem hiding this comment.
test/functional/data/wallets/high_minversion/wallet.dat
I think if we're going to add binary test blobs like this, they should be accompanied with comments saying how they are generated and intended to be maintained. For example, this information could go in accompanying README.md or generate.sh files.
Without this information, as code is updated in the future, and especially if more binary blobs are added, we're going to be faced with unpleasant choices of:
- Deleting tests and potentially losing important test coverage when changes are made.
- Or having to add ugly workarounds to production or test code to maintain compatibility with test blobs.
- Or having to do historical research and archaeology to figure out how to update test blobs.
Better to just record upfront what's in the blobs and how they should be treated. Would be nice to have a followup PR adding this.
fa73460 wallet: Fix segmentation fault in CreateWalletFromFile (MarcoFalke) fab3c34 test: Print both messages on failure in assert_raises_message (MarcoFalke) faa1353 wallet: Fix documentation around WalletParameterInteraction (MarcoFalke) Pull request description: Comes with a test to aid review. The test should fail without the fix to bitcoind The following `CreateWalletFromFile` issues are fixed: * `walletFile` refers to freed memory and will thus corrupt the debug.log and/or crash the node if read * `WalletParameterInteraction` was moved to `CreateWalletFromFile` and `WalletInit::ParameterInteraction` without updating the documentation ACKs for top commit: promag: ACK fa73460. darosior: ACK fa73460 meshcollider: LGTM, code-read ACK fa73460 Tree-SHA512: 2aceb63a3f25b90a840cfa08d37f5874aad4eb3df8c2ebf94e2ed18b55809b185e6920bdb345b988bff1fcea5e68a214fe06c361f7da2c01a3cc29e0cc421cb4
…high_minversion 2222c96 test: Add notes on how to generate data/wallets/high_minversion (MarcoFalke) Pull request description: I forgot to do this in bitcoin#16796 ACKs for top commit: ryanofsky: ACK 2222c96 Tree-SHA512: 5f24ffa641b97eac4febad42ade7228b14fa72335c918a10880c5dec86a3ecc3075a31526f275188e07fea95b8e2c6320c64f716099f604b00e13d5366fcee37
…high_minversion 2222c96 test: Add notes on how to generate data/wallets/high_minversion (MarcoFalke) Pull request description: I forgot to do this in bitcoin#16796 ACKs for top commit: ryanofsky: ACK 2222c96 Tree-SHA512: 5f24ffa641b97eac4febad42ade7228b14fa72335c918a10880c5dec86a3ecc3075a31526f275188e07fea95b8e2c6320c64f716099f604b00e13d5366fcee37
Summary: wallet: Fix segmentation fault in CreateWalletFromFile (MarcoFalke) test: Print both messages on failure in assert_raises_message (MarcoFalke) wallet: Fix documentation around WalletParameterInteraction (MarcoFalke) Pull request description: Comes with a test to aid review. The test should fail without the fix to bitcoind The following `CreateWalletFromFile` issues are fixed: * `walletFile` refers to freed memory and will thus corrupt the debug.log and/or crash the node if read * `WalletParameterInteraction` was moved to `CreateWalletFromFile` and `WalletInit::ParameterInteraction` without updating the documentation https://github.com/bitcoin/bitcoin/pull/16796/files --- Backport of Core [[bitcoin/bitcoin#16796 | PR16796]] Test Plan: ninja check check-functional Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7053
…high_minversion 2222c96 test: Add notes on how to generate data/wallets/high_minversion (MarcoFalke) Pull request description: I forgot to do this in bitcoin#16796 ACKs for top commit: ryanofsky: ACK 2222c96 Tree-SHA512: 5f24ffa641b97eac4febad42ade7228b14fa72335c918a10880c5dec86a3ecc3075a31526f275188e07fea95b8e2c6320c64f716099f604b00e13d5366fcee37
…high_minversion 2222c96 test: Add notes on how to generate data/wallets/high_minversion (MarcoFalke) Pull request description: I forgot to do this in bitcoin#16796 ACKs for top commit: ryanofsky: ACK 2222c96 Tree-SHA512: 5f24ffa641b97eac4febad42ade7228b14fa72335c918a10880c5dec86a3ecc3075a31526f275188e07fea95b8e2c6320c64f716099f604b00e13d5366fcee37
Comes with a test to aid review. The test should fail without the fix to bitcoind
The following
CreateWalletFromFileissues are fixed:walletFilerefers to freed memory and will thus corrupt the debug.log and/or crash the node if readWalletParameterInteractionwas moved toCreateWalletFromFileandWalletInit::ParameterInteractionwithout updating the documentation