Skip to content

test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS#951

Merged
hebasto merged 2 commits into
bitcoin-core:masterfrom
maflcko:2607-qt-test-macos-style-nullptr-crash-fusion
Jul 22, 2026
Merged

test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS#951
hebasto merged 2 commits into
bitcoin-core:masterfrom
maflcko:2607-qt-test-macos-style-nullptr-crash-fusion

Conversation

@maflcko

@maflcko maflcko commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes bitcoin/bitcoin#35771

Using the Fusion style works around QTBUG-49686.

Otherwise, there could be an invalid call under the QMacStyle.

Can be tested via:

QT_STYLE_OVERRIDE=macOS  build/bin/test_bitcoin-qt  # fails
QT_STYLE_OVERRIDE=fusion build/bin/test_bitcoin-qt  # passes

MarcoFalke added 2 commits July 22, 2026 13:51
Using the Fusion style works around QTBUG-49686.

Otherwise, there could be a nullptr-deref under the QMacStyle.
@DrahtBot DrahtBot changed the title test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS Jul 22, 2026
@DrahtBot

DrahtBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK hebasto

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

@hebasto

hebasto commented Jul 22, 2026

Copy link
Copy Markdown
Member

Concept ACK. My current WIP branch also uses style overriding.

@hebasto

hebasto commented Jul 22, 2026

Copy link
Copy Markdown
Member

So far, this bug has only been reproduced when Qt plugins are linked statically. Unfortunately, this configuration is not covered by CI.

Comment thread src/qt/test/test_main.cpp
#ifdef Q_OS_MACOS
// QMacStyle assumes a Cocoa platform window, which the minimal platform
// does not provide. In particular, painting a QGroupBox can make Qt call
// addSubview: on an invalid native object (QTBUG-49686).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you sure that QTBUG-49686 is a good reference? Asking because it doesn't mention styles at all.

@maflcko maflcko Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the issue is specific in the title, but the general issue is that a bunch of the code assumes Cocoa, and then throws/aborts/crashes when that assumption is violated with the Minimal platform plugin.

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK fa0c833, tested on macOS Tahoe 26.5.2 (Intel).

@hebasto

hebasto commented Jul 22, 2026

Copy link
Copy Markdown
Member

@fanquake

Mind checking whether this PR resolves bitcoin/bitcoin#35771 for you?

@maflcko

maflcko commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

CI failure looks unrelated:

199/354 Test #202: test_kernel .......................................................***Failed    0.12 sec
Test setup error: system_error produced by: exp: Out of memory

@hebasto

hebasto commented Jul 22, 2026

Copy link
Copy Markdown
Member

So far, this bug has only been reproduced when Qt plugins are linked statically. Unfortunately, this configuration is not covered by CI.

Apparently, @willcl-ark is working in that: bitcoin/bitcoin#35774.

@fanquake

Copy link
Copy Markdown
Member

Mind checking whether this PR resolves bitcoin/bitcoin#35771 for you?

The tests pass with this change.

@DrahtBot

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task Alpine (musl): https://github.com/bitcoin-core/gui/actions/runs/29917983667/job/88916243995
LLM reason (✨ experimental): CI failed because the test_kernel CTest job crashed during setup due to an out-of-memory error.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@hebasto
hebasto merged commit a2e074d into bitcoin-core:master Jul 22, 2026
28 of 29 checks passed
@maflcko
maflcko deleted the 2607-qt-test-macos-style-nullptr-crash-fusion branch July 22, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gui: test_bitcoin-qt segfaults on macOS if built from depends

4 participants