httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36234] New: - certain VirtualHost directives in httpd.conf cause httpd -S to core in dump_a_vhost
Date Thu, 18 Aug 2005 03:05:00 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36234>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36234

           Summary: certain VirtualHost directives in httpd.conf cause httpd
                    -S to core in dump_a_vhost
           Product: Apache httpd-2.0
           Version: 2.0.54
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_vhost_alias
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: jtingiris@bellsouth.net


The following configuration causes a seg fault on Solaris 10 (sparc):

--cut--
NameVirtualHost *:80

<VirtualHost *>
ServerName adminconsole.test.com
DocumentRoot /opt/apache2/htdocs
ErrorLog logs/adminconsole.test.com-error_log
CustomLog logs/adminconsole.test.com-access_log common
</VirtualHost>

<VirtualHost *>
ServerName control.test.com
DocumentRoot /opt/apache2/htdocs
ErrorLog logs/control.test.com-error_log
CustomLog logs/control.test.com-access_log common
</VirtualHost>
--cut--

Some playing with the above configuration proves that it is only the last
<VirtualHost *> entry that causes the core.  If <VirtualHost *:80>, or
<VirutalHost hostname> is used for the last entry everything works as expected
if using <VirtualHost *> in prior declarations.

Here is a truss and map of the core:

--cut--
[root@core {SunOS 5.10} - (via 192.168.52.88)]
[507] /opt/apache2/conf 7 truss /opt/apache2/bin/httpd -S
--snip--
stat("/opt/apache2/htdocs", 0xFFBFF378)         = 0
VirtualHost configuration:
write(2, " V i r t u a l H o s t  ".., 27)      = 27
wildcard NameVirtualHosts and _default_ servers:
write(2, " w i l d c a r d   N a m".., 49)      = 49
*:*                    adminconsole.test.com (/opt/apache2/conf/httpd.conf:252)
write(2, " * : *                  ".., 80)      = 80
*:*                    control.test.com (/opt/apache2/conf/httpd.conf:259)
write(2, " * : *                  ".., 75)      = 75
    Incurred fault #6, FLTBOUNDS  %pc = 0x000364C4
      siginfo: SIGSEGV SEGV_MAPERR addr=0x0000000C
    Received signal #11, SIGSEGV [default]
      siginfo: SIGSEGV SEGV_MAPERR addr=0x0000000C
--cut--

--cut--
[root@core {SunOS 5.10} - (via localhost)]
[547] /opt/apache2/conf 47 pmap core
core 'core' of 9410:    /opt/apache2/bin/httpd -S
00010000     328K r-x--  /opt/apache2/bin/httpd
00070000      24K rwx--  /opt/apache2/bin/httpd
00076000     952K rwx--    [ heap ]
FEA20000      56K r-x--  /opt/apache2/modules/mod_rewrite.so
FEA3C000      16K rwx--  /opt/apache2/modules/mod_rewrite.so
FEA50000       8K r-x--  /opt/apache2/modules/mod_alias.so
FEA60000      16K rwx--  /opt/apache2/modules/mod_alias.so
FEA70000       8K rwx--
FEA80000       8K r-x--  /opt/apache2/modules/mod_dir.so
FEA90000       8K rwx--  /opt/apache2/modules/mod_dir.so
FEAA0000      32K r-x--  /opt/apache2/modules/mod_negotiation.so
FEAB6000       8K rwx--  /opt/apache2/modules/mod_negotiation.so
FEAC0000       8K r-x--  /opt/apache2/modules/mod_vhost_alias.so
FEAD0000       8K rwx--  /opt/apache2/modules/mod_vhost_alias.so
FEAE0000      32K r-x--  /opt/apache2/modules/mod_cgid.so
FEAF6000       8K rwx--  /opt/apache2/modules/mod_cgid.so
FEB00000      16K r-x--  /opt/apache2/modules/mod_info.so
FEB12000       8K rwx--  /opt/apache2/modules/mod_info.so
FEB20000       8K rwx--
FEB30000       8K r-x--  /opt/apache2/modules/mod_asis.so
FEB40000       8K rwx--  /opt/apache2/modules/mod_asis.so
FEB50000      40K r-x--  /opt/apache2/modules/mod_autoindex.so
FEB68000       8K rwx--  /opt/apache2/modules/mod_autoindex.so
FEB70000      16K r-x--  /opt/apache2/modules/mod_mime.so
FEB82000       8K rwx--  /opt/apache2/modules/mod_mime.so
FEB90000       8K r-x--  /opt/apache2/modules/mod_setenvif.so
FEBA0000       8K rwx--  /opt/apache2/modules/mod_setenvif.so
FEBB0000       8K r-x--  /opt/apache2/modules/mod_unique_id.so
FEBC0000       8K rwx--  /opt/apache2/modules/mod_unique_id.so
FEBD0000       8K r-x--  /opt/apache2/modules/mod_expires.so
FEBE0000       8K rwx--  /opt/apache2/modules/mod_expires.so
FEBF0000       8K rwx--
FEC00000      24K r-x--  /opt/apache2/modules/mod_mime_magic.so
FEC14000      16K rwx--  /opt/apache2/modules/mod_mime_magic.so
FEC20000       8K r-x--  /opt/apache2/modules/mod_env.so
FEC30000       8K rwx--  /opt/apache2/modules/mod_env.so
FEC40000      24K r-x--  /opt/apache2/modules/mod_log_config.so
FEC54000       8K rwx--  /opt/apache2/modules/mod_log_config.so
FEC60000      40K r-x--  /opt/apache2/modules/mod_include.so
FEC78000       8K rwx--  /opt/apache2/modules/mod_include.so
FEC80000       8K r-x--  /opt/apache2/modules/mod_auth.so
FEC90000       8K rwx--  /opt/apache2/modules/mod_auth.so
FECA0000       8K rwx--
FECB0000       8K r-x--  /opt/apache2/modules/mod_access.so
FECC0000       8K rwx--  /opt/apache2/modules/mod_access.so
FECE0000       8K r-x--  /platform/sun4u-us3/lib/libc_psr.so.1
FECF0000      24K rwx--
FED00000     848K r-x--  /lib/libc.so.1
FEDE4000      32K rwx--  /lib/libc.so.1
FEDEC000       8K rwx--  /lib/libc.so.1
FEE00000       8K r-x--  /lib/libmd5.so.1
FEE12000       8K rwx--  /lib/libmd5.so.1
FEE20000     240K r-x--  /lib/libresolv.so.2
FEE6C000      16K rwx--  /lib/libresolv.so.2
FEE80000     584K r-x--  /lib/libnsl.so.1
FEF22000      40K rwx--  /lib/libnsl.so.1
FEF2C000      24K rwx--  /lib/libnsl.so.1
FEF40000      32K r-x--  /lib/libaio.so.1
FEF58000       8K rwx--  /lib/libaio.so.1
FEF60000      40K r-x--  /usr/sfw/lib/libgcc_s.so.1
FEF78000       8K rwx--  /usr/sfw/lib/libgcc_s.so.1
FEF80000     680K r-x--  /lib/libm.so.2
FF038000      32K rwx--  /lib/libm.so.2
FF050000       8K rwx--
FF060000      48K r-x--  /lib/libsocket.so.1
FF07C000       8K rwx--  /lib/libsocket.so.1
FF090000       8K rwx--
FF0A0000      24K r-x--  /lib/librt.so.1
FF0B6000       8K rwx--  /lib/librt.so.1
FF0C0000       8K r-x--  /lib/libsendfile.so.1
FF0D2000       8K rwx--  /lib/libsendfile.so.1
FF0E0000      16K r-x--  /usr/lib/libmtmalloc.so.1
FF0F4000       8K rwx--  /usr/lib/libmtmalloc.so.1
FF100000     120K r-x--  /opt/apache2/lib/libapr-0.so.0.9.6
FF12C000      16K rwx--  /opt/apache2/lib/libapr-0.so.0.9.6
FF140000     168K r-x--  /opt/apache2/lib/libexpat.so.0.1.0
FF178000       8K rwx--  /opt/apache2/lib/libexpat.so.0.1.0
FF180000    1240K r-x--  /opt/apache2/lib/libcrypto.so.0.9.8
FF2C4000      88K rwx--  /opt/apache2/lib/libcrypto.so.0.9.8
FF2DA000       8K rwx--  /opt/apache2/lib/libcrypto.so.0.9.8
FF2F0000      80K r-x--  /opt/apache2/lib/libaprutil-0.so.0.9.6
FF312000      16K rwx--  /opt/apache2/lib/libaprutil-0.so.0.9.6
FF328000      16K r-x--  /lib/libpthread.so.1
FF330000       8K rwx--
FF340000     232K r-x--  /opt/apache2/lib/libssl.so.0.9.8
FF388000      24K rwx--  /opt/apache2/lib/libssl.so.0.9.8
FF3A0000       8K r-x--  /lib/libdl.so.1
FF3B0000     176K r-x--  /lib/ld.so.1
FF3EC000       8K rwx--  /lib/ld.so.1
FF3EE000       8K rwx--  /lib/ld.so.1
FFBFC000      16K rw---    [ stack ]
 total      6896K
--cut--

Stack dump shows a problem in dump_a_vhost:

--cut--
[root@core {SunOS 5.10} - (via localhost)]
[548] /opt/apache2/conf 48 pstack core
core 'core' of 9410:    /opt/apache2/bin/httpd -S
 000364c4 dump_a_vhost (158c30, ffffe000, 400, 0, 5c800, 15c070) + 8c
 00036d88 ap_fini_vhost_config (74c00, 5c400, a4078, 80, 74c00, 75000) + 7a4
 00035ac4 main     (a20f0, a4078, ffbff8e0, 75e14, 1117e, 0) + 2d0
 00025d94 _start   (0, 0, 0, 0, 0, 0) + 5c
--cut--

I'm using the latest vhost.c from HEAD.  More analysis shows that if ic=0,
dump_a_vhost still has a problem at line 419 of vhost.c, here:

--cut--
if (ic->sar->host_port == 0) {
        buf[len-1] = '*';
    }
--cut--

The following diff prevents the core, but I'm not sure it's correct overall:

--cut--
diff
diff vhost.c vhost.c.2.0.54.orig
1c1,2
< /* Copyright 1999-2004 The Apache Software Foundation
---
> /* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
>  * applicable.
184,187c185
<         if (rv) {
<             return "Cannot not resolve address '0.0.0.0' -- "
<                 "check resolver configuration.";
<         }
---
>         ap_assert(rv == APR_SUCCESS); /* must be bug or out of storage */
192,195c190
<         if (rv) {
<             return "Cannot resolve address '255.255.255.255' -- "
<                 "check resolver configuration.";
<         }
---
>         ap_assert(rv == APR_SUCCESS); /* must be bug or out of storage */
405d399
<        printf("ic %i\n", ic);
464,467c458
<                               // Solaris core is here ... ERROR
<                               // printf("ic %i\n", ic->next);
<                               // only dump_a_vhost if ic->next is valid -jjt
<                               if (ic->next != 0) dump_a_vhost(f, ic);
---
>             dump_a_vhost(f, ic);
--cut--

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message