osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug 61558] New: Apache 2.4.27 crashes often when restarting the service. segfault in libdl-2.24.so or apache2


https://bz.apache.org/bugzilla/show_bug.cgi?id=61558

            Bug ID: 61558
           Summary: Apache 2.4.27 crashes often when restarting the
                    service. segfault in libdl-2.24.so or apache2
           Product: Apache httpd-2
           Version: 2.4.27
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: All
          Assignee: bugs@xxxxxxxxxxxxxxxx
          Reporter: pantaluna@xxxxxxxxxxx
  Target Milestone: ---

Created attachment 35362
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35362&action=edit
apache2ctl-t-V-M.txt

Hi,
I have been struggling for quite some time now on a dedicated dev server with
Apache "sometimes" crashing
when the Apache service is started for the first time after a server boot, or
when the Apache service is restarted.

It became claear after a while that it crashes at least once out of +- 25 times
when I restart the Apache service (see below for the test script).

Apache recovers from it somehow. I "think" that an MPM worker child process
crashes, and that main Apache process then starts another one, which always
starts correctly.

Now is a good time to report it because I would like to upgrade some production
servers from Ubuntu 14.04.5 LTS trusty to Ubuntu Artful V17.10 in a few months
time.

* Environment:
- O.S.: Ubuntu 17.04 Zesty (Desktop edition)
- Ubuntu Package: apache2-bin:amd64/zesty
2.4.27-5.1+ubuntu17.04.1+deb.sury.org+1

* Notes:
- The Apache dbg packages have been installed. `apt --yes install apache2-dbg
libapr1-dbg libaprutil1-dbg gdb`
- This is a stable bare-metal server that is online 24x7 with no other
problems.
- I have removed the modules mod_security2 and mod_spamhaus, but it did not
help.
- No Apache sites are currently enabled, but it did not help.
- I tried to reproduce it in a VM with a fresh install of Ubuntu Zesty and
Apache 2.4.27 but then the crash never happens.

* Reproducible test script 
#Bash
#@doc The server will crash at least once every +-10 minutes when this script
is running.
while true
do
    systemctl stop apache2; systemctl start apache2; journalctl --lines=50
--unit=apache2; sleep 10;
done


* The crash details in the syslog varies as follows: "error 4 in apache2" or
"error 14 in libdl-2.24.so".
    Sep 22 11:44:04 s3black kernel: [36459.658587] apache2[12579]: segfault at
7f47d733a8c0 ip 0000559c2b73fdd4 sp 00007ffeaded5fd0 error 4 in
apache2[559c2b703000+9e000]
    Sep 22 11:44:04 s3black systemd[1]: apache2.service: Main process exited,
code=dumped, status=11/SEGV

    Sep 22 11:48:06 s3black kernel: [36701.689499] apache2[14568]: segfault at
7f06524308c0 ip 00005578dc332dd4 sp 00007ffdd48f9210 error 4 in
apache2[5578dc2f6000+9e000]
    Sep 22 11:48:06 s3black systemd[1]: apache2.service: Main process exited,
code=dumped, status=11/SEGV

    Sep 22 13:19:43 s3black kernel: [42198.677611] apache2[1417]: segfault at
7feb5dd26ad0 ip 00007feb5dd26ad0 sp 00007ffd97212488 error 14 in
libdl-2.24.so[7feb607b0000+3000]
    Sep 22 13:19:43 s3black systemd[1]: apache2.service: Main process exited,
code=dumped, status=11/SEGV

    Sep 22 13:41:57 s3black kernel: [43532.685282] apache2[12965]: segfault at
7f3079b9dad0 ip 00007f3079b9dad0 sp 00007ffe3b47be88 error 14 in
libdl-2.24.so[7f307c627000+3000]

    Sep 22 13:49:28 s3black kernel: [43983.678591] apache2[16930]: segfault at
7f0f0387d8c0 ip 000056527483fdd4 sp 00007ffd4282ba10 error 4 in
apache2[565274803000+9e000]

* Crash report script:
#Bash
cd /var/crash/
apport-retrace --rebuild-package-info --sandbox=system 
_usr_sbin_apache2.0.crash
rm --verbose -rf unpacked
apport-unpack _usr_sbin_apache2.0.crash unpacked
cd unpacked
# gdb: get info about the backtrace
echo "thread apply all bt full" | gdb /usr/sbin/apache2 CoreDump


* The top of the thread stacktrace
#0  0x00007feb5dd26ad0 in ?? ()
#1  0x00005596bd360e0e in ap_run_mpm_query (query_code=query_code@entry=2,
result=result@entry=0x7ffd972124ec, _rv=_rv@entry=0x7ffd972124c4) at
mpm_common.c:97
   92:                           (apr_pool_t * pchild, server_rec * s),
   93:                           (pchild, s), OK, DECLINED)
   94: AP_IMPLEMENT_HOOK_RUN_FIRST(int, mpm,
   95:                             (apr_pool_t *pconf, apr_pool_t *plog,
server_rec *s),
   96:                             (pconf, plog, s), DECLINED)
   97: AP_IMPLEMENT_HOOK_RUN_FIRST(int, mpm_query,
   98:                             (int query_code, int *result, apr_status_t
*_rv),
   99:                             (query_code, result, _rv), DECLINED)
  100: AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_timed_callback,
  101:                             (apr_time_t t, ap_mpm_callback_fn_t *cbfn,
void *baton),
  102:                             (t, cbfn, baton), APR_ENOTIMPL)
#2  0x00005596bd361b9e in ap_mpm_query (query_code=query_code@entry=2,
result=result@entry=0x7ffd972124ec) at mpm_common.c:419
  414: 
  415: AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
  416: {
  417:     apr_status_t rv;
  418: 
  419:     if (ap_run_mpm_query(query_code, result, &rv) == DECLINED) {
  420:         rv = APR_EGENERAL;
  421:     }
  422: 
  423:     return rv;
  424: }


* Attachments. I have collected as much info as possible.

Thanks for your help to find the cause of this crash. If you need more
information then do not hesitate to ask.
--
Rolf.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: bugs-help@xxxxxxxxxxxxxxxx