Hello,
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.
lldb /usr/bin/python
(lldb) r
Any ideas are welcome.
Thanks,
Andrew
Try modifying the function in Host.mm:
static short GetPosixspawnFlags (ProcessLaunchInfo &launch_info)
by commenting out the following lines:
#ifdef POSIX_SPAWN_CLOEXEC_DEFAULT
// Close all files exception those with file actions if this is supported.
flags |= POSIX_SPAWN_CLOEXEC_DEFAULT;
#endif
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.
Greg
Hi Greg,
That was exactly it, removing those lines makes the kernel panic go away.
Thanks for the help!
Andrew
Try top of tree with no modifications now:
% svn commit
Sending source/Host/macosx/Host.mm
Transmitting file data .
Committed revision 198776.
I added dynamic OS version checking and we don't use the flag for 10.7 and earlier.
Greg
No crash anymore on top of tree, looks good!