macOS Catalina #16387

issue Sjors openend this issue on July 14, 2019
  1. Sjors commented at 12:04 pm on July 14, 2019: member

    New macOS releases have historically led to unpleasant surprises, so I decided to run the beta on an older machine. I installed both the beta of macOS and Xcode, and made the latter default using sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer.

    Note that Apple switched the default shell to zsh: https://support.apple.com/kb/HT208050

    Beta 3

    TL&DR: binaries still work, but building QT from source doesn’t and depends seems broken

    The existing binary on my system kept working fine. I was also able to download and install v0.18 from bitcoincore.org.

    Compling master (536590f358dc3d3e5821eba7f1009452ea93b205) from source source fails, see (log).

    Using Homebrew with boost 1.70.0 and qt 5.13.0.

    The tests produce a bunch of warnings:

    0test/util_threadnames_tests.cpp:64:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long, int>' requested here
    1    BOOST_CHECK_EQUAL(names.size(), 100);
    2    ^
    3/usr/local/include/boost/test/tools/old/interface.hpp:154:45: note: expanded from macro 'BOOST_CHECK_EQUAL'
    4#define BOOST_CHECK_EQUAL( L, R )           BOOST_TEST_TOOL_IMPL( 0, \
    5                                            ^
    6/usr/local/include/boost/test/tools/old/interface.hpp:67:47: note: expanded from macro 'BOOST_TEST_TOOL_IMPL'
    7    BOOST_PP_IF( frwd_type, report_assertion, check_frwd ) (                    \
    

    These warnings also occur in the Solaris problem in #15708.

    QT produces warnings:

     0  CXX      qt/libbitcoinqt_a-bitcoinunits.o
     1qt/bitcoinamountfield.cpp:124:24: warning: 'width' is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
     2            int w = fm.width(BitcoinUnits::format(BitcoinUnits::BTC, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways));
     3                       ^
     4/usr/local/Cellar/qt/5.13.0/lib/QtGui.framework/Headers/qfontmetrics.h:107:5: note: 'width' has been explicitly marked deprecated here
     5    QT_DEPRECATED_X("Use QFontMetrics::horizontalAdvance")
     6    ^
     7/usr/local/Cellar/qt/5.13.0/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
     8#  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
     9                                ^
    10/usr/local/Cellar/qt/5.13.0/lib/QtCore.framework/Headers/qcompilerdetection.h:649:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
    11#    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
    12                                                      ^
    

    And finally QT throws an error:

     0  CXX      qt/libbitcoinqt_a-networkstyle.o
     1qt/guiutil.cpp:365:14: error: no matching function for call to 'objc_msgSend'
     2    id app = objc_msgSend((id) objc_getClass("NSApplication"), sel_registerName("sharedApplication"));
     3             ^~~~~~~~~~~~
     4/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/message.h:63:1: note: candidate function not viable: requires 0 arguments, but 2 were provided
     5objc_msgSend(void /* id self, SEL op, ... */ )
     6^
     7qt/guiutil.cpp:366:5: error: no matching function for call to 'objc_msgSend'
     8    objc_msgSend(app, sel_registerName("activateIgnoringOtherApps:"), YES);
     9    ^~~~~~~~~~~~
    10/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/message.h:63:1: note: candidate function not viable: requires 0 arguments, but 3 were provided
    11objc_msgSend(void /* id self, SEL op, ... */ )
    12^
    132 errors generated.
    14make[2]: *** [qt/libbitcoinqt_a-guiutil.o] Error 1
    

    I can ./configure --without-gui and run the test suite.

    I reinstalled all of homebrew, but still get the above warnings and errors.

    Using depends instead, I’m unable to build protobuf (see log). When I strip out protobuf, Boost fails in the same way as #13601 (log). However in this case xcode-select --install doesn’t make the issue go away, and the other workaround /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg no longer exists. See also this dicussion.

  2. fanquake added the label macOS on Jul 14, 2019
  3. promag commented at 11:20 pm on July 16, 2019: member

    Regarding the Qt fix, it’s only available in 5.11 https://doc.qt.io/qt-5/qfontmetrics.html#horizontalAdvance so nothing can be done now unless we add conditional directive for Qt 5.11 - which wouldn’t be tested.

    Regarding objc_msgSend, a similar issue can be found at https://stackoverflow.com/a/25853741, apparently some compiler flag changed so either fix that or cast the function pointer accordingly to ...objc/message.h:

    0 56  * These functions must be cast to an appropriate function pointer type
    1 57  * before being called.
    
  4. hebasto commented at 10:37 am on August 25, 2019: member

    @promag

    Regarding objc_msgSend, … apparently some compiler flag changed…

    Correct. See #16720.

  5. Sjors commented at 2:13 pm on August 25, 2019: member
    @hebasto thanks, that worked! I was able to compile and sync the chain.
  6. fanquake referenced this in commit 7d6f63cc2c on Sep 1, 2019
  7. Sjors commented at 4:20 pm on October 9, 2019: member
    I just compiled and ran Bitcoin QT master (1c11e53bb604835afd838f4520d3fdba25521c5b) on the macOS Catalina release. Other than the annoying build warnings shown above, it seems to work.
  8. Sjors closed this on Oct 9, 2019

  9. Sjors commented at 11:53 am on October 11, 2019: member
    make check is broken for me. Could be something specific to my machine, but making an issue anyway: https://github.com/bitcoin-core/secp256k1/issues/674
  10. Sjors reopened this on Oct 11, 2019

  11. Sjors commented at 2:11 pm on October 12, 2019: member

    When I strip out protobuf, Boost fails in the same way as #13601 (log). However in this case xcode-select --install doesn’t make the issue go away, and the other workaround /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg no longer exists. See also this dicussion.

    This should be fixed with #17118.

  12. meeDamian commented at 3:14 pm on October 12, 2019: contributor

    I’m also still getting an error on Catalina (on 561a7d304).

     0Running test/util/bitcoin-util-test.py...
     1/usr/local/bin/python3.7 ../test/util/bitcoin-util-test.py
     2Running test/util/rpcauth-test.py...
     3/usr/local/bin/python3.7 ../test/util/rpcauth-test.py
     4...
     5----------------------------------------------------------------------
     6Ran 3 tests in 0.018s
     7
     8OK
     9Running bench/bench_bitcoin -evals=1 -scaling=0...
    10bench/bench_bitcoin -evals=1 -scaling=0 > /dev/null
    11  CC       src/tests-tests.o
    12  CCLD     tests
    13  CC       src/exhaustive_tests-tests_exhaustive.o
    14  CCLD     exhaustive_tests
    15/Library/Developer/CommandLineTools/usr/bin/make  check-TESTS
    16./build-aux/test-driver: line 107: 33356 Segmentation fault: 11  "$@" > $log_file 2>&1
    17FAIL: tests
    18PASS: exhaustive_tests
    19============================================================================
    20Testsuite summary for libsecp256k1 0.1
    21============================================================================
    22# TOTAL: 2
    23# PASS:  1
    24# SKIP:  0
    25# XFAIL: 0
    26# FAIL:  1
    27# XPASS: 0
    28# ERROR: 0
    29============================================================================
    30See ./test-suite.log
    31============================================================================
    32make[6]: *** [test-suite.log] Error 1
    33make[5]: *** [check-TESTS] Error 2
    34make[4]: *** [check-am] Error 2
    35make[3]: *** [check-local] Error 2
    36make[2]: *** [check-am] Error 2
    37make[1]: *** [check-recursive] Error 1
    38make: *** [check-recursive] Error 1
    
  13. MarcoFalke added this to the milestone 0.19.0 on Oct 12, 2019
  14. MarcoFalke added the label Bug on Oct 12, 2019
  15. MarcoFalke added the label Upstream on Oct 12, 2019
  16. Sjors commented at 3:29 pm on October 12, 2019: member
    @meeDamian that’s the same issue I found. You can work around it with ./configure CFLAGS="-fno-stack-check" though I have no idea if that’s safe. See https://github.com/bitcoin-core/secp256k1/issues/674
  17. meeDamian commented at 4:12 pm on October 12, 2019: contributor

    @meeDamian that’s the same issue I found. You can work around it with ./configure CFLAGS="-fno-stack-check" though I have no idea if that’s safe. See bitcoin-core/secp256k1#674

    Can confirm it worked, and I was finally able to successfully build Bitcoind 😊. Thank you Sjors!

  18. mmortal03 commented at 3:52 am on November 7, 2019: none
    @Sjors , can this be closed? I noticed it was still on the 0.19.0 milestone.
  19. laanwj commented at 9:20 am on November 7, 2019: member

    ./configure CFLAGS="-fno-stack-check" though I have no idea if that’s safe

    I might be wrong, but from what I understand it’s not: that disables all stack checks. So also stack protector cookies. If someone were to find a buffer overflow in bitcoin core, that’d make it trivial to exploit and gain RCE. There haven’t been many historically; some in UPNP, one in the SOCKS5 handling, but never in P2P network code. Still, we would never consider disabling that for a release.

  20. Sjors commented at 3:06 pm on November 7, 2019: member

    Milestone can be removed, because we compile the release against an older SDK.

    The safest workaround is probably to use the 10.14 SDK:

    0./configure CFLAGS=-mmacosx-version-min=10.14
    
  21. fanquake removed this from the milestone 0.19.0 on Nov 7, 2019
  22. Sjors commented at 10:10 am on November 14, 2019: member
    This problem magically solved itself with Xcode 11.2 (as discovered by @fanquake in bitcoin-core/secp256k1#674.
  23. Sjors closed this on Nov 14, 2019

  24. furszy referenced this in commit 24bc866346 on Apr 13, 2020
  25. 10xcryptodev referenced this in commit 148c2ddcc1 on May 14, 2020
  26. michelvankessel referenced this in commit 532482c35b on Oct 25, 2020
  27. michelvankessel referenced this in commit 110367de6a on Oct 25, 2020
  28. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC

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