If a progress notification > 0
arrives immediately after notification = 100
then progressDialog
is a dangling pointer.
Potential fix for #16134.
NACK
I think you missed the one in WalletView::showProgress here: https://github.com/bitcoin/bitcoin/blob/cd42553b1178a48a16017eff0b70669c84c3895c/src/qt/walletview.cpp#L318
tACK https://github.com/bitcoin/bitcoin/pull/16135/commits/d2ae6be80f6a0156021bf8c9b9d17cd4966ddffc
On master (c7cfd20a77ce57d200b3b9e5e0dfb0d63818abdc) & 0.18
you can cause a segfault doing:
0src/bitcoin-cli -regtest dumpwallet ~/downloads/wallet
1src/bitcoin-cli -regtest importwallet ~/downloads/wallet
0lldb Bitcoin-Qt.app -- -regtest
1(lldb) target create "Bitcoin-Qt.app"
2Current executable set to 'Bitcoin-Qt.app' (x86_64).
3(lldb) settings set -- target.run-args "-regtest"
4(lldb) run
5Process 10564 launched: '/Users/michael/github/bitcoin/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt' (x86_64)
62019-06-03 09:23:45.314524-0400 Bitcoin-Qt[10564:8394825] MessageTracer: Falling back to default whitelist
7Process 10564 stopped
8* thread [#1](/bitcoin-bitcoin/1/), name = 'bitcoin-main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
9 frame [#0](/bitcoin-bitcoin/0/): 0x0000000100e516f1 QtWidgets`QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) + 17
10QtWidgets`QWidgetPrivate::close_helper:
11-> 0x100e516f1 <+17>: movl 0x140(%rdi), %eax
12 0x100e516f7 <+23>: movb $0x1, %bl
13 0x100e516f9 <+25>: testl $0x200, %eax ; imm = 0x200
14 0x100e516fe <+30>: jne 0x100e5192c ; <+588>
15Target 0: (Bitcoin-Qt) stopped.
I cannot cause the same crash using this PR.
deleteLater
.
utACK
Post-merge utACK d2ae6be80f6a0156021bf8c9b9d17cd4966ddffc
FWIW:
0$ git grep -A1 'deleteLater()'
1src/qt/bitcoingui.cpp: progressDialog->deleteLater();
2src/qt/bitcoingui.cpp- progressDialog = nullptr;
3--
4src/qt/paymentserver.cpp: reply->deleteLater();
5src/qt/paymentserver.cpp-
6--
7src/qt/sendcoinsdialog.cpp: ui->entries->takeAt(0)->widget()->deleteLater();
8src/qt/sendcoinsdialog.cpp- }
9--
10src/qt/sendcoinsdialog.cpp: entry->deleteLater();
11src/qt/sendcoinsdialog.cpp-
12--
13src/qt/splashscreen.cpp: deleteLater(); // No more need for this
14src/qt/splashscreen.cpp-}
15--
16src/qt/walletview.cpp: progressDialog->deleteLater();
17src/qt/walletview.cpp- progressDialog = nullptr;