Kernel panic when bootstrapping on Mac OS X 10.7.5
Running the ./bootstrap
script to build recent CMake on Mac OS X 10.7.5 causes a kernel panic. IOW, the OS crashes and stops responding and the computer must be restarted manually. AFAIK, 10.7.x is the only macOS version affected. The name of the process running when the kernel panic occurs is cmake
. The crash occurs right as the bootstrap cmake
process is starting to run. I have observed this on a VMware ESXi virtual machine on a 2009 Xserve and on a real 2011 13" MacBook Pro. @kencu reports observing this on a Parallels VM and also on real Mac hardware.
I do not recall seeing this problem with CMake versions before 3.28.0-rc1. I did see this problem with release candidates of CMake 3.28.0 and the latest 3.29.x code from the repository as of commit cff8aefc from March 22. @kencu reports that 3.28.4 does not have the problem.
@kencu pointed to #25414 (closed) and !9176 (merged) as being possibly related. !9176 (merged) was included in CMake 3.28.2 and later but not 3.29.x. Since !9176 (merged) is a large changeset I did not try applying it to the current code but I did test whether it is the reason for the problem being solved in 3.28.x.
Using this command to build (after installing clang-3.7 with MacPorts) on the 2011 MacBook Pro:
mkdir build && cd build
CC=clang-mp-3.7 CXX=clang++-mp-3.7 CXXFLAGS="-stdlib=libc++ -D_DARWIN_C_SOURCE" ../bootstrap --parallel=$(sysctl -n hw.activecpu)
I tested commit adb3e13d which was right before the use of libuv was reverted and experienced the kernel panic. And I tested bcbb212d which is the commit in which the use of libuv was reverted and the crash does not occur, so this does indeed appear to be the solution to the kernel panic. A subsequent make -j$(sysctl -n hw.activecpu)
fails when building the bundled cmcurl but that's a separate problem.