I have a reliable way to call *something* in the pthread_atfork prepare handler, but I honestly don't know what to call to prevent the crash.
In the Ruby thread, it seemed to say that you could just dlopen /System/Library/Frameworks/Foundation.framework/Foundation but that does not work for me. Neither does also loading the CoreFoundation and SystemConfiguration frameworks.
If anybody has something that will reliably initialize the runtime, I can post my approach (there are a few subtleties). Short of that, I think there's nothing that can be done except ensure that exec is called right after fork. |