I’ve tried building the latest LLDB + LLVM from trunk on two different OSX machines running Lion (10.7.5) and the resulting lldb binary seems to cause a kernel panic when run. I’m not an OSX developer normally so it’s quite possible that I’m doing something wrong and I’m wondering if anyone has any pointers.
I have tried with both clang 3.2 (the default for Xcode 4.6) as well as clang 3.3 from MacPorts with the following configure line:
./configure --enable-optimized --enable-assertions --enable-cxx11 --enable-libcpp
The lldb binary can be run but crashes when trying to launch a process.
Any ideas are welcome.
Try modifying the function in Host.mm:
static short GetPosixspawnFlags (ProcessLaunchInfo &launch_info)
by commenting out the following lines:
// Close all files exception those with file actions if this is supported.
flags |= POSIX_SPAWN_CLOEXEC_DEFAULT;
Using this flag used to cause kernel panics. Maybe it still does on 10.7? Let me know if this fixes things and if it does, then I will place a dynamic MacOSX version check for 10.8 and above.
That was exactly it, removing those lines makes the kernel panic go away.
Thanks for the help!
Try top of tree with no modifications now:
% svn commit
Transmitting file data .
Committed revision 198776.
I added dynamic OS version checking and we don't use the flag for 10.7 and earlier.
No crash anymore on top of tree, looks good!