One ServerName directive later and it works :)
Thanks!
Andrew
On Tue, 20 Mar 2001, Hroi Sigurdsson wrote:
> CC'ed to [EMAIL PROTECTED] More below.
>
> On Tue, Mar 20, 2001 at 03:53:08PM +0000, Andrew Tulloch wrote:
>
> > I built apache from the ports updated this morning using cvsup and for
> > some reason everytime I run `apachectl start` httpd Sig 11 core dumps. The
> > machine itself seems to be fine apart from this having postfix/cyrus-imapd
> > running fine for a few days since I built the machine. Its also hosted a
> > couple of buildworlds so I don't think the ram is at fault, although I
> > also tried swapping it out to be sure.
> >
> > a quick gdb /usr/local/sbin/httpd httpd.core and bt gave
> > (gdb) bt
> > #0 0x8064287 in ap_get_local_host ()
> > #1 0x80616c0 in ap_fini_vhost_config ()
> > #2 0x80539a3 in ap_read_config ()
> > #3 0x805b408 in main ()
> > #4 0x804ea11 in _start ()
> >
> > and seems to be the same for every dump.
> > dmesg below..
> >
> > Any help would be greatly appreciated! :)
>
> This is most likely not a bug in FreeBSD. I've seen the exact same thing on
> Linux, Apache 1.3.19:
>
> This GDB was configured as "i686-pc-linux-gnu"...
> (gdb) run -X
> Starting program: /usr/pkg/apache/bin/httpd -X
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x808d263 in ap_get_local_host (a=0x80de99c) at util.c:2051
> 2051 util.c: No such file or directory.
> (gdb) where
> #0 0x808d263 in ap_get_local_host (a=0x80de99c) at util.c:2051
> #1 0x808920d in ap_fini_vhost_config (p=0x80de99c, main_s=0x80de9c4)
> at http_vhost.c:548
> #2 0x8075dd9 in ap_read_config (p=0x80de99c, ptemp=0x80e29bc,
> confname=0x80cf5c0 "conf/httpd.conf") at http_config.c:1595
> #3 0x80804ec in main (argc=2, argv=0xbffffdb4) at http_main.c:4986
> (gdb) print str
> $1 =
>"slave0-1\000-\001@ìøÿ¿H*\001@\000\000\000@Ìøÿ¿Èøÿ¿à-\001@Äøÿ¿\002\000\000\000à-\001@H*\001@È0\001@(\b\000@\016\024\000"
> (gdb) print sizeof(str)
> $2 = 64
> (gdb) disassemble
> Dump of assembler code for function ap_get_local_host:
> 0x808d1b4 <ap_get_local_host>: push %ebp
> 0x808d1b5 <ap_get_local_host+1>: mov %esp,%ebp
> 0x808d1b7 <ap_get_local_host+3>: sub $0x58,%esp
> 0x808d1ba <ap_get_local_host+6>: movl $0x0,0xffffffbc(%ebp)
> 0x808d1c1 <ap_get_local_host+13>: add $0xfffffff8,%esp
> 0x808d1c4 <ap_get_local_host+16>: push $0x3f
> 0x808d1c6 <ap_get_local_host+18>: lea 0xffffffc0(%ebp),%eax
> 0x808d1c9 <ap_get_local_host+21>: push %eax
> 0x808d1ca <ap_get_local_host+22>: call 0x804f678 <gethostname>
> 0x808d1cf <ap_get_local_host+27>: add $0x10,%esp
> 0x808d1d2 <ap_get_local_host+30>: mov %eax,%eax
> 0x808d1d4 <ap_get_local_host+32>: test %eax,%eax
> 0x808d1d6 <ap_get_local_host+34>:
> je 0x808d220 <ap_get_local_host+108>
> 0x808d1d8 <ap_get_local_host+36>: add $0xfffffff8,%esp
> 0x808d1db <ap_get_local_host+39>: mov 0x80cd590,%eax
> 0x808d1e0 <ap_get_local_host+44>: push %eax
> 0x808d1e1 <ap_get_local_host+45>: push $0x80c59a0
> 0x808d1e6 <ap_get_local_host+50>: push $0x0
> 0x808d1e8 <ap_get_local_host+52>: push $0x4
> 0x808d1ea <ap_get_local_host+54>: push $0x7f8
> 0x808d1ef <ap_get_local_host+59>: push $0x80c54fa
> 0x808d1f4 <ap_get_local_host+64>: call 0x807b940 <ap_log_error>
> [snip]
>
> The line in question is
> if (gethostname(str, sizeof(str) - 1) != 0) {
>
> At first I thought it was a bug in glibc/linux.
>
> A work-around is setting the ServerName directive in httpd.conf so that
> ap_get_local_host() doesn't get called.
>
> --
> Hroi Sigurdsson [EMAIL PROTECTED]
> Netgroup A/S http://www.netgroup.dk
>
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message