Re:Why Ruby App Servers Break on MacOS High Sierra
by captainmuon on Thursday October 19, 2017 @09:22AM
(#15507620)
In that case, the new behavior doesn't make sense. You could call `fork` as the very first thing in a program, and then do all the stuff in the subprocess, and I wouldn't expect it to make a big difference.
Maybe there is an internal `mark_exec_as_called()` function that you could exploit, if you are forking without exec...
Re:Why Ruby App Servers Break on MacOS High Sierra
by eridius on Thursday October 19, 2017 @02:57PM
(#15510608)
Well, something must be spawning a thread first. From the Obj-C source¹, the comment on performForkChildInitialize() (the point where this crash happens) says
> Exception: processes that are single-threaded when fork() is called have no restrictions on +initialize in the child. Examples: sshd and httpd.
¹ https://opensource.apple.com/source/objc4/objc4-723/runtime/...
One of the rules that Apple defined is that you may not call Foundation class initializers after forking.