You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/05/19 21:42:02 UTC

DO NOT REPLY [Bug 39618] New: - SIGALARM From Perl cgi is not being handled properly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39618>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39618

           Summary: SIGALARM From Perl cgi is not being handled properly
           Product: Apache httpd-2
           Version: 2.2.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: worker
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: johnha@ccbill.com


Httpd 2.2.2 is not handling Perl cgi SIGALRMs properly when used with Worker
MPM.  Something very similar happened in 2.0.55, and was fixed and working again
in 2.2.0, but in 2.2.2 it's broken again. I *think* the bug is only applicable
to Worker MPM due to threading Vs. process forking.  The perl CGI sends a
SIGALRM to it's parent httpd process, which should wait a specified amount of
time and send a signal back to the originating process (the cgi).  I think that
signal is being sent to the wrong thread, or perhaps not being sent at all.  The
following cgi code can reproduce this bug.

#!/usr/bin/perl
$ENV{PERL_SIGNALS} = 'unsafe';
use POSIX qw(SIGALRM);

my $mask = POSIX::SigSet->new(SIGALRM);
my $action = POSIX::SigAction->new(sub { die "Database connection attempt timed
out\n"; }, {flags => 0, safe => 1}, $mask);
my $oldaction = POSIX::SigAction->new();
POSIX::sigaction(SIGALRM, $action, $oldaction);


print "Content-type: text/plain\n\n";
eval{
  #my $sigHandler = set_sig_handler('ALRM', sub { die "Database connection
attempt timed out\n"; }, {flags => 0, safe => 1});
  alarm(3);
  sleep(4);
  print "Here\n";
  alarm(0);
};
POSIX::sigaction(SIGALRM, $oldaction);
alarm(0);

if ($@){
  print "Received error (".$@.")\n";
}
else {
  print "No error\n";
}

The correct output should be "Recieved error." if the .cgi was sent a signal by
it's parent.  A response of "No error" indicates that the .cgi did not recieve
it's signal callback.

Your help is greatly appreciated.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39618] - SIGALARM From Perl cgi is not being handled properly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39618>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39618





------- Additional Comments From andrew@autobaun.net  2006-07-31 17:46 -------
Please fix this as soon as possible.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39618] - SIGALARM From Perl cgi is not being handled properly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39618>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39618


jorton@redhat.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From jorton@redhat.com  2008-02-11 03:41 -------
Are you using mod_cgi or mod_cgid?  If the former, does it work with the latter?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39618] - SIGALARM From Perl cgi is not being handled properly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39618>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39618





------- Additional Comments From jasonk@ccbill.com  2008-02-11 10:06 -------
We don't use either. However, this issue seems to have been fixed as of 2.2.3.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39618] - SIGALARM From Perl cgi is not being handled properly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39618>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39618


rpluem@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From rpluem@apache.org  2008-02-11 12:19 -------
Marked as fixed as per comment of reporter.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org