Subject: | fork after encoding(utf8) causes crash |
I have been directed here so I hope it is the right place to report this. If not, I apologize.
Using Strawberry Perl 5.22 on Windows, Encode v. 2.78, I have noticed that calling fork() after STDOUT has been set to encoding(utf8) causes a crash.
See attached sample which will run through the first part, including the fork, but not the other which is after the binmode STDOUT, ":encoding(utf8)";
(also, when submitting this, I upgraded to v. 2.84, but that did not change anything)
Subject: | perl-crash.pl |
# This is perl 5, version 22, subversion 1 (v5.22.1) built for MSWin32-x64-multi-thread
# Encode.pm,v 2.78 2015/09/24 02:18:32
print "Trying once, åh ja\n";
my $pid = fork();
print "Got $pid\n";
if (defined $pid && $pid == 0) {
print "And I am the child\n";
close STDIN;
close STDOUT;
exit(0);
} else {
print "And I am the parent\n";
}
binmode STDOUT, ":encoding(utf8)";
print "Trying again, åh nej\n";
my $pid = fork();
print "Got $pid\n";
if (defined $pid && $pid == 0) {
print "And I am the child\n";
close STDIN;
close STDOUT;
exit(0);
} else {
print "And I am the parent\n";
}