From nobody@hyperreal.com Wed Jan 8 12:47:58 1997 Received: by taz.hyperreal.com (8.8.3/V2.0) id MAA03466; Wed, 8 Jan 1997 12:47:58 -0800 (PST) Message-Id: <199701082047.MAA03466@taz.hyperreal.com> Date: Wed, 8 Jan 1997 12:47:58 -0800 (PST) From: Adrian Filipi-Martin Reply-To: adrian@virginia.edu To: apbugs@hyperreal.com Subject: starting/restarting httpd causes sigaction errors to be logged X-Send-Pr-Version: 3.2 >Number: 98 >Category: os-hpux >Synopsis: starting/restarting httpd causes sigaction errors to be logged >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Wed Jan 8 12:50:01 1997 >Last-Modified: Fri Jan 24 18:08:26 PST 1997 >Originator: adrian@virginia.edu >Organization: >Release: 1.2b4 >Environment: HP-UX 10.10 gcc version 2.7.2.1 Other than tweaking Configuration/Configuration.tmpl, no modifications were made to the sources. >Description: When starting httpd or restarting it with a SIGHUP, the following is logged to the error_log: [Wed Jan 8 14:21:03 1997] created shared memory segment #4206 [Wed Jan 8 14:21:03 1997] sigaction(SIGSEGV): Invalid argument [Wed Jan 8 14:21:03 1997] sigaction(SIGBUS): Invalid argument [Wed Jan 8 14:21:03 1997] Server configured -- resuming normal operations (Note that the shared memory segment message is only present when the daemon is send a SIGHUP signal to restart it.) These error messages do not appear to have any real effect upon the operation of the server. I expect they would not matter until it has either a bus or a segment fault. In any case, I looked at the source with gdb and the fact that a sigaction structure is not initialized completely in http_main.c seems to be the culprit. In any case a small patch is included below that does the required clearing of the sigaction structure and fixes the problem. >How-To-Repeat: Either start the server or restart it with a SIGHUP. Then hope that you do not get lucky and have the aforementioned sigaction structure placed in a block of zeroed out memory. >Fix: I suspect that invalid arguments are being passed to the sigaction() functions. Here is a patch to fix this: : adrian@huron; diff -c -C 5 http_main.c~ http_main.c *** http_main.c~ Mon Dec 30 21:29:00 1996 --- http_main.c Wed Jan 8 15:45:52 1997 *************** *** 1271,1280 **** --- 1271,1281 ---- void set_signals() { #ifndef NO_USE_SIGACTION struct sigaction sa; + memset(&sa,0,sizeof sa); if (!one_process) { sa.sa_handler = (void (*)())seg_fault; if (sigaction(SIGSEGV, &sa, NULL) < 0) log_unixerr("sigaction(SIGSEGV)", NULL, NULL, server_conf); %0 >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: marc State-Changed-When: Fri Jan 24 18:08:26 PST 1997 State-Changed-Why: Fix applied in version 1.110 of http_main.c, which will be available in 1.2b5 when released. >Unformatted: