-
Notifications
You must be signed in to change notification settings - Fork 37.7k
gui: Fix unintialized WalletView::progressDialog #18062
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
gui: Fix unintialized WalletView::progressDialog #18062
Conversation
Needs backport. @practicalswift any idea how this was unnoticed? |
So the actual problem this solves is here Line 1337 in ef8e2ce
it's because we check if the pointer is null or not but we never set it to null, so it either contains a real pointer or uninitialized values. |
|
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 acf8abc
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 acf8abc
FWIW @bitcoinhodler tested this, see #17911 (comment). |
@promag Can you add the explanation of what this is fixing and how it's fixing it to the PR description; given it's not in there already and not in the commit message either. |
@elichai actually the code you point out is wrong, see the updated OP. The code you point is fine because the dialog is already initialized. |
Why? both have an initialization if |
ACK acf8abc Nice find. Remind me that we should finally get the functional tests run with the gui. Does this need backport? |
@MarcoFalke yes. |
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 acf8abc, I have reviewed the code and it looks OK, I agree it can be merged.
acf8abc gui: Fix unintialized WalletView::progressDialog (João Barbosa) Pull request description: #17911 shows that it's possible to read the unintialized `progressDialog` in https://github.com/bitcoin/bitcoin/blob/f32564f0a73c5ad1a107dd112e40516f39d1a51e/src/qt/walletview.cpp#L296-L297. And the debugger shows ``` (gdb) bt #0 0x0000555556687c60 in QProgressDialog::wasCanceled() const () #1 0x000055555572989f in WalletView::showProgress (this=0x5555577d7a70, title=..., nProgress=1) at qt/walletview.cpp:322 ``` Closes #17911. ACKs for top commit: hebasto: ACK acf8abc, I have reviewed the code and it looks OK, I agree it can be merged. elichai: utACK acf8abc kristapsk: ACK acf8abc MarcoFalke: ACK acf8abc Tree-SHA512: f5e6d873192d08d1a572e66e17c2e06d1ce27d01aa196b2a7ed591008641295bb02cda8ac90919ff2d2fc778316c2e143f8d36599e0d377779758853dfaf0a31
Github-Pull: bitcoin#18062 Rebased-From: acf8abc
b4e5363 gui: Fix unintialized WalletView::progressDialog (João Barbosa) Pull request description: Backport #18062 to 0.19. ACKs for top commit: Empact: ACK b4e5363 jonasschnelli: utACK b4e5363 Tree-SHA512: 9ebf0c29b606689de118c3d64f0a8f4dd53df05799b3be6da1891cb214c4fca7f0e3f2cd2a205c78496914cec1f7fa469d6df88428fcd6854ede6c61dbbc6d2a
- [0.19] wallet: Reset reused transactions cache bitcoin#18083 - 0.19: Backports bitcoin#17792 - psbt: handle unspendable psbts bitcoin#17524 - qt: Fix comparison function signature bitcoin#17634 - psbt: check that various indexes and amounts are within bounds bitcoin#17156 - [0.19] psbt: check that various indexes and amounts are within bounds bitcoin#18079 - [0.19] Final backports for 0.19.1 bitcoin#17988 - Bug: IsUsedDestination shouldn't use key id as script id for ScriptHash bitcoin#17924 - qt: Fix deprecated QCharRef usage bitcoin#18101 - gui: Throttle GUI update pace when -reindex bitcoin#18121 - gui: Fix race in WalletModel::pollBalanceChanged bitcoin#18123 - gui: Fix unintialized WalletView::progressDialog bitcoin#18062 - Bugfix: GUI: Hide the HD/encrypt icons earlier so they get re-shown if another wallet is open bitcoin#18007 - bug-fix macos: give free bytes to F_PREALLOCATE bitcoin#17887 - test: add missing #include to fix compiler errors bitcoin#17980 - zmq: Fix due to invalid argument and multiple notifiers bitcoin#17445
Summary: This is a backport of [[bitcoin/bitcoin#18062 | core#18062]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Subscribers: majcosta Differential Revision: https://reviews.bitcoinabc.org/D9905
…Dialog b4e5363 gui: Fix unintialized WalletView::progressDialog (João Barbosa) Pull request description: Backport bitcoin#18062 to 0.19. ACKs for top commit: Empact: ACK bitcoin@b4e5363 jonasschnelli: utACK b4e5363 Tree-SHA512: 9ebf0c29b606689de118c3d64f0a8f4dd53df05799b3be6da1891cb214c4fca7f0e3f2cd2a205c78496914cec1f7fa469d6df88428fcd6854ede6c61dbbc6d2a
…Dialog b4e5363 gui: Fix unintialized WalletView::progressDialog (João Barbosa) Pull request description: Backport bitcoin#18062 to 0.19. ACKs for top commit: Empact: ACK bitcoin@b4e5363 jonasschnelli: utACK b4e5363 Tree-SHA512: 9ebf0c29b606689de118c3d64f0a8f4dd53df05799b3be6da1891cb214c4fca7f0e3f2cd2a205c78496914cec1f7fa469d6df88428fcd6854ede6c61dbbc6d2a
…Dialog b4e5363 gui: Fix unintialized WalletView::progressDialog (João Barbosa) Pull request description: Backport bitcoin#18062 to 0.19. ACKs for top commit: Empact: ACK bitcoin@b4e5363 jonasschnelli: utACK b4e5363 Tree-SHA512: 9ebf0c29b606689de118c3d64f0a8f4dd53df05799b3be6da1891cb214c4fca7f0e3f2cd2a205c78496914cec1f7fa469d6df88428fcd6854ede6c61dbbc6d2a
…Dialog b4e5363 gui: Fix unintialized WalletView::progressDialog (João Barbosa) Pull request description: Backport bitcoin#18062 to 0.19. ACKs for top commit: Empact: ACK bitcoin@b4e5363 jonasschnelli: utACK b4e5363 Tree-SHA512: 9ebf0c29b606689de118c3d64f0a8f4dd53df05799b3be6da1891cb214c4fca7f0e3f2cd2a205c78496914cec1f7fa469d6df88428fcd6854ede6c61dbbc6d2a
#17911 shows that it's possible to read the unintialized
progressDialog
inbitcoin/src/qt/walletview.cpp
Lines 296 to 297 in f32564f
And the debugger shows
Closes #17911.