Skip Menu |

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

Report information
The Basics
Id: 21253
Status: open
Priority: 0/
Queue: PAR-Packer

People
Owner: Nobody in particular
Requestors: zenlerenard [...] gmail.com
Cc:
AdminCc:

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



Subject: Win32::MsgBox bug when using with $SIG{ __DIE__ }
Using : Perl Packager, version 0.12 (PAR version 0.952) Activestate perl 5.8.0 on XP SP2 Compile the following code with pp : use strict ; use warnings ; use Win32 ; $SIG{ __DIE__ } = sub {Win32::MsgBox ("Error : @_ " , 0, $0 ) } ; die "ARRG" ; The resulting exe will produce 4 message windows instead of a single one .
RT-Send-CC: par [...] perl.org
Hi, On Do. 31. Aug. 2006, 05:54:10, zlr wrote: Show quoted text
> Using : Perl Packager, version 0.12 (PAR version 0.952) > Activestate perl 5.8.0 on XP SP2 > > Compile the following code with pp : > > use strict ; > use warnings ; > use Win32 ; > > $SIG{ __DIE__ } = sub {Win32::MsgBox ("Error : @_ " , 0, $0 ) } ; > > die "ARRG" ; > > The resulting exe will produce 4 message windows instead of a single
one . I could verify that. I'm not sure why this happens and I fear I'm unlikely to find out. I'll send a CC to the par@perl.org list where a couple of people hang out who know PAR's quirks better than I do. If you add an exit($CODE) to the SIG handler, you'll only get a single error message box. Perhaps that's already enough. --- use strict ; use warnings ; use Win32 ; $SIG{ __DIE__ } = sub { Win32::MsgBox ("Error : @_ " , 0, $0 ); exit(1); } ; die "ARRG" ; --- The four windows appearing might be related to how PAR runs your program from a binary. It unpacks to a temp dir and runs script/main.pl from the archive. main.pl then runs script/whatever.pl. The Perl intepreter used is the same as the one compiled into parl.exe or used from a shared library. All of these nested executions might somehow throw die() in a cascade because $SIG{__DIE__} is overridden. This is supported by the fact that putting an exit(1) into the handler "fixes" the issue. I doubt PAR can do a lot about this conceptually without rethinking and rewriting a lot of the packaging code. Hope this helps, Steffen
Win32::GUI::Carp is also affected as it uses the %SIG hooks. pp -M Win32::GUI::Carp -e "use Win32::GUI::Carp qw(fatalsToDialog); die 1" a.exe # produces 4 dialogs
From: BOWMANBS [...] cpan.org
Show quoted text
> The four windows appearing might be related to how PAR runs > your program from a binary. It unpacks to a temp dir and > runs script/main.pl from the archive. > main.pl then runs script/whatever.pl. The Perl intepreter used > is the same as the one compiled into parl.exe or used from a shared > library. All of these nested executions might somehow throw die() in a > cascade because $SIG{__DIE__} is overridden. This is supported by the > fact that putting an exit(1) into the handler "fixes" the issue.
It seems so, any overriding of die can be problematic: C:\ddict>pp -e "$SIG{__DIE__} = sub { die '*'.$_[0] }; die 1" C:\ddict>a.exe ****1 at script/ppl8OCS.pl line 1.