Denis Morin
Denis Morin

Reputation: 83

Fork issue in apache with passenger in OS X High Sierra

I decided to upgrade to OS x High sierra, and now I have an issue when starting the apps. I have this in the error_log of apache

objc[2019]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[2019]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
[Sun Jul 29 20:21:10.787536 2018] [core:notice] [pid 2004] AH00052: child pid 2019 exit signal Abort trap (6)

I'm running passenger 5.3.3 with ruby 2.5.0 and apache 2.4.33

I have saw a lot of things on the internet, but nothing works...

Help please

Thanks

Upvotes: 1

Views: 1062

Answers (1)

Myst
Myst

Reputation: 19221

It's a known "issue" (that isn't an issue") and has known workarounds.

It's related to the fact that fork, if not performed properly, is fairly unsafe (consider that memory allocation might be happening in a different thread, resulting in a possible breakage for the memory allocator's locking system)...

Anyway, you can find more details about the issue on this Puma issue thread and this blog post.

You can implement any of the suggested solutions, such as setting the environment variable OBJC_DISABLE_INITIALIZE_FORK_SAFETY to YES:

$ export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

Some servers, such as iodine, come with a solution out of the box (hard coded within their code base) while others assume an updated Ruby version.

I think Passenger should have a solution embedded in the newer versions, but I may be wrong.

Upvotes: 2

Related Questions