GUI hangs (no windows) when bitcoin-qt runs on macOS Big Sur, and it was compiled with depends (Qt 5.12) #249

issue hebasto openend this issue on March 13, 2021
  1. hebasto commented at 1:09 pm on March 13, 2021: member

    On macOS Big Sur 11.2.3 (20D91):

    0% xcrun --show-sdk-version
    111.1
    

    When bitcoin-qt is compiled with depends, no window is shown.

    That was not the case before bumping Qt version to 5.12.10. See https://github.com/bitcoin/bitcoin/pull/21376#issuecomment-795379418

    I scratched it a bit. Looks like a problem with the Cocoa integration plugin as dereferencing of the QGuiApplicationPrivate::platformIntegration() pointer causes the EXC_BAD_ACCESS error.

    Probably, it’s an upstream bug.


    UPDATE:

    Case A (SDK 11.1)

    • system: Big Sur 11.2.3 (20D91)
    0% xcode-select --print-path    
    1/Library/Developer/CommandLineTools
    2% xcrun --show-sdk-path
    3/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
    4% xcrun --show-sdk-version         
    511.1
    6% make C depends
    7% CONFIG_SITE=$PWD/depends/x86_64-apple-darwin20.3.0/share/config.site ./configure
    8% make
    9% src/qt/bitcoin-qt -regtest -printtoconsole
    

    The client runs but the GUI hangs – no window is created.

    Case B (SDK 11.1 compiled on Catalina, tested on Big Sur)

    • build system: Catalina 10.15.7 (19H524) + Xcode 12.4 (12D4e)
     0% xcodebuild -version
     1Xcode 12.4
     2Build version 12D4e
     3% xcode-select --print-path
     4/Applications/Xcode.app/Contents/Developer
     5% xcrun --sdk macosx --show-sdk-path
     6/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk
     7% xcrun --sdk macosx --show-sdk-version
     811.1
     9% make C depends
    10% CONFIG_SITE=$PWD/depends/x86_64-apple-darwin19.6.0/share/config.site ./configure
    11% make
    12% src/qt/bitcoin-qt -regtest -printtoconsole
    

    Everything works just fine.

    • test system: Big Sur 11.2.3 (20D91)

    The binary compiled on Catalina has been moved to Big Sur.

    0% ~/Downloads/bitcoin-qt -regtest -printtoconsole
    

    The client runs but the GUI hangs – no window is created (the same behavior as in the case A).

    Case C (SDK 10.15.6 from downloaded Xcode 11.7)

    • system: Big Sur 11.2.3 (20D91)
     0% sudo xcode-select --switch ~/Downloads/Xcode_11.7/Xcode.app
     1% xcode-select --print-path
     2/Users/hebasto1/Downloads/Xcode_11.7/Xcode.app/Contents/Developer
     3% xcrun --show-sdk-path
     4/Users/hebasto1/Downloads/Xcode_11.7/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
     5% xcrun --show-sdk-version         
     610.15.6
     7% make C depends
     8% CONFIG_SITE=$PWD/depends/x86_64-apple-darwin20.3.0/share/config.site ./configure
     9% make
    10% src/qt/bitcoin-qt -regtest -printtoconsole
    

    The client runs but the GUI hangs – no window is created (the same behavior as in the case A).


    Xcode 10.3 and older (SDK 10.14.6) does ~not~ work on Big Sur at all. (see https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes)

    But building depends fail:

    Case D (SDK 10.14.6 from downloaded Xcode 10.3)

    • build system: Big Sur 11.2.3 (20D91) + Xcode 10.3 (10G8)
    0% xcodebuild -version
    1Xcode 10.3
    2Build version 10G8
    3% xcode-select --print-path
    4/Applications/Xcode.app/Contents/Developer
    5% xcrun --show-sdk-path
    6/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
    7% xcrun --show-sdk-version
    810.14
    9% make -C depends native_ds_store
    

    The last command fails (looks like an infinite loop).

  2. hebasto added the label Bug on Mar 13, 2021
  3. hebasto added the label macOS on Mar 13, 2021
  4. hebasto commented at 2:46 pm on March 14, 2021: member

    @fanquake

    FWIW, the build on your qt_5_15_2_rebased branch fails as well, unfortunately.

  5. hebasto commented at 10:04 pm on March 15, 2021: member

    Qt 5.12 docs define supported build environment as Xcode 10 (10.14 SDK).

    My attempts to use downloaded Xcode 10.13 on Big Sur failed.

  6. jarolrod commented at 8:32 pm on March 16, 2021: member

    Confirming this issue on macOS Big Sur 11.2.2 and SDK 11.1, I get a bunch of warnings similar to this (if helpful)

    0ld: warning: direct access in function 'QMetaTypeIdQObject<QWindow*, 8>::qt_metatype_id()' from file '/Users/xyz/Code/Bitcoin/test-depends/bitcoin/depends/x86_64-apple-darwin20.3.0/plugins/platforms/libqcocoa.a(qcocoaintegration.o)' to global weak symbol 'QMetaTypeIdQObject<QWindow*, 8>::qt_metatype_id()::metatype_id' from file 'qt/libbitcoinqt.a(libbitcoinqt_a-walletcontroller.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
    
  7. jarolrod commented at 5:07 pm on March 17, 2021: member

    Same issue on macOS Catalina 10.15.7 and SDK 10.15.6

    Edit: Not the same issue, the GUI will actually start with a depends build on macOS Catalina 10.15.7 and SDK 10.15.6. But this message is displayed in the terminal:

    0Unable to create basic Accelerated OpenGL renderer.
    1Unable to create basic Accelerated OpenGL renderer.
    2Core Image is now using the software OpenGL renderer. This will be slow.```
    
  8. hebasto commented at 6:19 pm on March 17, 2021: member

    @jarolrod What is the first dozen of strings in the debug.log (about graphics system)?

    Is this os installation on bare metal or virtualized?

  9. jarolrod commented at 6:28 pm on March 17, 2021: member

    Currently on VM. Do you want me to make a partition on my MacBook and try it bare metal?

    02021-03-17T18:06:48Z Bitcoin Core version v21.99.0-5ef16038a1a8 (release build)
    12021-03-17T18:06:48Z Qt 5.12.10 (static), plugin=cocoa (static)
    22021-03-17T18:06:48Z Static plugins:
    32021-03-17T18:06:48Z  QCocoaIntegrationPlugin, version 330752
    42021-03-17T18:06:48Z  QMacStylePlugin, version 330752
    52021-03-17T18:06:48Z Style: macintosh / QMacStyle
    62021-03-17T18:06:48Z System: macOS 10.15, x86_64-little_endian-lp64
    72021-03-17T18:06:48Z Screen: Display 2560x1080, pixel ratio=1.0
    
  10. hebasto commented at 6:33 pm on March 17, 2021: member

    Currently on VM.

    This could be a reason for Unable to create basic Accelerated OpenGL renderer.

  11. jarolrod commented at 5:15 am on March 18, 2021: member

    @hebasto was able to build and run on bare metal macOS Catalina 10.15.7 without the openGL error. So the 10.15 SDK could be a potential candidate, so is the 10.14 SDK.

    I grabbed my CommandLineTools directory from my 10.15.7 installation moved it over to my 11.2 installation and changed the SDK with sudo xcode-select --switch <new-sdk-path>. On my 10.15.7 machine this directory includes xcrun and when you run xcrun --show-sdk-version prints 10.15. But upon moving to the 11.2 machine and switching the SDK, macOS seems to alter some files in this SDK and xcrun --show-sdk-version prints 11.1. So how could I attempt a build on Big Sur using the Catalina SDK? @fanquake maybe you know how to do this properly?

    Edit: NVM I have to copy over the entire Developer/ directory not just Developer/CommandLineTools

  12. hebasto renamed this:
    The GUI is broken when the bitcoin-qt is compiled with depends (Qt 5.12) on macOS Big Sur
    GUI hangs (no windows) when bitcoin-qt runs on macOS Big Sur, and it was compiled with depends (Qt 5.12)
    on Mar 21, 2021
  13. hebasto commented at 1:38 pm on March 21, 2021: member
    I updated the OP and the title.
  14. hebasto commented at 6:15 pm on March 21, 2021: member

    Some relevant screenshots:

    • bitcoin-qt -choosedatadir

    Screenshot from 2021-03-21 20-14-11

    • bitcoin-qt -wrong-arg

    Screenshot from 2021-03-21 20-31-02

  15. hebasto commented at 6:47 pm on March 21, 2021: member

    Currently, I have no detailed explanation for that, but the following command fixes the issue:

    0$ export QT_MAC_WANTS_LAYER=1
    
  16. hebasto commented at 7:52 pm on March 21, 2021: member
  17. fanquake closed this on Mar 25, 2021

  18. sidhujag referenced this in commit 88de4d7c5c on Mar 25, 2021
  19. hebasto added the label UX on May 1, 2021
  20. bitcoin-core locked this on Aug 16, 2022

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: 2024-10-23 00:20 UTC

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