Bug 38240 - apache restart segfault with mutliple Include directives
Summary: apache restart segfault with mutliple Include directives
Status: RESOLVED LATER
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Runtime Config (show other bugs)
Version: 2.0.55
Hardware: PC FreeBSD
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: MassUpdate
Depends on:
Blocks:
 
Reported: 2006-01-12 16:48 UTC by Glenn Nielsen
Modified: 2018-11-07 21:08 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Glenn Nielsen 2006-01-12 16:48:50 UTC
Multiple Include directives in httpd.conf can cause a segfault on 
subsequent apachectl graceful or restart. Usually happens during 
the second or third graceful.

Here is a snippet from my config:

Include /export/kinetic/conf/apache/204.185.42.123/*.conf
Include /export/kinetic/conf/apache/204.185.42.129/*.conf
Include /export/kinetic/conf/apache/204.185.42.200/*.conf
Include etc/apache2/Includes/*.conf
Comment 1 Joshua Slive 2006-01-12 18:04:17 UTC
Could you please supply a backtrace as discussed here:
http://httpd.apache.org/dev/debugging.html#crashes
Comment 2 Glenn Nielsen 2006-01-12 20:32:38 UTC
I had to reinstall apache WITH_DEBUG. I then reproduced the bug and
generated a core file. Here is the backtrace:

#0  0x284da9fd in ?? () from /usr/lib/libpthread.so.1
#1  0x0000000a in ?? ()
#2  0x081416d0 in ?? ()
#3  0x00001000 in ?? ()
#4  0x28335240 in apr_file_read (thefile=0xbfbfe730, buf=0x2000000,
nbytes=0x8142c28)
    at readwrite.c:32
#5  0x08069182 in ap_process_resource_config (s=0x80a8df8, 
    fname=0x8142bb0 "/export/kinetic/conf/apache/204.185.42.123/*.conf", 
    conftree=0xbfbfe7d4, p=0x80a7018, ptemp=0x8122018) at config.c:1598
#6  0x0807cb9f in include_config (cmd=0xbfbfea30, dummy=0xbfbfe8a8, 
    name=0x8142b78 "/export/kinetic/conf/apache/204.185.42.123/*.conf") at
core.c:2392
#7  0x0806766a in invoke_cmd (cmd=0x80958c0, parms=0xbfbfea30, mconfig=0xbfbfe8a8, 
    args=0x80d8051 "") at config.c:692
#8  0x08068a57 in execute_now (cmd_line=0x8142b10 "Include", 
    args=0x80d8020 "/export/kinetic/conf/apache/204.185.42.123/*.conf", 
    parms=0xbfbfea30, p=0x80a7018, ptemp=0x8122018, sub_tree=0xbfbfe8a8, parent=0x0)
    at config.c:1335
#9  0x08068085 in ap_build_config_sub (p=0x80a7018, temp_pool=0x8122018, 
    l=0x80d8018 "Include /export/kinetic/conf/apache/204.185.42.123/*.conf", 
    parms=0xbfbfea30, current=0xbfbfe904, curr_parent=0xbfbfe900,
conftree=0x809bed4)
    at config.c:914
#10 0x08068599 in ap_build_config (parms=0xbfbfea30, p=0x80a7018,
temp_pool=0x8122018, 
    conftree=0x809bed4) at config.c:1127
#11 0x08068eb8 in process_resource_config_nofnmatch (s=0x80a8df8, 
    fname=0x81117a0 "/usr/local/etc/apache2/httpd.conf", conftree=0x809bed4, 
    p=0x80a7018, ptemp=0x8122018, depth=0) at config.c:1513
#12 0x08068fc3 in ap_process_resource_config (s=0x80a8df8, 
    fname=0x81117a0 "/usr/local/etc/apache2/httpd.conf", conftree=0x809bed4, 
    p=0x80a7018, ptemp=0x8122018) at config.c:1549
#13 0x08069a8f in ap_read_config (process=0x80a5090, ptemp=0x8122018, 
    filename=0x8091918 "etc/apache2/httpd.conf", conftree=0x809bed4) at
config.c:1892
#14 0x0806c2c1 in main (argc=2, argv=0xbfbfecdc) at main.c:609
Comment 3 Ruediger Pluem 2006-01-12 22:43:49 UTC
(In reply to comment #2)
> I had to reinstall apache WITH_DEBUG. I then reproduced the bug and
> generated a core file. Here is the backtrace:
> 
> #0  0x284da9fd in ?? () from /usr/lib/libpthread.so.1
> #1  0x0000000a in ?? ()
> #2  0x081416d0 in ?? ()
> #3  0x00001000 in ?? ()
> #4  0x28335240 in apr_file_read (thefile=0xbfbfe730, buf=0x2000000,
> nbytes=0x8142c28)
>     at readwrite.c:32

The addresses in #3 and #1 look really bad. Furthermore line 32 of readwrite.c
is the beginning of the function apr_file_read. There is no real code apart from
"{" there.
Which version of FreeBSD are you using?
I saw discussions on the dev list about problems with FreeBSD and threads.
As I have no experience with FreeBSD, some FreeBSD expert here to the rescue please.
Comment 4 Paul Querna 2006-01-12 23:05:00 UTC
Is /export a NFS mount?
Comment 5 Glenn Nielsen 2006-01-12 23:27:31 UTC
FreeBSD 5.3-RELEASE-p20, prefork MPM.

/export is local but shared via NFS.

# httpd -V
Server version: Apache/2.0.55
Server built:   Jan 12 2006 13:17:46
Server's Module Magic Number: 20020903:11
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local"
 -D SUEXEC_BIN="/usr/local/bin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="/var/run/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
 -D AP_TYPES_CONFIG_FILE="etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="etc/apache2/httpd.conf"
Comment 6 Joshua Slive 2007-09-13 13:32:25 UTC
Is this still an issue in recent versions?
Comment 7 Philp M. Gollucci 2009-01-18 16:19:13 UTC
CC myself on FreeBSD related bugs
Comment 8 William A. Rowe Jr. 2018-11-07 21:08:49 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.