Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI-Compile CPAN distribution.

Report information
The Basics
Id: 85922
Status: open
Priority: 0/
Queue: CGI-Compile

People
Owner: Nobody in particular
Requestors: alexh [...] connect-distribution.co.uk
Cc:
AdminCc:

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



Subject: alarm doesn't work inside compiled script
I am trying to use alarm inside a compiled script; When I run test.pl which compiles script.pl, after 2 seconds, the op is Alarm Clock This is the output Perl gives for an unhandled alarm. If I comment line CGI::Compile:77 # 'local *SIG = +{ %SIG };', then the output is ALARM=ALRM!!!! at ... as I would expect. I am using This is perl 5, version 16, subversion 0 (v5.16.0) built for x86_64-linux (perlbrew) on centos 6 and CGI::Compile version 0.15 Thanks in advance test script below script.pl my $alrm; eval { $SIG{ALRM} = sub { $alrm="ALRM!!!!"; die ALRM!!!" }; eval { alarm 2; while(1){} alarm 0; }; }; alarm 0; die "ALARM=$alrm"; 1; test.pl use CGI::Compile; my $sub = CGI::Compile->compile('script.pl'); $sub->();
Subject: Re: [rt.cpan.org #85922] alarm doesn't work inside compiled script
Date: Fri, 7 Jun 2013 04:15:52 +0900
To: bug-CGI-Compile [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
Can you submit a patch with a unit test at https://github.com/miyagawa/CGI-Compile ? On Thu, Jun 6, 2013 at 7:48 PM, https://www.google.com/accounts/o8/id?id=AItOawk07L9E6YceaUjOg23Y0FwrkHeyAA_SL88 via RT <bug-CGI-Compile@rt.cpan.org> wrote: Show quoted text
> Thu Jun 06 06:48:20 2013: Request 85922 was acted upon. > Transaction: Ticket created by https://www.google.com/accounts/o8/id?id=AItOawk07L9E6YceaUjOg23Y0FwrkHeyAA_SL88 > Queue: CGI-Compile > Subject: alarm doesn't work inside compiled script > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: alexh@connect-distribution.co.uk > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85922 > > > > I am trying to use alarm inside a compiled script; > When I run test.pl which compiles script.pl, after 2 seconds, the op is > > Alarm Clock > > This is the output Perl gives for an unhandled alarm. > > If I comment line CGI::Compile:77 > # 'local *SIG = +{ %SIG };', > > then the output is > ALARM=ALRM!!!! at ... as I would expect. > > I am using > This is perl 5, version 16, subversion 0 (v5.16.0) built for x86_64-linux (perlbrew) on centos 6 > > and > > CGI::Compile version 0.15 > > Thanks in advance > > test script below > > script.pl > my $alrm; > eval { > $SIG{ALRM} = sub { $alrm="ALRM!!!!"; die ALRM!!!" }; > > eval { > > alarm 2; > > while(1){} > > alarm 0; > }; > }; > alarm 0; > > die "ALARM=$alrm"; > > 1; > > > test.pl > use CGI::Compile; > > my $sub = CGI::Compile->compile('script.pl'); > > $sub->(); > > >
-- Tatsuhiko Miyagawa
On Thu Jun 06 15:16:29 2013, miyagawa@gmail.com wrote: Show quoted text
> Can you submit a patch with a unit test at > https://github.com/miyagawa/CGI-Compile ?
> > If I comment line CGI::Compile:77 > > # 'local *SIG = +{ %SIG };',
I hit the same problem. The solution is simple. Instead of localizing the GLOB localize the values: local @SIG{keys %SIG}=@SIG{keys %SIG};