perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: t/perl/signals failure
Date Wed, 05 Jan 2005 17:54:22 GMT
Eric Cholet wrote:
> Le 5 janv. 05, à 17:50, Stas Bekman a écrit :
> 
>> Eric Cholet wrote:
>>
>>> Le 5 janv. 05, à 17:41, Eric Cholet a écrit :
>>>
>>>> Le 5 janv. 05, à 17:20, Stas Bekman a écrit :
>>>>
>>>>> As I've followed up, you didn't miss anything. As I'm not on your 
>>>>> platform all I can suggest is to dig into the code, i.e.
>>>>> t/response/TestPerl/signals.pm
>>>>
>>>>
>>>>
>>>> Thanks, here's what I am seeing in that code:
>>>>
>>>>     if (!$static) {
>>>>         local $ENV{PERL_SIGNALS} = "unsafe";
>>>>
>>>>         eval {
>>>>             local $SIG{ALRM} = sub { die "alarm" };
>>>>             alarm 2;
>>>>             run_for_5_sec();
>>>>             alarm 0;
>>>>         };
>>>>         ok t_cmp $@, qr/alarm/, "SIGALRM / unsafe %SIG";
>>>>     }
>>>>
>>>> run_for_5_sec() runs for about 2 seconds, and then nothing happens. In
>>>> the signal handler I replaced die with warn, but the warn doesn't 
>>>> happen.
>>>
>>> I forgot to mention that after those 2 seconds, I see this is the 
>>> error log:
>>> [Wed Jan 05 17:36:54 2005] [notice] child pid 29676 exit signal Alarm 
>>> clock (14)
>>
>>
>> That probably means that Apache installs its own sighandler or 
>> something like that? It certainly shows that a user can't use perl's 
>> ALRM on MaxOSX.
>>
>> Please post a skip patch?
> 
> 
> Sure, but maybe this is also dependent on the version of Perl I'm running,
> MacOSX stock (5.8.1-RC3)
> I'll try to find some time to install a recent Perl to test with.

we don't like RCs, since we can't test for those. Any chance to test with 
non-RC?

> Index: t/response/TestPerl/signals.pm
> ===================================================================
> --- t/response/TestPerl/signals.pm      (revision 124104)
> +++ t/response/TestPerl/signals.pm      (working copy)
> @@ -32,6 +32,10 @@
> 
>      # doesn't work under static prefork
>      if (!$static) {
> +      if ($^O eq 'darwin') {
> +        skip "ALRM can't be used on darwin", 1;

I believe that should be s|1|0|;

> +      }
> +      else {
>          local $ENV{PERL_SIGNALS} = "unsafe";
> 
>          eval {
> @@ -41,6 +45,7 @@
>              alarm 0;
>          };
>          ok t_cmp $@, qr/alarm/, "SIGALRM / unsafe %SIG";
> +      }
>      }
> 
>      # POSIX::sigaction doesn't work under 5.6.x

+1, you have the commit access, right?

(the identation is wrong in the original, i'll fix it later).

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message