Bugfix: Wallet: Soft-fail exceptions within ListWalletDir file checks#19502
Bugfix: Wallet: Soft-fail exceptions within ListWalletDir file checks#19502meshcollider merged 2 commits intobitcoin:masterfrom
Conversation
jonatack
left a comment
There was a problem hiding this comment.
ACK bca838d38c54f3df3c85da54e23857f06f07c6bb
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
bca838d to
4f0cbc4
Compare
|
ACK 4f0cbc4 |
meshcollider
left a comment
There was a problem hiding this comment.
Code review ACK 4f0cbc4
4f0cbc4 to
1e77a8d
Compare
|
Rebased |
hebasto
left a comment
There was a problem hiding this comment.
ACK 1e77a8d5a4faa0757e53e0284662b249eebc3ef7, I have reviewed the code and it looks OK, I agree it can be merged.
jonatack
left a comment
There was a problem hiding this comment.
re-ACK 1e77a8d5a4faa0757e53e0284662b249eebc3ef7
In the new test, the new exception prints:
[httpworker.1] ListWalletDir: Error scanning /tmp/bitcoin_func_test_ql5k4c0f/node0/regtest/wallets/self_walletdat_symlink: boost::filesystem::status: Too many levels of symbolic links: "/tmp/bitcoin_func_test_ql5k4c0f/node0/regtest/wallets/self_walletdat_symlink/wallet.dat"
[httpworker.1] ListWalletDir: Error scanning /tmp/bitcoin_func_test_ql5k4c0f/node0/regtest/wallets/self_walletdat_symlink/wallet.dat: boost::filesystem::status: Too many levels of symbolic links: "/tmp/bitcoin_func_test_ql5k4c0f/node0/regtest/wallets/self_walletdat_symlink/wallet.dat"`
|
I don't see what new issues (aside from rebasing) would be created by merging them separately? |
iirc this a fix for the boost link problem and ( evil wallet ) and makes #18095 obsolete. ̶B̶u̶t̶ ̶i̶f̶ ̶t̶h̶i̶s̶ ̶g̶e̶t̶ ̶m̶e̶r̶g̶e̶d̶ ̶f̶i̶r̶s̶t̶,̶ ̶t̶h̶e̶n̶ ̶r̶e̶a̶l̶ ̶s̶h̶o̶r̶t̶ ̶f̶i̶l̶e̶n̶a̶m̶e̶s̶ ̶w̶a̶l̶l̶e̶t̶s̶ ̶f̶r̶o̶m̶ ̶t̶h̶e̶ ̶l̶a̶t̶e̶r̶ ̶f̶o̶u̶n̶d̶ ̶b̶u̶g̶ ̶c̶o̶u̶l̶d̶ ̶b̶e̶ ̶c̶r̶e̶a̶t̶e̶d̶ ̶f̶r̶o̶m̶ ̶a̶ ̶b̶o̶g̶u̶s̶ ̶d̶i̶r̶n̶a̶m̶e̶ ̶o̶n̶ ̶d̶i̶s̶k̶ ̶f̶o̶r̶ ̶r̶e̶a̶l̶.̶ |
Diff-minimised Github-Pull: bitcoin#19502 Rebased-From: 4e1ce04e02ad9276b60084e189824718a6f20738
…llet.dat loops are ignored Github-Pull: bitcoin#19502 Rebased-From: 1e77a8d5a4faa0757e53e0284662b249eebc3ef7
meshcollider
left a comment
There was a problem hiding this comment.
re-utACK 1e77a8d5a4faa0757e53e0284662b249eebc3ef7
@luke-jr |
1e77a8d to
9f74b7b
Compare
|
I revoke my ACK as this change makes possible an infinity loop. I suggest to combine into this PR the approach from #18095: bitcoin/src/wallet/walletutil.cpp Lines 42 to 53 in 6904a30 with credits to @uhliksk |
9f74b7b to
49cc691
Compare
|
@hebasto Couldn't reproduce, but it did cause listwallets to miss other wallets. Added a fix and test. |
|
Tested 49cc6919c4f9ef5a33ad5948a1b43496b454fab0, still able to reproduce an infinite loop: then start a node, and initiate a |
49cc691 to
44c0bc3
Compare
There was a problem hiding this comment.
Approach ACK 44c0bc31f4fadc932877d9764402644c84f3be4c, tested on Linux Mint 20 (x86_64).
Instead of an infinite loop having a nice log message:
2020-10-29T20:41:26Z [main] ListWalletDir: Error scanning /home/hebasto/.bitcoin/testnet3/wallets/crash: boost::filesystem::status: Permission denied: "/home/hebasto/.bitcoin/testnet3/wallets/crash/wallet.dat"
Keeping reviewing the last commit.
hebasto
left a comment
There was a problem hiding this comment.
ACK 44c0bc31f4fadc932877d9764402644c84f3be4c
44c0bc3 to
24d2d33
Compare
| } | ||
| } catch (const std::exception& e) { | ||
| LogPrintf("%s: Error scanning %s: %s\n", __func__, it->path().string(), e.what()); | ||
| it.no_push(); |
Previously, an exception would be thrown, which could kill the node in some circumstances.
Includes test changes to cause failure.
Review with
?w=1