Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Parallel::ForkManager and utf8::all crash perl on Windows

by szabgab (Priest)
on Dec 22, 2012 at 09:08 UTC ( #1009989=perlquestion: print w/replies, xml ) Need Help??

szabgab has asked for the wisdom of the Perl Monks concerning the following question:

The following simple test case will crash perl on Windows. (Tried with Strawberry Perl 5.16.2). Any Windows experts might know how to fix it? (On Linux this worked fine.)
use strict; use warnings; use Test::More; use Parallel::ForkManager; eval "use utf8::all"; plan skip_all => 'Need utf8::all for this test crashing on Windows' if + ($@); plan tests => 1; my $fork = Parallel::ForkManager->new( 1 ); foreach (1) { my $pid = $fork->start and next; $fork->finish; } $fork->wait_all_children; ok(1);

Replies are listed 'Best First'.
Re: Parallel::ForkManager and utf8::all crash perl on Windows ( use open qw{:encoding(UTF-8) :std}; fork; ## PerlIO/encoding.dll )
by Anonymous Monk on Dec 22, 2012 at 10:48 UTC

    Simpler test  perl -e " use open qw{:encoding(UTF-8) :std}; fork; "

    c0000005 exception at encoding+0x356a

    Exception number: c0000005 (access violation) *----> State Dump for Thread Id 0x818 <----* eax=00000000 ebx=00a39014 ecx=00a8796c edx=00a39014 esi=009d9edc edi=0 +0a397a8 eip=70fc356a esp=0022f770 ebp=00000000 iopl=0 nv up ei pl nz n +a po nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=0 +0000206 *** ERROR: Symbol file could not be found. Defaulted to export symbol +s for D:\citrusperl\lib\auto\PerlIO\encoding\encoding.dll - function: encoding 70fc354a 348b xor al,0x8b 70fc354c 5c pop esp 70fc354d 2430 and al,0x30 70fc354f 8b30 mov esi,[eax] 70fc3551 8dbb94070000 lea edi,[ebx+0x794] 70fc3557 8b4e38 mov ecx,[esi+0x38] 70fc355a 85c9 test ecx,ecx 70fc355c 0f844a010000 je encoding+0x36ac (70fc36ac) 70fc3562 8b8314010000 mov eax,[ebx+0x114] 70fc3568 8b2b mov ebp,[ebx] FAULT ->70fc356a 8b500c mov edx,[eax+0xc] ds:0023:00 +00000c=???????? 70fc356d 85d2 test edx,edx 70fc356f 0f848d010000 je encoding+0x3702 (70fc3702) 70fc3575 8b02 mov eax,[edx] 70fc3577 c7421802000000 mov dword ptr [edx+0x18],0x2 70fc357e c74210ffffffff mov dword ptr [edx+0x10],0xfffff +fff 70fc3585 8b00 mov eax,[eax] 70fc3587 c7400800000000 mov dword ptr [eax+0x8],0x0 70fc358e 8b8310010000 mov eax,[ebx+0x110] 70fc3594 2b6b0c sub ebp,[ebx+0xc] 70fc3597 8b00 mov eax,[eax] *----> Stack Back Trace <----* WARNING: Stack unwind information not available. Following frames may +be wrong. ChildEBP RetAddr Args to Child 00000000 00000000 00000000 00000000 00000000 encoding+0x356a *

    there are a few recent bug reports
    #111344: warnings FATAL => utf8 not working on PerlIO::encoding layer and open pragma
    #115262: PerlIO::encoding produces malformed utf8
    #115692: PerlIO::encoding can croak, aborting cleanup
    PUSHSTACKi/POPSTACK#98060: possible bug in PerlIO::encoding

    and http://perl5.git.perl.org/perl.git/history/HEAD:/ext/PerlIO-encoding shows very recent edits

    but , while compiling the very latest works, the tests fail with Unknown PerlIO layer "encoding"

    md PerlIO-encoding cd PerlIO-encoding wget http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/ext/PerlIO-en +coding/encoding.xs http://perl5.git.perl.org/perl.git/blob_plain/HEAD +:/ext/PerlIO-encoding/encoding.pm http://perl5.git.perl.org/perl.git/ +blob_plain/HEAD:/ext/PerlIO-encoding/MANIFEST md t cd t wget http://perl5.git.perl.org/perl.git/blob_plain/HEAD:/ext/PerlIO-en +coding/t/encoding.t http://perl5.git.perl.org/perl.git/blob_plain/HEA +D:/ext/PerlIO-encoding/t/fallback.t http://perl5.git.perl.org/perl.g +it/blob_plain/HEAD:/ext/PerlIO-encoding/t/nolooping.t cd .. echo use ExtUtils::MakeMaker; WriteMakefile(qw{ NAME PerlIO::encoding +}); > Makefile.PL perl Makefile.PL dmake dmake test perl -Mblib -e " use open qw{:encoding(UTF-8) :std}; fork; "

    So you should probably perlbug this, and maybe mention this thread and probably that PUSHSTACKi report

Re: Parallel::ForkManager and utf8::all crash perl on Windows
by karlgoethebier (Abbot) on Dec 22, 2012 at 09:31 UTC

    Mmh, it crashed under Mac OS X too:

    Karls-Mac-mini:~ Karl$ ./crash.pl 1..0 # SKIP Need utf8::all for this test crashing on Windows

    But installing utf8::all fixed it...

    Karls-Mac-mini:~ Karl$ ./crash.pl 1..1 ok 1

    Don't know if this helps. Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      Mmh, it crashed under Mac OS X too:

      crash means segfault, not failing test

        Mmh...first test failed. After saying install ut8::all everything looked fine. Nothing about segfault. Please feel free to correct me if i'm totally wrong.

        Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

Re: Parallel::ForkManager and utf8::all crash perl on Windows
by Athanasius (Archbishop) on Dec 22, 2012 at 09:53 UTC
      I could install utf8::all 0.009 on Strawberry. Do you have CPANTESTERS configured to send the fail reports there?

      I arrived to this while trying to install Code-CutNPaste, Ovid might be able to change his module, but it would be nice if this was fixed. (I sent e-mails to all the people involved)

Re: Parallel::ForkManager and utf8::all crash perl on Windows
by tobyink (Canon) on Dec 22, 2012 at 10:03 UTC

    What happens if you load the modules in the other order; load utf8::all first?

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
      Same crash. (Even if I remove all the Test::More related code.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1009989]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-04-13 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?