Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Dec 7, 2019

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

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

@promag
Copy link
Contributor

promag commented Dec 7, 2019

ACK d65fafc.

@kristapsk
Copy link
Contributor

This crash is Mac-specific? Cannot reproduce with current master under Linux.

@jonasschnelli
Copy link
Contributor

I don't think this is Mac specific (looks like a race).
utACK d65fafc

I wonder if there are more race issue in the state where the wallet model hasn't been attached.

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
@fanquake fanquake merged commit d65fafc into bitcoin:master Dec 9, 2019
@fanquake fanquake deleted the disable_early_create_wallet branch December 9, 2019 14:36
MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Dec 9, 2019
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jan 3, 2020
@fanquake fanquake mentioned this pull request Jan 3, 2020
@fanquake
Copy link
Member Author

fanquake commented Jan 5, 2020

Being backported in 17858.

laanwj added a commit that referenced this pull request Jan 8, 2020
99b5407 scripts: fix check-symbols & check-security argument passing (fanquake)
4330a1e Update msvc build for Visual Studio 2019 v16.4 (Aaron Clauson)
b0f9b8e Moves vcpkg list to a text file and updates the appveyor job and readme to use it. (Aaron Clauson)
cd7b3b2 Updated appveyor config:  - Update build image from Visual Studio 2017 to Visual Studio 2019.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added commands to update vcpkg port files (this does not update already installed packages).  - Updated vcpkg package list as per #17309.  - Removed commands setting common project file options. Now done via common.init.vcxproj include.  - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration. Updated msvc project configs:  - Updated platform toolset from v141 to v142.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added ignore for linker warning building bitcoin-qt program.  - Added missing util/str.cpp class file to test_bitcoin project file. (Aaron Clauson)
112144d Add missing typeinfo includes (Wladimir J. van der Laan)
1a6a534 net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan)
c0dc728 test: fix bitcoind already running warnings on macOS (fanquake)
5276b0e util: Add missing headers to util/fees.cpp (Hennadii Stepanov)
4d7875c rpc: require second argument only for scantxoutset start action (Andrew Chow)
bda2f5b cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice (Harris)
d14ab7c gui: disable File->CreateWallet during startup (fanquake)
b9f1bc0 wallet: unbreak with boost 1.72 (Jan Beich)

Pull request description:

  Backports the following PRs to the 0.19 branch:
  * #17654 - Unbreak build with Boost 1.72.0
  * #17695 - gui: disable File->CreateWallet during startup
  * #17687 - cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
  * #17728 - rpc: require second argument only for scantxoutset start action
  * #17450 - util: Add missing headers to util/fees.cpp
  * #17488 - test: fix "bitcoind already running" warnings on macOS
  * #17762 - Log to net category for exceptions in ProcessMessages
  * #17364 - Updates to appveyor config for VS2019 and Qt5.9.8 + msvc project fixes
  * #17416 - Appveyor improvement - text file for vcpkg package list
  * #17736 - Update msvc build for Visual Studio 2019 v16.4
  * #17857 - scripts: fix symbol-check & security-check argument passing

  Fixes #17856.

ACKs for top commit:
  sipsorcery:
    ACK (tested: Windows 10 & msvc build) 99b5407.

Tree-SHA512: 91313de56fb0825e70a4be30ba0bf561b8c26d7dcf60549185df4f5e3524099398c828bb46faae807b631634d1afd5a1d397fb41e61ecfa0d746e4bf10b923cb
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
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 9, 2021
99b5407 scripts: fix check-symbols & check-security argument passing (fanquake)
4330a1e Update msvc build for Visual Studio 2019 v16.4 (Aaron Clauson)
b0f9b8e Moves vcpkg list to a text file and updates the appveyor job and readme to use it. (Aaron Clauson)
cd7b3b2 Updated appveyor config:  - Update build image from Visual Studio 2017 to Visual Studio 2019.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added commands to update vcpkg port files (this does not update already installed packages).  - Updated vcpkg package list as per bitcoin#17309.  - Removed commands setting common project file options. Now done via common.init.vcxproj include.  - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration. Updated msvc project configs:  - Updated platform toolset from v141 to v142.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added ignore for linker warning building bitcoin-qt program.  - Added missing util/str.cpp class file to test_bitcoin project file. (Aaron Clauson)
112144d Add missing typeinfo includes (Wladimir J. van der Laan)
1a6a534 net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan)
c0dc728 test: fix bitcoind already running warnings on macOS (fanquake)
5276b0e util: Add missing headers to util/fees.cpp (Hennadii Stepanov)
4d7875c rpc: require second argument only for scantxoutset start action (Andrew Chow)
bda2f5b cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice (Harris)
d14ab7c gui: disable File->CreateWallet during startup (fanquake)
b9f1bc0 wallet: unbreak with boost 1.72 (Jan Beich)

Pull request description:

  Backports the following PRs to the 0.19 branch:
  * bitcoin#17654 - Unbreak build with Boost 1.72.0
  * bitcoin#17695 - gui: disable File->CreateWallet during startup
  * bitcoin#17687 - cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
  * bitcoin#17728 - rpc: require second argument only for scantxoutset start action
  * bitcoin#17450 - util: Add missing headers to util/fees.cpp
  * bitcoin#17488 - test: fix "bitcoind already running" warnings on macOS
  * bitcoin#17762 - Log to net category for exceptions in ProcessMessages
  * bitcoin#17364 - Updates to appveyor config for VS2019 and Qt5.9.8 + msvc project fixes
  * bitcoin#17416 - Appveyor improvement - text file for vcpkg package list
  * bitcoin#17736 - Update msvc build for Visual Studio 2019 v16.4
  * bitcoin#17857 - scripts: fix symbol-check & security-check argument passing

  Fixes bitcoin#17856.

ACKs for top commit:
  sipsorcery:
    ACK (tested: Windows 10 & msvc build) 99b5407.

Tree-SHA512: 91313de56fb0825e70a4be30ba0bf561b8c26d7dcf60549185df4f5e3524099398c828bb46faae807b631634d1afd5a1d397fb41e61ecfa0d746e4bf10b923cb
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 9, 2021
99b5407 scripts: fix check-symbols & check-security argument passing (fanquake)
4330a1e Update msvc build for Visual Studio 2019 v16.4 (Aaron Clauson)
b0f9b8e Moves vcpkg list to a text file and updates the appveyor job and readme to use it. (Aaron Clauson)
cd7b3b2 Updated appveyor config:  - Update build image from Visual Studio 2017 to Visual Studio 2019.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added commands to update vcpkg port files (this does not update already installed packages).  - Updated vcpkg package list as per bitcoin#17309.  - Removed commands setting common project file options. Now done via common.init.vcxproj include.  - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration. Updated msvc project configs:  - Updated platform toolset from v141 to v142.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added ignore for linker warning building bitcoin-qt program.  - Added missing util/str.cpp class file to test_bitcoin project file. (Aaron Clauson)
112144d Add missing typeinfo includes (Wladimir J. van der Laan)
1a6a534 net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan)
c0dc728 test: fix bitcoind already running warnings on macOS (fanquake)
5276b0e util: Add missing headers to util/fees.cpp (Hennadii Stepanov)
4d7875c rpc: require second argument only for scantxoutset start action (Andrew Chow)
bda2f5b cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice (Harris)
d14ab7c gui: disable File->CreateWallet during startup (fanquake)
b9f1bc0 wallet: unbreak with boost 1.72 (Jan Beich)

Pull request description:

  Backports the following PRs to the 0.19 branch:
  * bitcoin#17654 - Unbreak build with Boost 1.72.0
  * bitcoin#17695 - gui: disable File->CreateWallet during startup
  * bitcoin#17687 - cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
  * bitcoin#17728 - rpc: require second argument only for scantxoutset start action
  * bitcoin#17450 - util: Add missing headers to util/fees.cpp
  * bitcoin#17488 - test: fix "bitcoind already running" warnings on macOS
  * bitcoin#17762 - Log to net category for exceptions in ProcessMessages
  * bitcoin#17364 - Updates to appveyor config for VS2019 and Qt5.9.8 + msvc project fixes
  * bitcoin#17416 - Appveyor improvement - text file for vcpkg package list
  * bitcoin#17736 - Update msvc build for Visual Studio 2019 v16.4
  * bitcoin#17857 - scripts: fix symbol-check & security-check argument passing

  Fixes bitcoin#17856.

ACKs for top commit:
  sipsorcery:
    ACK (tested: Windows 10 & msvc build) 99b5407.

Tree-SHA512: 91313de56fb0825e70a4be30ba0bf561b8c26d7dcf60549185df4f5e3524099398c828bb46faae807b631634d1afd5a1d397fb41e61ecfa0d746e4bf10b923cb
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 9, 2021
99b5407 scripts: fix check-symbols & check-security argument passing (fanquake)
4330a1e Update msvc build for Visual Studio 2019 v16.4 (Aaron Clauson)
b0f9b8e Moves vcpkg list to a text file and updates the appveyor job and readme to use it. (Aaron Clauson)
cd7b3b2 Updated appveyor config:  - Update build image from Visual Studio 2017 to Visual Studio 2019.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added commands to update vcpkg port files (this does not update already installed packages).  - Updated vcpkg package list as per bitcoin#17309.  - Removed commands setting common project file options. Now done via common.init.vcxproj include.  - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration. Updated msvc project configs:  - Updated platform toolset from v141 to v142.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added ignore for linker warning building bitcoin-qt program.  - Added missing util/str.cpp class file to test_bitcoin project file. (Aaron Clauson)
112144d Add missing typeinfo includes (Wladimir J. van der Laan)
1a6a534 net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan)
c0dc728 test: fix bitcoind already running warnings on macOS (fanquake)
5276b0e util: Add missing headers to util/fees.cpp (Hennadii Stepanov)
4d7875c rpc: require second argument only for scantxoutset start action (Andrew Chow)
bda2f5b cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice (Harris)
d14ab7c gui: disable File->CreateWallet during startup (fanquake)
b9f1bc0 wallet: unbreak with boost 1.72 (Jan Beich)

Pull request description:

  Backports the following PRs to the 0.19 branch:
  * bitcoin#17654 - Unbreak build with Boost 1.72.0
  * bitcoin#17695 - gui: disable File->CreateWallet during startup
  * bitcoin#17687 - cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
  * bitcoin#17728 - rpc: require second argument only for scantxoutset start action
  * bitcoin#17450 - util: Add missing headers to util/fees.cpp
  * bitcoin#17488 - test: fix "bitcoind already running" warnings on macOS
  * bitcoin#17762 - Log to net category for exceptions in ProcessMessages
  * bitcoin#17364 - Updates to appveyor config for VS2019 and Qt5.9.8 + msvc project fixes
  * bitcoin#17416 - Appveyor improvement - text file for vcpkg package list
  * bitcoin#17736 - Update msvc build for Visual Studio 2019 v16.4
  * bitcoin#17857 - scripts: fix symbol-check & security-check argument passing

  Fixes bitcoin#17856.

ACKs for top commit:
  sipsorcery:
    ACK (tested: Windows 10 & msvc build) 99b5407.

Tree-SHA512: 91313de56fb0825e70a4be30ba0bf561b8c26d7dcf60549185df4f5e3524099398c828bb46faae807b631634d1afd5a1d397fb41e61ecfa0d746e4bf10b923cb
Munkybooty pushed a commit to Munkybooty/dash that referenced this pull request Dec 23, 2021
99b5407 scripts: fix check-symbols & check-security argument passing (fanquake)
4330a1e Update msvc build for Visual Studio 2019 v16.4 (Aaron Clauson)
b0f9b8e Moves vcpkg list to a text file and updates the appveyor job and readme to use it. (Aaron Clauson)
cd7b3b2 Updated appveyor config:  - Update build image from Visual Studio 2017 to Visual Studio 2019.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added commands to update vcpkg port files (this does not update already installed packages).  - Updated vcpkg package list as per bitcoin#17309.  - Removed commands setting common project file options. Now done via common.init.vcxproj include.  - Changed msbuild verbosity from normal to quiet. Normal rights a LOT of logs and impacts appveyor job duration. Updated msvc project configs:  - Updated platform toolset from v141 to v142.  - Updated Qt static library from Qt5.9.7 to Qt5.9.8.  - Added ignore for linker warning building bitcoin-qt program.  - Added missing util/str.cpp class file to test_bitcoin project file. (Aaron Clauson)
112144d Add missing typeinfo includes (Wladimir J. van der Laan)
1a6a534 net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan)
c0dc728 test: fix bitcoind already running warnings on macOS (fanquake)
5276b0e util: Add missing headers to util/fees.cpp (Hennadii Stepanov)
4d7875c rpc: require second argument only for scantxoutset start action (Andrew Chow)
bda2f5b cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice (Harris)
d14ab7c gui: disable File->CreateWallet during startup (fanquake)
b9f1bc0 wallet: unbreak with boost 1.72 (Jan Beich)

Pull request description:

  Backports the following PRs to the 0.19 branch:
  * bitcoin#17654 - Unbreak build with Boost 1.72.0
  * bitcoin#17695 - gui: disable File->CreateWallet during startup
  * bitcoin#17687 - cli: fix Fatal LevelDB error when specifying -blockfilterindex=basic twice
  * bitcoin#17728 - rpc: require second argument only for scantxoutset start action
  * bitcoin#17450 - util: Add missing headers to util/fees.cpp
  * bitcoin#17488 - test: fix "bitcoind already running" warnings on macOS
  * bitcoin#17762 - Log to net category for exceptions in ProcessMessages
  * bitcoin#17364 - Updates to appveyor config for VS2019 and Qt5.9.8 + msvc project fixes
  * bitcoin#17416 - Appveyor improvement - text file for vcpkg package list
  * bitcoin#17736 - Update msvc build for Visual Studio 2019 v16.4
  * bitcoin#17857 - scripts: fix symbol-check & security-check argument passing

  Fixes bitcoin#17856.

ACKs for top commit:
  sipsorcery:
    ACK (tested: Windows 10 & msvc build) 99b5407.

Tree-SHA512: 91313de56fb0825e70a4be30ba0bf561b8c26d7dcf60549185df4f5e3524099398c828bb46faae807b631634d1afd5a1d397fb41e61ecfa0d746e4bf10b923cb
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 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.

4 participants