You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❯ cpm install Foo::Bar
objc[80048]: +[NSString initialize] may have been in progress in another thread when fork() was called.
objc[80048]: +[NSString 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.
...
# FAIL
An easy workaround is to set environment variable OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES:
❯ env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES cpm install Foo::Bar
# OK
#!/usr/bin/env perluse strict;
use warnings;
use Cwd;
use Socket 'inet_aton';
my$pid = fork // die;
if ($pid == 0) {
inet_aton "invalid";
exit;
}
wait;
❯ /usr/bin/perl test.pl
objc[34292]: +[NSString initialize] may have been in progress in another thread when fork() was called.
objc[34292]: +[NSString 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.
❯ curl -fsSL https://cpanmin.us | /usr/bin/perl - -nq -Llocal Mojolicious
Successfully installed Mojolicious-9.36
1 distribution installed
❯ env PERL5LIB=$PWD/local/lib/perl5 /usr/bin/perl local/bin/hypnotoad -f app.pl
...
# access http://localhost:8080, then...
objc[35100]: +[NSString initialize] may have been in progress in another thread when fork() was called.
objc[35100]: +[NSString 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.
[2024-04-29 10:03:29.88360] [35097] [info] Worker 35100 stopped
[2024-04-29 10:03:29.88693] [35104] [info] Worker 35104 started
cpm calls
fork(2)
internally.If you use cpm on macOS, you may get errors like
An easy workaround is to set environment variable
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
:Should this issue be fixed in perl itself?
See https://bugs.ruby-lang.org/issues/14009
The text was updated successfully, but these errors were encountered: