-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Bugfix: Wallet: Soft-fail exceptions within ListWalletDir file checks #19502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Wallet: Soft-fail exceptions within ListWalletDir file checks #19502
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK bca838d
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review ACK 4f0cbc4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reviewed 4f0cbc4 and ready to ACK after rebasing.
4f0cbc4
to
1e77a8d
Compare
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 1e77a8d, I have reviewed the code and it looks OK, I agree it can be merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK 1e77a8d
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: 4e1ce04
…llet.dat loops are ignored Github-Pull: bitcoin#19502 Rebased-From: 1e77a8d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK 1e77a8d
@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 49cc691, 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach ACK 44c0bc3, 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 44c0bc3
44c0bc3
to
24d2d33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK 24d2d33, test change fails on master.
nit, could squash.
} | ||
} catch (const std::exception& e) { | ||
LogPrintf("%s: Error scanning %s: %s\n", __func__, it->path().string(), e.what()); | ||
it.no_push(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, TIL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 24d2d33
Previously, an exception would be thrown, which could kill the node in some circumstances.
Includes test changes to cause failure.
Review with
?w=1