Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 90870
Status: resolved
Priority: 0/
Queue: PAR-Packer

People
Owner: RSCHUPP [...] cpan.org
Requestors: gabor [...] szabgab.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Segmentation fault (core dumped) (MooX::Options)
Date: Thu, 28 Nov 2013 12:24:22 +0200
To: bug-par-packer [...] rt.cpan.org
From: Gabor Szabo <gabor [...] szabgab.com>
Download (untitled) / with headers
text/plain 196b
The code I have looks like this: use Moo; use MooX::Options; print "hello world"; pp a.pl prints the warnings mentioned in #90869 then running ./a.out generates a segmentation fault. Gabor
Subject: Re: [rt.cpan.org #90870] AutoReply: Segmentation fault (core dumped) (MooX::Options)
Date: Thu, 28 Nov 2013 13:33:35 +0200
To: bug-PAR-Packer [...] rt.cpan.org
From: Gabor Szabo <gabor [...] szabgab.com>
Download (untitled) / with headers
text/plain 611b
I started to travel down the rabbit hole of dependencies and found out that both of these 2-line snippets generate segmentation fault: use B::Hooks::EndOfScope; print "hello world\n"; use Class::MOP; print "hello world\n"; (they are both deep prerequisites of MooX::Options) A few more examples that currently generate segementation fault but will probably work once those above two work. use Moo; use MooX::ConfigFromFile; use Moo; use MooX::File::ConfigDir; use Moo::Role; use namespace::autoclean; use namespace::autoclean; use B::Hooks::EndOfScope; use Class::MOP; use namespace::clean;
Subject: Re: [rt.cpan.org #90870] AutoReply: Segmentation fault (core dumped) (MooX::Options)
Date: Thu, 28 Nov 2013 17:05:48 +0200
To: bug-PAR-Packer [...] rt.cpan.org
From: Gabor Szabo <gabor [...] szabgab.com>
Download (untitled) / with headers
text/plain 185b
The segfault happens while using a self brewed 5.18.0 on 64bit Linux. Based on the comment http://perlmonks.org/?node_id=1064831 it seems it works on 5.18.1. I am going to try it now.
Download (untitled) / with headers
text/plain 957b
On 2013-11-28 10:06:03, gabor@szabgab.com wrote: Show quoted text
> Based on the comment http://perlmonks.org/?node_id=1064831 > it seems it works on 5.18.1. I am going to try it now.
Nope, I can reproduce the problem here (Debian unstable with the distro perl 5.18.1). Actually there are several problems here: (1) B::Hooks::EndOfScope use either B::Hooks::EndOfScope::PP or B::Hooks::EndOfScope::XS, but Module::ScanDeps is not able to infer that, so neither is packed by pp. But that should result in "Can't load..." error or such, not in a segfault. (2) Similar for Pod::Usage: it uses either Pod::Text or Pod::PlainText; again Module::ScanDeps fails, should result in 'die "Can't load..."'. Here's the real culprit: $ pp -o hello.exe -e 'die "WTF?";' $ ./hello.exe Segmentation fault This happens for Perl 5.18.1. But Perl 5.16.3 is OK: $ pp -o hello.exe -e 'die "WTF?";' $ ./hello.exe WTF? at script/ppTspYF.pl line 1. Very puzzling. Cheers, Roderich
Download (untitled) / with headers
text/plain 2.8k
On 2013-11-28 13:54:36, RSCHUPP wrote: Show quoted text
> Here's the real culprit: > > $ pp -o hello.exe -e 'die "WTF?";' > $ ./hello.exe > Segmentation fault > > This happens for Perl 5.18.1. But Perl 5.16.3 is OK: > > $ pp -o hello.exe -e 'die "WTF?";' > $ ./hello.exe > WTF? at script/ppTspYF.pl line 1.
Fixed in PAR::Packer 1.016 (just uploaded to PAUSE). NOTE: This fixes segfaults triggered by any "die" in the packed executable, but not your original problem trying to pack stuff using Moo* stuff. At least, you can see the real reason: $ pp -o szabgab.exe -e 'use B::Hooks::EndOfScope; print "hello world\n";' $ ./szabgab.exe Could not find a suitable B::Hooks::EndOfScope implementation: Can't locate B/Hooks/EndOfScope/XS.pm in @INC (you may need to install the B::Hooks::EndOfScope::XS module) (@INC contains: CODE(0x31f0420) /tmp/par-726f646572696368/cache-6c66675a43a552779a3148d04cd01bdb1fbc6744/inc/lib /tmp/par-726f646572696368/cache-6c66675a43a552779a3148d04cd01bdb1fbc6744/inc CODE(0x30a44f0) CODE(0x30b6540)) at Module/Runtime.pm line 317. Can't locate B/Hooks/EndOfScope/PP.pm in @INC (you may need to install the B::Hooks::EndOfScope::PP module) (@INC contains: CODE(0x31f0420) /tmp/par-726f646572696368/cache-6c66675a43a552779a3148d04cd01bdb1fbc6744/inc/lib /tmp/par-726f646572696368/cache-6c66675a43a552779a3148d04cd01bdb1fbc6744/inc CODE(0x30a44f0) CODE(0x30b6540)) at Module/Runtime.pm line 317. at B/Hooks/EndOfScope.pm line 21. BEGIN failed--compilation aborted at B/Hooks/EndOfScope.pm line 32. Compilation failed in require at script/ppXCrHm.pl line 1. BEGIN failed--compilation aborted at script/ppXCrHm.pl line 1. B::Hooks::EndOfScope needs either B::Hooks::EndOfScope::PP or B::Hooks::EndOfScope::XS, but Module::ScanDeps didn't detect that. Workaround: add the missing modules to the "pp" command (witn option "-M"). I may fix Module::ScanDeps to detect that, but don't hold your breath :) Another example: $ pp -o szabgab.exe -e 'use namespace::clean; print "hello world\n";' $ ./szabgab.exe Could not find a suitable B::Hooks::EndOfScope implementation: ... So that's caused by the missing dependencies of B::Hooks::EndOfScope. The last example is from your post on PerlMonks: $ pp -o szabgab.exe -e 'use Pod::Usage qw(pod2usage); print "hello world\n";' $ ./szabgab.exe Can't locate Pod/Text.pm in @INC (you may need to install the Pod::Text module) (@INC contains: CODE(0x20b3bc8) /tmp/par-726f646572696368/cache-b5dffca7b1fc4b69c2161e1512cc77e7d16f538d/inc/lib /tmp/par-726f646572696368/cache-b5dffca7b1fc4b69c2161e1512cc77e7d16f538d/inc CODE(0x1f65320) CODE(0x1f77370)) at (eval 17) line 2. BEGIN failed--compilation aborted at Pod/Usage.pm line 30. Compilation failed in require at script/ppJ7pGG.pl line 1. BEGIN failed--compilation aborted at script/ppJ7pGG.pl line 1. Again, Module::ScanDeps failed to detect that Pod::Usage requires Pod::Text. Cheers, Roderich
Subject: Re: [rt.cpan.org #90870] Segmentation fault (core dumped) (MooX::Options)
Date: Sat, 30 Nov 2013 23:25:22 +0200
To: bug-PAR-Packer [...] rt.cpan.org
From: Gabor Szabo <gabor [...] szabgab.com>
Lots of lots of thanks! Both for the fix and for the speed of the fix! Gabor
Subject: Re: [rt.cpan.org #90870] Segmentation fault (core dumped) (MooX::Options)
Date: Sat, 30 Nov 2013 23:32:18 +0100
To: bug-PAR-Packer [...] rt.cpan.org
From: Juan José 'Peco' San Martín <jsanmartin [...] gmail.com>
Yep, the work of Roderich is really impressive.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.