You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Manoj Kasichainula <ma...@io.com> on 1997/04/20 18:10:01 UTC

mod_proxy/429: Logrotate utility causing possible SIGSEGVs when using mod_proxy & caching

>Number:         429
>Category:       mod_proxy
>Synopsis:       Logrotate utility causing possible SIGSEGVs when using mod_proxy & caching
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Sun Apr 20 09:10:01 1997
>Originator:     manojk@io.com
>Organization:
apache
>Release:        1.2b8
>Environment:
Red Hat Linux 4.1
Kernel 2.0.27
libc 5.3.12
gcc 2.7.2.1
>Description:
When Apache is configured to serve as a caching proxy, and the logrotate
utility is used to rotate the Apache's logs, Apache will always crash, sometimes
report a segmentation fault, and sometimes will not restart until caching is
disabled.
>How-To-Repeat:
Get the Red Hat RPM package I built for Apache 1.2b8 (it should be at
ftp://ftp.redhat.com/pub/contrib/SRPMS/apache-1.2b8-1.src.rpm once it is moved
out of the Incoming directory. Or set up the following logrotate configuration
by placing it in the /etc/logrotate.d directory (any file name should do).
Delete /var/lib/logrotate.status (the file that stores info on the last time
logs were rotated) in order to force a log rotate. Make sure caching is enabled.
Then run:

/usr/sbin/logrotate /etc/logrotate.conf

Apache will die, maybe report a SIGSEGV, and maybe won't restart until caching
is disabled.

Here's the config file (taken straight from Red Hat's Apache 1.1.3 package)
/var/log/httpd/access_log {
    postrotate
        /usr/bin/killall -HUP httpd
    endscript
}

/var/log/httpd/agent_log {
    postrotate
        /usr/bin/killall -HUP httpd
    endscript
}

/var/log/httpd/error_log {
    postrotate
        /usr/bin/killall -HUP httpd
    endscript
}

/var/log/httpd/referer_log {
    postrotate
        /usr/bin/killall -HUP httpd
    endscript
}

>Fix:
My guess is that the repeated SIGHUPs in rapid succession are causing hangups
to be received in the code when they aren't handled yet. This code is probably
cache initialization code, and it may be in the middle of an operation on the
cache when it crashes, so the cache is corrupt and Apache gets very confused
>Audit-Trail:
>Unformatted:



Re: mod_proxy/429: Logrotate utility causing possible SIGSEGVs when using mod_proxy & caching

Posted by Chuck Murcko <ch...@topsail.org>.
Logrotate isn't distributed w/Apache AFAIK.

The rotatelogs program distributed with Apache works fine. It can also
be patched so isn't doesn't need to be used in a pipe, consuming extra
system resources. I can send you these patches, if you wish. Logs rotate
without the server shutting down.

Another alternative is to try chronolog, available from

  http://www.nhbs.co.uk/aford/resources/apache/cronolog/

Kill -HUP on Apache configured as a caching proxy doesn't cause any
problems that I can see.

Also, kill -HUP on every Apache child is liable to cause problems no
matter when you do it. Normal restart procedure is to use kill -HUP on
the parent process only. The PID of that process is available in
httpd.pid in the log directory.

Manoj Kasichainula wrote:
> 
> >Number:         429
> >Category:       mod_proxy
> >Synopsis:       Logrotate utility causing possible SIGSEGVs when using mod_proxy & caching
> >Confidential:   no
> >Severity:       serious
> >Priority:       medium
> >Responsible:    apache (Apache HTTP Project)
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   apache
> >Arrival-Date:   Sun Apr 20 09:10:01 1997
> >Originator:     manojk@io.com
> >Organization:
> apache
> >Release:        1.2b8
> >Environment:
> Red Hat Linux 4.1
> Kernel 2.0.27
> libc 5.3.12
> gcc 2.7.2.1
> >Description:
> When Apache is configured to serve as a caching proxy, and the logrotate
> utility is used to rotate the Apache's logs, Apache will always crash, sometimes
> report a segmentation fault, and sometimes will not restart until caching is
> disabled.
> >How-To-Repeat:
> Get the Red Hat RPM package I built for Apache 1.2b8 (it should be at
> ftp://ftp.redhat.com/pub/contrib/SRPMS/apache-1.2b8-1.src.rpm once it is moved
> out of the Incoming directory. Or set up the following logrotate configuration
> by placing it in the /etc/logrotate.d directory (any file name should do).
> Delete /var/lib/logrotate.status (the file that stores info on the last time
> logs were rotated) in order to force a log rotate. Make sure caching is enabled.
> Then run:
> 
> /usr/sbin/logrotate /etc/logrotate.conf
> 
> Apache will die, maybe report a SIGSEGV, and maybe won't restart until caching
> is disabled.
> 
> Here's the config file (taken straight from Red Hat's Apache 1.1.3 package)
> /var/log/httpd/access_log {
>     postrotate
>         /usr/bin/killall -HUP httpd
>     endscript
> }
> 
> /var/log/httpd/agent_log {
>     postrotate
>         /usr/bin/killall -HUP httpd
>     endscript
> }
> 
> /var/log/httpd/error_log {
>     postrotate
>         /usr/bin/killall -HUP httpd
>     endscript
> }
> 
> /var/log/httpd/referer_log {
>     postrotate
>         /usr/bin/killall -HUP httpd
>     endscript
> }
> 
> >Fix:
> My guess is that the repeated SIGHUPs in rapid succession are causing hangups
> to be received in the code when they aren't handled yet. This code is probably
> cache initialization code, and it may be in the middle of an operation on the
> cache when it crashes, so the cache is corrupt and Apache gets very confused
> >Audit-Trail:
> >Unformatted:

-- 
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
chuck@topsail.org