Received: by taz.hyperreal.com (8.8.3/V2.0) id OAA09532; Tue, 3 Dec 1996 14:42:10 -0800 (PST) Received: from nora.pcug.co.uk by taz.hyperreal.com (8.8.3/V2.0) with SMTP id OAA09425; Tue, 3 Dec 1996 14:41:47 -0800 (PST) Received: from imdb.demon.co.uk by nora.pcug.co.uk id aa12173; 3 Dec 96 22:41 GMT Message-Id: <199612032209.WAA04441> Subject: Re: WWW Form Bug Report: "signal handlers use non-rentrant functions" on OTHER:NetBSD To: Liz Stokes Date: Tue, 3 Dec 1996 22:09:46 +0000 (GMT) In-Reply-To: <199612032013.PAA11645@panix4.panix.com> from "Liz Stokes" at Dec 3, 96 03:13:24 pm From: Rob Hartill Organization: Internet Movie Database X-pgp-public-key: http://us.imdb.com/pgp.html X-Mailer: ELM [version 2.4 PL24 ME8a] Content-Type: text Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com Thanks for the patch. I'll forward it to the developers list. cheers, rob Liz Stokes wrote: >> ilaine@panix.com wrote: >> > >> >Submitter: ilaine@panix.com >> >Operating system: OTHER:NetBSD, version: 1.2_BETA >> >Version of Apache Used: 1.1.1 >> >Extra Modules used: >> >URL exhibiting problem: >> > >> >Symptoms: >> >-- >> >sig_term, sig_bus, and sig_fault all call log_error, which calls many >> >non re-entrant functions. In the example which brought the problem to my >> >attention, httpd was in vfprintf when it received a SIGSEGV. It >> >called log_error which caused it to re-enter vfprintf with unhappy >> >results - it went into a tight loop inside vfprintf and chewed cycles >> >at a prodigious rate till exterminated. >> > >> >I have patched our version to use a simple write() inside the signal handlers >> >instead of log_error. It's not terribly elegant, and of course you lose the >> >timestamp, but I'd be happy to provide the diff if you wish. >> >> Thanks for the info. Apache 1.2b1 will be released in the next few hours. >> Many bugs have been fixed and problems resolved. Can you send us a patch >> for 1.2b1 if the problem persists. > >The bug is still there - the signal handlers are unchanged. Appended is a >diff for http_main.c > >-Liz > > >*** http_main.c Sun Dec 1 15:28:26 1996 >--- http_main.c.new Tue Dec 3 14:58:52 1996 >*************** >*** 1066,1072 **** > } > > void sig_term() { >! log_error("httpd: caught SIGTERM, shutting down", server_conf); > cleanup_scoreboard(); > #ifndef NO_KILLPG > killpg(pgrp,SIGKILL); >--- 1066,1073 ---- > } > > void sig_term() { >! write (fileno(server_conf->error_log), >! "httpd: caught SIGTERM, shutting down\n", 38); > cleanup_scoreboard(); > #ifndef NO_KILLPG > killpg(pgrp,SIGKILL); >*************** >*** 1079,1085 **** > } > > void bus_error() { >! log_error("httpd: caught SIGBUS, dumping core", server_conf); > chdir(server_root); > abort(); > exit(1); >--- 1080,1087 ---- > } > > void bus_error() { >! write (fileno(server_conf->error_log), >! "httpd: caught SIGBUS, dumping core\n", 36); > chdir(server_root); > abort(); > exit(1); >*************** >*** 1086,1092 **** > } > > void seg_fault() { >! log_error("httpd: caught SIGSEGV, dumping core", server_conf); > chdir(server_root); > abort(); > exit(1); >--- 1088,1095 ---- > } > > void seg_fault() { >! write (fileno(server_conf->error_log), >! "httpd: caught SIGSEGV, dumping core\n", 37); > chdir(server_root); > abort(); > exit(1); > >