httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Skolnick <cl...@organic.com>
Subject WWW Form Bug Report: "httpd doesn't terminate on SIGTERM" on Solaris 2.x (fwd)
Date Tue, 28 May 1996 19:06:40 GMT

more bugs...this guy is at least nice enough to give us patches.

--
Cliff Skolnick                                      cliff@organic.com

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- Benjamin Franklin, 1759

---------- Forwarded message ----------
Date: Tue May 28 8:48:36 1996
From: jk@tools.de
To: cliff@organic.com
Subject: WWW Form Bug Report: "httpd doesn't terminate on SIGTERM" on Solaris 2.x

Submitter: jk@tools.de
Operating system: Solaris 2.x, version: 
Version of Apache Used: 1.1b2 1.1b3-dev
Extra Modules used: 
URL exhibiting problem: 

Symptoms:
--
Sending a SIGTERM (as user root using /bin/sh as
shell) doesn't terminate apache under Solaris 2.5
(but other SVR4 systems are probably affected, too).

After sending the SIGTERM, /usr/proc/bin/psig on the
pid of the apache master process shows
    TERM	blocked,caught	0

As far is I understand it, the problem is caused by
jumping out of a signal handler using setjmp/longjmp
instead of sigsetjmp/siglongjmp.

The following patch fixes the problem:

*** apache_19960527130015-orig/src/http_main.c  Wed May 22 21:00:14 1996
--- apache_19960527130015/src/http_main.c       Tue May 28 17:40:11 1996
***************
*** 821,827 ****
--- 835,845 ----
  static int wait_or_timeout_retval = -1;
  
  static void longjmp_out_of_alarm (int sig) {
+ #ifdef NEXT
      longjmp (wait_timeout_buf, 1);
+ #else
+     siglongjmp (wait_timeout_buf, 1);
+ #endif
  }
  
  int wait_or_timeout (int *status)
***************
*** 828,836 ****
  {
      wait_or_timeout_retval = -1;
      
      if (setjmp(wait_timeout_buf) != 0) {
        errno = ETIMEDOUT;
!       alarm(0);
        return wait_or_timeout_retval;
      }
      
--- 846,858 ----
  {
      wait_or_timeout_retval = -1;
      
+ #if defined(NEXT)
      if (setjmp(wait_timeout_buf) != 0) {
+ #else
+     if (sigsetjmp(wait_timeout_buf, 1) != 0) {
+ #endif
        errno = ETIMEDOUT;
!       /* alarm(0); */
        return wait_or_timeout_retval;
      }
      

--

Backtrace:
--

--


Mime
View raw message