macOS High Sierra+
objc[22868]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[22868]: +[__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.
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
$ echo "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" >> .bash_profile
Save, exit, close terminal and re-open the terminal. Verify with:
$ env
[...]
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
This error is caused by an added security to restrict multithreading in macOS High Sierra and later versions.
Apple has defined some rules on what is allowed and not allowed after forking and they have also added async-signal-safety to a limited number of APIs.