Apache httpd with worker/event mpm segfaults after multiple successive graceful reloads triggered by logrotate

Solution Verified - Updated -

Issue

  • We have multiple files in /etc/logrotate.d that call service httpd reload or systemctl reload httpd, because we have multiple separate httpd log files. Every time logrotate is run and Apache httpd log files are rotated, the main (root) Apache httpd process crashes with a segfault and the service is left in a failed state. The Apache error log says the following:

    [Sun Aug 07 03:24:02.357442 2016] [mpm_event:notice] [pid 15813:tid 140606026332224] AH00493: SIGUSR1 received.  Doing graceful restart
    [Sun Aug 07 03:24:02.445959 2016] [core:notice] [pid 15813:tid 140606026332224] AH00060: seg fault or similar nasty error detected in the parent process
    
  • With Apache httpd configured for worker or event MPMs, any time multiple graceful reloads are attempted in quick succession, the main process segfaults. Reproducer for RHEL7 httpd:

    [root@a72 ~]# yum -y install httpd
    Installed:
      httpd.x86_64 0:2.4.6-40.el7_2.4
    Dependency Installed:
      apr.x86_64 0:1.4.8-3.el7
      apr-util.x86_64 0:1.5.2-6.el7
      httpd-tools.x86_64 0:2.4.6-40.el7_2.4
      mailcap.noarch 0:2.1.41-2.el7   
    [root@a72 ~]# sed -i -e '/^Load/s/^/#/' -e '/#Load.*event/s/^#//' /etc/httpd/conf.modules.d/00-mpm.conf
    [root@a72 ~]# systemctl start httpd
    [root@a72 ~]# while :; do ((n++)); systemctl reload httpd || break; done 2>/dev/null; echo reload failed after count=$n
    reload failed after count=16
    [root@a72 ~]# tail -2 /var/log/httpd/error_log
    [Thu Sep 15 11:59:37.467927 2016] [mpm_event:notice] [pid 1564:tid 140279584745536] AH00493: SIGUSR1 received.  Doing graceful restart
    [Thu Sep 15 11:59:37.505167 2016] [core:notice] [pid 1564] AH00060: seg fault or similar nasty error detected in the parent process
    

Environment

  • Red Hat Enterprise Linux 7
    • Any EL7 version of httpd configured with worker or event MPM; testing confirmed the following affected:
      • httpd-2.4.6-40.el7_2.4.x86_64
      • httpd24-2.4.6-62.ep7.el7.x86_64
      • httpd24-httpd-2.4.18-11.el7.x86_64
      • jbcs-httpd24-httpd-2.4.6-77.SP1.jbcs.el7.x86_64
      • jbcs-httpd24-httpd-2.4.29-17.jbcs.el7.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content