New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tcmalloc incompatible with macOS Monterey? #1312
Comments
Confirmed with a c++ proprietary program, linked to log4cxx (https://logging.apache.org/log4cxx/latest_stable/). We're trying to set up a minimal reproducible example. |
Attached a highly simplified application which replicates the crash using log4cxx as @natale-p suggested. This simply uses log4cxx and instantiates a logger. It crashes in the registerClass method when adding an element to the map for the ClassNamePatternConverter class. This is the 11th entry being added to the map.
|
An even simpler version which does not require log4cxx.
|
The root cause is a missing implementation for a macOS method that is documented as "optional" while is actually used in the code. For example, the following code:
When linked with tcmalloc is crashing (see https://developer.apple.com/forums/thread/693430?answerId=695428022#695428022). With the patch proposed here (#1315) the code compiles & runs fine. |
… flags; fix min macOS version (#90) This commit fixes 3 issues and contains various other improvements. 1. yugabyte/yugabyte-db#10533 (incorrectly using libuv from Homebrew): - Explicitly specify libuv search path when building Cassandra C++ driver. This prevents us from using Homebrew-provided libuv even if it is installed. - Do not allow Homebrew library paths to appear in `otool -L` output when checking dynamic libraries. This enforces that the resulting thirdparty package does not depend on any Homebrew libraries, e.g. libuv. 2. yugabyte/yugabyte-db#10448 (tcmalloc issue on macOS Monterey): Update gperftools with a patch that fixes tcmalloc on macOS Monterey. Upstream gperftools issue: gperftools/gperftools#1312, fix: gperftools/gperftools#1315 3. yugabyte/yugabyte-db#10661 (incorrectly setting min macOS version): Add validation that libraries are built for the correct target version of macOS by examining the output of `otool -l`. As part of looking into this, I found out that Boost previously did not even use the compiler and linker flags that we were providing. Fixed this by specifying the `toolset=...` parameter to b2. Also fixed Boost build on x86_64 macOS (after the arm64 commit landed, we would always specify the arm64 architecture). Another dependency that required changes was crypt_blowfish (needed to pass `-mmacosx-version-min=...` in LDFLAGS and ASFLAGS). I noticed that specifying min macOS version as 10.14 (Mojave) does not work when building for arm64, so I specified min macOS version as 11.2 there for now. Also specifying minimum macOS version does not seem to work correctly when building on macOS 10.15 (Catalina) on GitHub Actions, but works well on Big Sur (11.x) so we will look into upgrading our build workers, and we may have to release a few packages manually. Other improvements: - Specify patch_strip as 1 by default so we don't have to specify it everywhere. - Add a --force flag to rebuild dependencies even if the system thinks it does not need to based on "stamp" files. - Add a --delete-build-dir to delete a dependency's build directory before attempting to build that dependency. - Always rebuild dependencies if the build directory is missing. - Generate convenient shell scripts allowing to re-run CMake builds manually. - Expand the "patch marker" file naming format to include the number of patches. - Remove unused test data for compiler version detection (we are now using the https://pypi.org/project/compiler-identification/ module). - The redis_cli dependency used to have custom logic to patch how libhiredis refers to itself on macOS. This patching belongs in hiredis.py, and we have a standard implementation for it (fix_shared_library_references) so the custom code from redis_cli.py is being deleted.
Hello, the issue is not in compiling, but when executing with the tcmalloc library. |
Starting with Monterey protobuf related build actions fail due to a missing implementation of free_definite_size in tc_malloc for OSX. Upstream issue and fix: gperftools/gperftools#1312 gperftools/gperftools#1315 gperftools/gperftools@852fb6d Added new patchfile for gperftools and changed download-thirdparty.sh accordingly.
Starting with Monterey protobuf related build actions fail due to a missing implementation of free_definite_size in tc_malloc for OSX. Upstream issue and fix: gperftools/gperftools#1312 gperftools/gperftools#1315 gperftools/gperftools@852fb6d Added new patchfile for gperftools and changed download-thirdparty.sh accordingly. Change-Id: Iae7719b233083616e21e5822d4f682efc324ec40 Reviewed-on: http://gerrit.cloudera.org:8080/18172 Reviewed-by: Attila Bukor <abukor@apache.org> Tested-by: Attila Bukor <abukor@apache.org> Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
I assume 852fb6d has fixed the issue ? |
Closing for now. Please reopen if you're still having trouble. |
Previous to Monterey tcmalloc was incompatible with apps launched from the Dock. As of Monterey tcmalloc causes apps to crash even when launched from the command line. I've tried 2.7 and 2.9.1.
See also https://trac.macports.org/ticket/63242 which I assume is the same issue.
The resulting stack is pretty useless as far as I can tell, but here you go.
The text was updated successfully, but these errors were encountered: