httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50861] New: Turning on and off BufferedLogs makes httpd segfault
Date Thu, 03 Mar 2011 13:43:02 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50861

           Summary: Turning on and off BufferedLogs makes httpd segfault
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: mod_log_config
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: torsten.foertsch@gmx.net


Created an attachment (id=26725)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26725)
The Cure

mod_log_config contains these lines

static const char *set_buffered_logs_on(cmd_parms *parms, void *dummy, int 
flag)
{
    buffered_logs = flag;
    if (buffered_logs) {
        ap_log_set_writer_init(ap_buffered_log_writer_init);
        ap_log_set_writer(ap_buffered_log_writer);
    }
    return NULL;
}

The buffered_logs global variable reflects the BufferedLogs directive.

Now, if my config file contains the 2 lines

  BufferedLogs On
  BufferedLogs Off

in that order the first directive turns buffered logs on and sets the writer 
functions. The 2nd directive turns the buffered_logs flag off but doesn't 
reset the writer functions. Hence, if your config contains those lines the 
httpd will segfault at startup.

Further, when mod_log_config is compiled as a shared module it is unloaded and 
the global variables buffered_logs, log_writer and log_writer_init are reset 
during a restart via SIG{HUP,USR1}. But if the module is compiled statically 
those global variables keep their values and a similar situation as described 
above can appear.

I have found that in 2.2.17. But I have verified it is also present in trunk.

The enclosed patch cures the problem.

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

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


Mime
View raw message