Skip to content

Conversation

promag
Copy link
Contributor

@promag promag commented Jun 18, 2019

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

The menu must be created before connecting to aboutToShow signal.
@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16106 (gui: Sort wallets in open wallet menu by promag)

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.

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 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.

@hebasto
Copy link
Member

hebasto commented Jun 21, 2019

ACK 5224be5, I have tested the code on Bionic with Qt 5.12.4.

@fanquake
Copy link
Member

@promag apologies, will review this tomorrow.

@fanquake
Copy link
Member

@promag Thanks for following up here, and sorry for the slow review..

I've tested that this change fixes the File -> Open Wallet -> behaviour (#16230):

file_open

I've also checked that with this change on top of master (2cbcc55), the File menu is still disabled during load (#16118):

no_use_before_load

You've mentioned in some other PRs that going forward, when we are testing GUI changes we should be using QT_FATAL_WARNINGS=1. When I use that env variable with this PR, bitcoin-qt segfaults when it finishes loading:

lldb Bitcoin-Qt.app
(lldb) target create "Bitcoin-Qt.app"
Current executable set to 'Bitcoin-Qt.app' (x86_64).
(lldb) env QT_FATAL_WARNINGS=1
(lldb) run
Process 23386 launched: '/Users/michael/github/bitcoin/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt' (x86_64)
2019-06-23 18:21:14.578614+0800 Bitcoin-Qt[23386:57844] MessageTracer: Falling back to default whitelist
Process 23386 stopped
* thread #1, name = 'bitcoin-main', queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff7e3be2c6 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff7e3be2c6 <+10>: jae    0x7fff7e3be2d0            ; <+20>
    0x7fff7e3be2c8 <+12>: movq   %rax, %rdi
    0x7fff7e3be2cb <+15>: jmp    0x7fff7e3b8457            ; cerror_nocancel
    0x7fff7e3be2d0 <+20>: retq   
Target 0: (Bitcoin-Qt) stopped.

@hebasto
Copy link
Member

hebasto commented Jun 23, 2019

@fanquake

You've mentioned in some other PRs that going forward, when we are testing GUI changes we should be using QT_FATAL_WARNINGS=1. When I use that env variable with this PR, bitcoin-qt segfaults when it finishes loading...

It seems unrelated to this PR as warnings could be produced by the internal Qt code. To verify you could launch:

QT_FATAL_WARNINGS=7 bitcoin-qt -debug=qt

and check out warnings in the debug.log.

@fanquake
Copy link
Member

@hebasto Thanks. I had just about figured that out myself, as the debug.log was always cutting off at:

2019-06-23T10:21:21Z UpdateTip: new best=000000000000000000b6a9e3c4aa5619a48023818df48f757f8fff650b51de85 height=494994 version=0x20000002 log2_work=87.490425 tx=272517027 date='2017-11-18T23:38:38Z' progress=0.642811 cache=4.2MiB(31387txo)
2019-06-23T10:21:21Z UpdateTip: new best=000000000000000000aa16a81a9b3b74f47f07bd6184705a3525e8325dffa54f height=494995 version=0x20000000 log2_work=87.490464 tx=272519017 date='2017-11-19T00:03:10Z' progress=0.642816 cache=5.2MiB(39744txo)
2019-06-23T10:21:21Z UpdateTip: new best=00000000000000000076be6678a2efa7793f98900ac0490863514f291e0f90f8 height=494996 version=0x20000000 log2_work=87.490502 tx=272519980 date='2017-11-19T00:03:48Z' progress=0.642818 cache=6.1MiB(47055txo)
2019-06-23T10:21:21Z GUI: Platform customization: "macosx"

So yes, that seems unrelated to this PR, and the changes in #16263 look good.

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

ACK 5224be5 Testing included in a comment above. The segfaulting with QT_FATAL_WARNINGS is unrelated to this change.

@hebasto
Copy link
Member

hebasto commented Jun 23, 2019

@fanquake

I had just about figured that out myself, as the debug.log was always cutting off at:

2019-06-23T10:21:21Z UpdateTip: new best=000000000000000000b6a9e3c4aa5619a48023818df48f757f8fff650b51de85 height=494994 version=0x20000002 log2_work=87.490425 tx=272517027 date='2017-11-18T23:38:38Z' progress=0.642811 cache=4.2MiB(31387txo)
2019-06-23T10:21:21Z UpdateTip: new best=000000000000000000aa16a81a9b3b74f47f07bd6184705a3525e8325dffa54f height=494995 version=0x20000000 log2_work=87.490464 tx=272519017 date='2017-11-19T00:03:10Z' progress=0.642816 cache=5.2MiB(39744txo)
2019-06-23T10:21:21Z UpdateTip: new best=00000000000000000076be6678a2efa7793f98900ac0490863514f291e0f90f8 height=494996 version=0x20000000 log2_work=87.490502 tx=272519980 date='2017-11-19T00:03:48Z' progress=0.642818 cache=6.1MiB(47055txo)
2019-06-23T10:21:21Z GUI: Platform customization: "macosx"

This case has been fixed in #16263 ;)

@fanquake fanquake merged commit 5224be5 into bitcoin:master Jun 23, 2019
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 fanquake mentioned this pull request Jun 23, 2019
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Jun 23, 2019
The menu must be created before connecting to aboutToShow signal.

Github-Pull: bitcoin#16231
Rebased-From: 5224be5
@promag promag deleted the 2019-06-fix-open-menu branch June 24, 2019 02:26
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
The menu must be created before connecting to aboutToShow signal.

Github-Pull: bitcoin#16231
Rebased-From: 5224be5
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
The menu must be created before connecting to aboutToShow signal.

Github-Pull: bitcoin#16231
Rebased-From: 5224be5
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
The menu must be created before connecting to aboutToShow signal.

Github-Pull: bitcoin#16231
Rebased-From: 5224be5
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
The menu must be created before connecting to aboutToShow signal.

Github-Pull: bitcoin#16231
Rebased-From: 5224be5
Bushstar pushed a commit to Bushstar/omnicore that referenced this pull request Aug 24, 2019
The menu must be created before connecting to aboutToShow signal.

Github-Pull: bitcoin#16231
Rebased-From: 5224be5
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 21, 2020
Summary:
The menu must be created before connecting to aboutToShow signal.

bitcoin/bitcoin@5224be5

---

Depends on D6170

Backport of Core [[bitcoin/bitcoin#16231 | PR16231]]

Test Plan:
  ninja

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D6172
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
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
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: Open Wallet does not list available wallets
6 participants