Skip to content

Conversation

promag
Copy link
Contributor

@promag promag commented May 29, 2019

BitcoinApplication::initializeResult and BitcoinGUI::setWalletController are only called after the startup rescan is completed. While the rescan is in progress the window menus are already available.

This PR makes the Open Wallet menu disabled until BitcoinGUI::setWalletController is called.

Screenshot 2019-05-29 at 14 17 48

Fixes #16087

@fanquake fanquake added the GUI label May 29, 2019
@fanquake fanquake added this to the 0.18.1 milestone May 29, 2019
@fanquake
Copy link
Member

Concept ACK.

This fixes the crashing case in #16087, however I think we could make a more extensive change, as even with this fix it's still possible to cause a crash via the other menus.

i.e: if you open Window -> Console and try and execute any command (can be garbage) bitcoin-qt will crash:

On branch pull/16118/local-merge

Process 89287 launched: '/Users/michael/github/bitcoin/src/qt/bitcoin-qt' (x86_64)
2019-05-29 09:57:56.276746-0400 bitcoin-qt[89287:939924] MessageTracer: Falling back to default whitelist
Process 89287 stopped
* thread #1, name = 'bitcoin-main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
    frame #0: 0x00000001015158ba QtWidgets`QCompleter::popup() const + 10
QtWidgets`QCompleter::popup:
->  0x1015158ba <+10>: movq   0x8(%rdi), %rbx
    0x1015158be <+14>: movq   0x88(%rbx), %rax
    0x1015158c5 <+21>: testq  %rax, %rax
    0x1015158c8 <+24>: jne    0x101515942               ; <+146>
Target 0: (bitcoin-qt) stopped.

@fanquake
Copy link
Member

tACK 2d8ad2f on macOS

Using master (c7cfd20) you can trigger a crash by mousing over the File -> Open Wallet menu during startup:

./autogen.sh && ./configure && make check -j6 && make deploy
lldb Bitcoin-Qt.app
(lldb) target create "Bitcoin-Qt.app"
Current executable set to 'Bitcoin-Qt.app' (x86_64).
(lldb) run
Process 35368 launched: '/Users/michael/github/bitcoin/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt' (x86_64)
2019-05-31 09:12:37.511797-0400 Bitcoin-Qt[35368:3580703] MessageTracer: Falling back to default whitelist
Process 35368 stopped
* thread #1, name = 'bitcoin-main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x38)
    frame #0: 0x000000010192fb8e QtCore`QMutex::lock() + 14
QtCore`QMutex::lock:
->  0x10192fb8e <+14>: lock   
    0x10192fb8f <+15>: cmpxchgq %rcx, (%rdi)
    0x10192fb93 <+19>: je     0x10192fba8               ; <+40>
    0x10192fb95 <+21>: movq   %rax, %rbx
Target 0: (Bitcoin-Qt) stopped.

Using this PR (75485ef) the File menu items are disabled during startup:

merge 16118
make check -j6 && make deploy
lldb Bitcoin-Qt.app

disabled menu

The other crash I mentioned above is being fixed separately in #16122.

Copy link
Contributor

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concept ACK

@jonasschnelli
Copy link
Contributor

utACK 75485ef

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 75485ef. It's a simple, sensible fix.

@fanquake fanquake merged commit 75485ef into bitcoin:master Jun 13, 2019
fanquake added a commit that referenced this pull request Jun 13, 2019
75485ef gui: Enable open wallet menu on setWalletController (João Barbosa)

Pull request description:

  `BitcoinApplication::initializeResult` and `BitcoinGUI::setWalletController` are only called after the startup rescan is completed. While the rescan is in progress the window menus are already available.

  This PR makes the Open Wallet menu disabled until `BitcoinGUI::setWalletController` is called.

  ![Screenshot 2019-05-29 at 14 17 48](https://user-images.githubusercontent.com/3534524/58560510-35377480-821d-11e9-8f96-d0573c9e47b0.png)

  Fixes #16087

ACKs for commit 75485e:
  jonasschnelli:
    utACK 75485ef
  ryanofsky:
    utACK 75485ef. It's a simple, sensible fix.

Tree-SHA512: 9395ceed54bbceb6cbf1cd443f783d07a6ebb8fc5515b63c6e1b8b19b216b08d1cba7eaf872814d7c426ab7192f3b416ba0d57fc84f3bcbfebf01ce153794201
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Jun 13, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 13, 2019
75485ef gui: Enable open wallet menu on setWalletController (João Barbosa)

Pull request description:

  `BitcoinApplication::initializeResult` and `BitcoinGUI::setWalletController` are only called after the startup rescan is completed. While the rescan is in progress the window menus are already available.

  This PR makes the Open Wallet menu disabled until `BitcoinGUI::setWalletController` is called.

  ![Screenshot 2019-05-29 at 14 17 48](https://user-images.githubusercontent.com/3534524/58560510-35377480-821d-11e9-8f96-d0573c9e47b0.png)

  Fixes bitcoin#16087

ACKs for commit 75485e:
  jonasschnelli:
    utACK 75485ef
  ryanofsky:
    utACK 75485ef. It's a simple, sensible fix.

Tree-SHA512: 9395ceed54bbceb6cbf1cd443f783d07a6ebb8fc5515b63c6e1b8b19b216b08d1cba7eaf872814d7c426ab7192f3b416ba0d57fc84f3bcbfebf01ce153794201
@ryanofsky
Copy link
Contributor

@promag, you mentioned that this change caused a bug listing wallets in #16230 (fixed in #16231), that you, me, jonas, and fanquake all didn't notice during review.

Could you explain how this PR caused the bug? Also, it'd be good to know if you have any suggestions for things we should look for during reviews, or better ways to structure code to prevent initialization bugs in the future.

@promag
Copy link
Contributor Author

promag commented Jun 18, 2019

Like you said above, and considering this was already a fix to another problem, at the time I didn't pay attention to remaining functionality. I guess other reviewers made the same mistake. Ideally we should have tests to prevent regressions like you say in #16075.

With this change the following

connect(m_open_wallet_action->menu(), &QMenu::aboutToShow, [this] {

is worthless as the menu is only created and set later on setWalletController.

I'm a bit surprised it works because (haven't checked for runtime warnings though) ->menu() is null. The result is that the menu is never updated.

Not sure if there's a way to abort if QObject::connect() is called with nullptr.

@ryanofsky
Copy link
Contributor

Thanks for the explanation, that makes a lot of sense. I agree it's is odd that Qt doesn't complain about trying to connect to a signal from a null object. In retrospect, I guess if we see a change delaying initialization like this (delaying m_open_wallet_action->setMenu()), a good thing to do would be to scroll down and make sure the uninitialized object (m_open_wallet_action->menu()) is not used in the meantime.

@promag
Copy link
Contributor Author

promag commented Jun 18, 2019

@ryanofsky actually running with -debug it shows a warning:

2019-06-18T15:16:13Z GUI: QObject::connect(QMenu, Unknown): invalid null parameter

@promag
Copy link
Contributor Author

promag commented Jun 18, 2019

@ryanofsky So after some googling a suggestion is to run like:

QT_FATAL_WARNINGS=1 lldb src/qt/bitcoin-qt -- --regtest -debug
...
bt
...
* thread #1, name = 'bitcoin-main', queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff653d823e libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff6548ec1c libsystem_pthread.dylib`pthread_kill + 285
    frame #2: 0x00007fff653411c9 libsystem_c.dylib`abort + 127
    frame #3: 0x0000000101c2e2d9 QtCore`___lldb_unnamed_symbol169$$QtCore + 9
    frame #4: 0x0000000101c2ee0b QtCore`QMessageLogger::warning(char const*, ...) const + 241
    frame #5: 0x0000000101e328ff QtCore`QObjectPrivate::connectImpl(QObject const*, int, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObject const*) + 863
    frame #6: 0x0000000101e32507 QtCore`QObject::connectImpl(QObject const*, void**, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObject const*) + 359
    frame #7: 0x000000010001af79 bitcoin-qt`BitcoinGUI::createActions() [inlined] std::__1::enable_if<(QtPrivate::FunctionPointer<BitcoinGUI::createActions()::$_14>::ArgumentCount) == (-(1)), QMetaObject::Connection>::type QObject::connect<void (sender=0x0000000000000000, context=0x0000000000000000, slot=<unavailable>, type=DirectConnection)(), BitcoinGUI::createActions()::$_14>(QtPrivate::FunctionPointer<void (QMenu::*)()>::Object const*, void (QMenu::*)(), QObject const*, BitcoinGUI::createActions()::$_14, Qt::ConnectionType) at qobject.h:329:16 [opt]
    frame #8: 0x000000010001af1f bitcoin-qt`BitcoinGUI::createActions() [inlined] std::__1::enable_if<(QtPrivate::FunctionPointer<BitcoinGUI::createActions()::$_14>::ArgumentCount) == (-(1)), QMetaObject::Connection>::type QObject::connect<void (sender=0x0000000000000000, signal=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, slot=<unavailable>)(), BitcoinGUI::createActions()::$_14>(QtPrivate::FunctionPointer<void (QMenu::*)()>::Object const*, void (QMenu::*)(), BitcoinGUI::createActions()::$_14) at qobject.h:302 [opt]
    frame #9: 0x000000010001af1f bitcoin-qt`BitcoinGUI::createActions(this=0x0000000102b4d700) at bitcoingui.cpp:371 [opt]
    frame #10: 0x000000010001732c bitcoin-qt`BitcoinGUI::BitcoinGUI(this=0x0000000102b4d700, node=0x00000001029d7a40, _platformStyle=0x0000000102d81e70, networkStyle=<unavailable>, parent=<unavailable>) at bitcoingui.cpp:120:5 [opt]
    frame #11: 0x000000010000abe4 bitcoin-qt`BitcoinApplication::createWindow(this=0x00007ffeefbff660, networkStyle=<unavailable>) at bitcoin.cpp:239:18 [opt]
    frame #12: 0x000000010000d2cd bitcoin-qt`GuiMain(argc=<unavailable>, argv=<unavailable>) at bitcoin.cpp:569:13 [opt]
    frame #13: 0x00007fff65298ed9 libdyld.dylib`start + 1

Which clearly shows the problem. Going to add this to doc/productivity.md.

@promag promag deleted the 2019-05-null-walletcontroller branch June 18, 2019 15:38
fanquake added a commit that referenced this pull request Jun 23, 2019
5224be5 gui: Fix open wallet menu initialization order (João Barbosa)

Pull request description:

  Fixes #16230, the menu must be created before connecting to aboutToShow signal.

ACKs for commit 5224be:
  hebasto:
    ACK 5224be5, I have tested the code on Bionic with Qt 5.12.4.
  ryanofsky:
    utACK 5224be5. Looks good, fix is simple and makes perfect sense after seeing explanation in #16118 (comment). Without this change (and since #16118), the menu pointer passed to `connect(m_open_wallet_action->menu(), ...)` is null and connecting has no effect. With this change, the menu is constructed earlier so the connect call can work.
  fanquake:
    ACK 5224be5 Testing included in a comment above. The segfaulting with QT_FATAL_WARNINGS is unrelated to this change.

Tree-SHA512: 97b42493b37b96683058bccf39a0ee93589293d4ba8f0c60aef7f4fb9dd084cc6d5608cd5ef531cadf5e03b1f01627ef96bc2d79f784fb38cb87aa6643183d41
fanquake added a commit that referenced this pull request Jun 24, 2019
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - #16118 (comment)
  - #16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 30, 2019
5224be5 gui: Fix open wallet menu initialization order (João Barbosa)

Pull request description:

  Fixes bitcoin#16230, the menu must be created before connecting to aboutToShow signal.

ACKs for commit 5224be:
  hebasto:
    ACK 5224be5, I have tested the code on Bionic with Qt 5.12.4.
  ryanofsky:
    utACK 5224be5. Looks good, fix is simple and makes perfect sense after seeing explanation in bitcoin#16118 (comment). Without this change (and since bitcoin#16118), the menu pointer passed to `connect(m_open_wallet_action->menu(), ...)` is null and connecting has no effect. With this change, the menu is constructed earlier so the connect call can work.
  fanquake:
    ACK 5224be5 Testing included in a comment above. The segfaulting with QT_FATAL_WARNINGS is unrelated to this change.

Tree-SHA512: 97b42493b37b96683058bccf39a0ee93589293d4ba8f0c60aef7f4fb9dd084cc6d5608cd5ef531cadf5e03b1f01627ef96bc2d79f784fb38cb87aa6643183d41
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Aug 23, 2019
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
fanquake added a commit that referenced this pull request Dec 9, 2019
d65fafc gui: disable File->CreateWallet during startup (fanquake)

Pull request description:

  Same as #16118. Early calls to Create Wallet will crash bitcoin-qt.

  ```bash
  lldb /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -- --regtest -debug

  Process 18143 launched: '/Users/michael/github/bitcoin/src/qt/bitcoin-qt' (x86_64)
  2019-12-07 15:49:37.823867-0500 bitcoin-qt[18143:5696499] MessageTracer: Falling back to default whitelist
  Process 18143 stopped
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
      frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
  bitcoin-qt`CreateWalletActivity::createWallet:
  ->  0x1000d2d9d <+381>: movq   0x18(%rax), %r14
      0x1000d2da1 <+385>: movq   %r15, -0xa8(%rbp)
      0x1000d2da8 <+392>: leaq   -0xa0(%rbp), %r12
      0x1000d2daf <+399>: leaq   -0x80(%rbp), %rsi
  Target 0: (bitcoin-qt) stopped.
  (lldb) bt
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    * frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
      frame #1: 0x0000000100833e6f bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1631
      frame #2: 0x0000000100a1fc47 bitcoin-qt`QDialog::done(int) + 247
      frame #3: 0x0000000100833ef5 bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1765
      frame #4: 0x00000001009e04c2 bitcoin-qt`QDialogButtonBoxPrivate::_q_handleButtonClicked() + 786
  ```

ACKs for top commit:
  jonasschnelli:
    utACK d65fafc
  promag:
    ACK d65fafc.

Tree-SHA512: 12d7f9e8772508bffbb0163849d9eceec5b1c80068c5d377a4d0973c713dc5f8ad38be8f793fec843d7fb604f0e60a72398b0c95f0a8b775dab39d25b29ac046
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 21, 2020
Summary:
bitcoin/bitcoin@75485ef

---

Depends on D6169

Backport of Core [[bitcoin/bitcoin#16118 | PR16118]]

Test Plan:
  ninja

I don't have access to a macOS box to check the menu is disabled while the splash screen loads, wat do

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6170
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 7, 2020
Summary:
> Same as [[bitcoin/bitcoin#16118 | PR16118]]. Early calls to Create Wallet will crash bitcoin-qt.

This PR disables menus actions at startup and enables them again later
in `BitcoinGUI::setWalletController`.
I could not test that the menu is disabled, because on my Ubuntu machine
I don't have access to these menus until after the startup rescan is finished.
AFAIK, these menus are visible on Windows (through the systray icon) or Mac as
soon as the program is started, while the program is still showing the startup screen.

This is a backport of Core [[bitcoin/bitcoin#17695 | PR17695]]

Test Plan: Build and run bitcoin-qt, and make sure the menu still works after startup rescan is completed.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8302
@hebasto
Copy link
Member

hebasto commented Feb 25, 2021

Going to add this to doc/productivity.md.

Added to Developer Notes for Qt Code :)

@promag
Copy link
Contributor Author

promag commented Feb 25, 2021

@hebasto nice!

PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 25, 2021
75485ef gui: Enable open wallet menu on setWalletController (João Barbosa)

Pull request description:

  `BitcoinApplication::initializeResult` and `BitcoinGUI::setWalletController` are only called after the startup rescan is completed. While the rescan is in progress the window menus are already available.

  This PR makes the Open Wallet menu disabled until `BitcoinGUI::setWalletController` is called.

  ![Screenshot 2019-05-29 at 14 17 48](https://user-images.githubusercontent.com/3534524/58560510-35377480-821d-11e9-8f96-d0573c9e47b0.png)

  Fixes bitcoin#16087

ACKs for commit 75485e:
  jonasschnelli:
    utACK 75485ef
  ryanofsky:
    utACK 75485ef. It's a simple, sensible fix.

Tree-SHA512: 9395ceed54bbceb6cbf1cd443f783d07a6ebb8fc5515b63c6e1b8b19b216b08d1cba7eaf872814d7c426ab7192f3b416ba0d57fc84f3bcbfebf01ce153794201
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Oct 25, 2021
5224be5 gui: Fix open wallet menu initialization order (João Barbosa)

Pull request description:

  Fixes bitcoin#16230, the menu must be created before connecting to aboutToShow signal.

ACKs for commit 5224be:
  hebasto:
    ACK 5224be5, I have tested the code on Bionic with Qt 5.12.4.
  ryanofsky:
    utACK 5224be5. Looks good, fix is simple and makes perfect sense after seeing explanation in bitcoin#16118 (comment). Without this change (and since bitcoin#16118), the menu pointer passed to `connect(m_open_wallet_action->menu(), ...)` is null and connecting has no effect. With this change, the menu is constructed earlier so the connect call can work.
  fanquake:
    ACK 5224be5 Testing included in a comment above. The segfaulting with QT_FATAL_WARNINGS is unrelated to this change.

Tree-SHA512: 97b42493b37b96683058bccf39a0ee93589293d4ba8f0c60aef7f4fb9dd084cc6d5608cd5ef531cadf5e03b1f01627ef96bc2d79f784fb38cb87aa6643183d41
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Oct 30, 2021
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Oct 30, 2021
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Nov 2, 2021
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Nov 2, 2021
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Nov 4, 2021
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Nov 16, 2021
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
75485ef gui: Enable open wallet menu on setWalletController (João Barbosa)

Pull request description:

  `BitcoinApplication::initializeResult` and `BitcoinGUI::setWalletController` are only called after the startup rescan is completed. While the rescan is in progress the window menus are already available.

  This PR makes the Open Wallet menu disabled until `BitcoinGUI::setWalletController` is called.

  ![Screenshot 2019-05-29 at 14 17 48](https://user-images.githubusercontent.com/3534524/58560510-35377480-821d-11e9-8f96-d0573c9e47b0.png)

  Fixes bitcoin#16087

ACKs for commit 75485e:
  jonasschnelli:
    utACK 75485ef
  ryanofsky:
    utACK 75485ef. It's a simple, sensible fix.

Tree-SHA512: 9395ceed54bbceb6cbf1cd443f783d07a6ebb8fc5515b63c6e1b8b19b216b08d1cba7eaf872814d7c426ab7192f3b416ba0d57fc84f3bcbfebf01ce153794201
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
5224be5 gui: Fix open wallet menu initialization order (João Barbosa)

Pull request description:

  Fixes bitcoin#16230, the menu must be created before connecting to aboutToShow signal.

ACKs for commit 5224be:
  hebasto:
    ACK 5224be5, I have tested the code on Bionic with Qt 5.12.4.
  ryanofsky:
    utACK 5224be5. Looks good, fix is simple and makes perfect sense after seeing explanation in bitcoin#16118 (comment). Without this change (and since bitcoin#16118), the menu pointer passed to `connect(m_open_wallet_action->menu(), ...)` is null and connecting has no effect. With this change, the menu is constructed earlier so the connect call can work.
  fanquake:
    ACK 5224be5 Testing included in a comment above. The segfaulting with QT_FATAL_WARNINGS is unrelated to this change.

Tree-SHA512: 97b42493b37b96683058bccf39a0ee93589293d4ba8f0c60aef7f4fb9dd084cc6d5608cd5ef531cadf5e03b1f01627ef96bc2d79f784fb38cb87aa6643183d41
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Nov 18, 2021
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 7, 2022
d65fafc gui: disable File->CreateWallet during startup (fanquake)

Pull request description:

  Same as bitcoin#16118. Early calls to Create Wallet will crash bitcoin-qt.

  ```bash
  lldb /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -- --regtest -debug

  Process 18143 launched: '/Users/michael/github/bitcoin/src/qt/bitcoin-qt' (x86_64)
  2019-12-07 15:49:37.823867-0500 bitcoin-qt[18143:5696499] MessageTracer: Falling back to default whitelist
  Process 18143 stopped
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
      frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
  bitcoin-qt`CreateWalletActivity::createWallet:
  ->  0x1000d2d9d <+381>: movq   0x18(%rax), %r14
      0x1000d2da1 <+385>: movq   %r15, -0xa8(%rbp)
      0x1000d2da8 <+392>: leaq   -0xa0(%rbp), %r12
      0x1000d2daf <+399>: leaq   -0x80(%rbp), %rsi
  Target 0: (bitcoin-qt) stopped.
  (lldb) bt
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    * frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
      frame #1: 0x0000000100833e6f bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1631
      frame #2: 0x0000000100a1fc47 bitcoin-qt`QDialog::done(int) + 247
      frame #3: 0x0000000100833ef5 bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1765
      frame #4: 0x00000001009e04c2 bitcoin-qt`QDialogButtonBoxPrivate::_q_handleButtonClicked() + 786
  ```

ACKs for top commit:
  jonasschnelli:
    utACK d65fafc
  promag:
    ACK d65fafc.

Tree-SHA512: 12d7f9e8772508bffbb0163849d9eceec5b1c80068c5d377a4d0973c713dc5f8ad38be8f793fec843d7fb604f0e60a72398b0c95f0a8b775dab39d25b29ac046
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 7, 2022
d65fafc gui: disable File->CreateWallet during startup (fanquake)

Pull request description:

  Same as bitcoin#16118. Early calls to Create Wallet will crash bitcoin-qt.

  ```bash
  lldb /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -- --regtest -debug

  Process 18143 launched: '/Users/michael/github/bitcoin/src/qt/bitcoin-qt' (x86_64)
  2019-12-07 15:49:37.823867-0500 bitcoin-qt[18143:5696499] MessageTracer: Falling back to default whitelist
  Process 18143 stopped
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
      frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
  bitcoin-qt`CreateWalletActivity::createWallet:
  ->  0x1000d2d9d <+381>: movq   0x18(%rax), %r14
      0x1000d2da1 <+385>: movq   %r15, -0xa8(%rbp)
      0x1000d2da8 <+392>: leaq   -0xa0(%rbp), %r12
      0x1000d2daf <+399>: leaq   -0x80(%rbp), %rsi
  Target 0: (bitcoin-qt) stopped.
  (lldb) bt
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    * frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
      frame #1: 0x0000000100833e6f bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1631
      frame #2: 0x0000000100a1fc47 bitcoin-qt`QDialog::done(int) + 247
      frame #3: 0x0000000100833ef5 bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1765
      frame #4: 0x00000001009e04c2 bitcoin-qt`QDialogButtonBoxPrivate::_q_handleButtonClicked() + 786
  ```

ACKs for top commit:
  jonasschnelli:
    utACK d65fafc
  promag:
    ACK d65fafc.

Tree-SHA512: 12d7f9e8772508bffbb0163849d9eceec5b1c80068c5d377a4d0973c713dc5f8ad38be8f793fec843d7fb604f0e60a72398b0c95f0a8b775dab39d25b29ac046
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 11, 2022
d65fafc gui: disable File->CreateWallet during startup (fanquake)

Pull request description:

  Same as bitcoin#16118. Early calls to Create Wallet will crash bitcoin-qt.

  ```bash
  lldb /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -- --regtest -debug

  Process 18143 launched: '/Users/michael/github/bitcoin/src/qt/bitcoin-qt' (x86_64)
  2019-12-07 15:49:37.823867-0500 bitcoin-qt[18143:5696499] MessageTracer: Falling back to default whitelist
  Process 18143 stopped
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
      frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
  bitcoin-qt`CreateWalletActivity::createWallet:
  ->  0x1000d2d9d <+381>: movq   0x18(%rax), %r14
      0x1000d2da1 <+385>: movq   %r15, -0xa8(%rbp)
      0x1000d2da8 <+392>: leaq   -0xa0(%rbp), %r12
      0x1000d2daf <+399>: leaq   -0x80(%rbp), %rsi
  Target 0: (bitcoin-qt) stopped.
  (lldb) bt
  * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x18)
    * frame #0: 0x00000001000d2d9d bitcoin-qt`CreateWalletActivity::createWallet() + 381
      frame #1: 0x0000000100833e6f bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1631
      frame #2: 0x0000000100a1fc47 bitcoin-qt`QDialog::done(int) + 247
      frame #3: 0x0000000100833ef5 bitcoin-qt`QMetaObject::activate(QObject*, int, int, void**) + 1765
      frame #4: 0x00000001009e04c2 bitcoin-qt`QDialogButtonBoxPrivate::_q_handleButtonClicked() + 786
  ```

ACKs for top commit:
  jonasschnelli:
    utACK d65fafc
  promag:
    ACK d65fafc.

Tree-SHA512: 12d7f9e8772508bffbb0163849d9eceec5b1c80068c5d377a4d0973c713dc5f8ad38be8f793fec843d7fb604f0e60a72398b0c95f0a8b775dab39d25b29ac046
gades pushed a commit to cosanta/cosanta-core that referenced this pull request May 9, 2022
a2aabfb Use qInfo() if no error occurs (Hennadii Stepanov)

Pull request description:

  [Warning and Debugging Messages](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages):
  > - `qInfo()` is used for informational messages.
  > - `qWarning()` is used to report warnings and recoverable errors in your
  application.
  >
  > If the `QT_FATAL_WARNINGS` environment variable is set, `qWarning()` exits after printing the warning message. This makes it easy to obtain a backtrace in the debugger.

  [`qWarning()`](https://doc.qt.io/qt-5/qtglobal.html#qWarning):
  > Calls the message handler with the warning message message... This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`.

  This PR allows more productive debugging using the environment variable `QT_FATAL_WARNINGS`.

  Examples:
  - bitcoin#16118 (comment)
  - bitcoin#16254 (comment)

  The behavior, when option `-debug=qt` is set/unset, remains unchanged.

ACKs for commit a2aabf:
  promag:
    ACK a2aabfb, I also have this change locally.
  Empact:
    ACK bitcoin@a2aabfb
  laanwj:
    ACK a2aabfb
  fanquake:
    ACK a2aabfb.

Tree-SHA512: b4df300c9c00a1705b0d3a10227e3deaac19a98b0a898bb60d5a88872cf450fb131eba150d9dd6c29e021566ee04b3b86b7d486bbe28bd894743c128d2309155
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gui: app crashed while rescanning Mac
7 participants