test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS #951

pull maflcko wants to merge 2 commits into bitcoin-core:master from maflcko:2607-qt-test-macos-style-nullptr-crash-fusion changing 1 files +11 −5
  1. maflcko commented at 12:01 PM on July 22, 2026: contributor

    Fixes https://github.com/bitcoin/bitcoin/issues/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
    
  2. refactor: Run clang-format on qt test_main.cpp faa50c08b1
  3. test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS
    Using the Fusion style works around QTBUG-49686.
    
    Otherwise, there could be a nullptr-deref under the QMacStyle.
    fa0c8337a8
  4. DrahtBot renamed this:
    test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS
    test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS
    on Jul 22, 2026
  5. DrahtBot commented at 12:02 PM on July 22, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    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 <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  6. hebasto commented at 12:11 PM on July 22, 2026: member

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

  7. hebasto commented at 12:24 PM on July 22, 2026: member

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

  8. in src/qt/test/test_main.cpp:72 in fa0c8337a8
      72 | +#endif
      73 |  
      74 | +#ifdef Q_OS_MACOS
      75 | +    // QMacStyle assumes a Cocoa platform window, which the minimal platform
      76 | +    // does not provide. In particular, painting a QGroupBox can make Qt call
      77 | +    // addSubview: on an invalid native object (QTBUG-49686).
    


    hebasto commented at 12:28 PM on July 22, 2026:

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


    maflcko commented at 12:40 PM on July 22, 2026:

    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.

    <!-- ci: ``` https://github.com/bitcoin/bitcoin/pull/33509/changes/d40e61e87cfb18f75742c2efa6e705f38e3b36c9

  9. hebasto approved
  10. hebasto commented at 12:50 PM on July 22, 2026: member

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

  11. hebasto commented at 12:52 PM on July 22, 2026: member

    @fanquake

    Mind checking whether this PR resolves https://github.com/bitcoin/bitcoin/issues/35771 for you?

  12. maflcko commented at 1:05 PM on July 22, 2026: contributor

    CI failure looks unrelated:

    199/354 Test [#202](/bitcoin-core-gui/202/): test_kernel .......................................................***Failed    0.12 sec
    Test setup error: system_error produced by: exp: Out of memory
    
  13. hebasto commented at 1:06 PM on July 22, 2026: 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: https://github.com/bitcoin/bitcoin/pull/35774.

  14. fanquake commented at 1:17 PM on July 22, 2026: member

    Mind checking whether this PR resolves https://github.com/bitcoin/bitcoin/issues/35771 for you?

    The tests pass with this change.

  15. DrahtBot added the label CI failed on Jul 22, 2026
  16. DrahtBot commented at 2:14 PM on July 22, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

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

    <details><summary>Hints</summary>

    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.

    </details>

  17. hebasto merged this on Jul 22, 2026
  18. hebasto closed this on Jul 22, 2026

  19. maflcko deleted the branch on Jul 22, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-02 17:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me