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 2011/03/03 14:43:02 UTC

DO NOT REPLY [Bug 50861] New: Turning on and off BufferedLogs makes httpd segfault

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


DO NOT REPLY [Bug 50861] Turning on and off BufferedLogs makes httpd segfault

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50861

Jim Jagielski <ji...@apache.org> changed:

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

--- Comment #1 from Jim Jagielski <ji...@apache.org> 2011-03-17 11:04:33 EDT ---
Closed in trunk - r1082518

-- 
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