Date: 21 Mar 2001 08:20:11 -0500 From: Jeff Trawick <trawickj@bellsouth.net> To: new-httpd@apache.org Cc: Hroi Sigurdsson <hroi@asdf.dk>, stable@FreeBSD.ORG Subject: Re: /usr/ports/apache13 & sig11 Message-ID: <m3wv9jcl84.fsf@adsl-77-241-65.rdu.bellsouth.net> In-Reply-To: <Pine.BSF.4.21.0103201701010.54557-100000@cosa.uk-legal.net> References: <Pine.BSF.4.21.0103201701010.54557-100000@cosa.uk-legal.net>
next in thread | previous in thread | raw e-mail | index | archive | help
There is a bug in Apache 1.3.19 which can cause a segfault when
servername isn't coded and the local host can't be looked up for some
reason. It is fixed in CVS, ready for 1.3.20.
I certainly hope that fix is all you need. The patch is shown later
on in the note.
Andrew Tulloch <andrew@cosa.uk-legal.net> writes:
> One ServerName directive later and it works :)
>
> Thanks!
>
> Andrew
>
> On Tue, 20 Mar 2001, Hroi Sigurdsson wrote:
>
> > CC'ed to new-httpd@apache.org. 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:
definitely Apache 1.3.19 :(
> > The line in question is
> > if (gethostname(str, sizeof(str) - 1) != 0) {
I hope not...
The known fix is
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/util.c,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -r1.194 -r1.195
--- apache-1.3/src/main/util.c 2001/02/01 10:06:37 1.194
+++ apache-1.3/src/main/util.c 2001/03/13 10:22:21 1.195
@@ -2040,7 +2040,6 @@
ap_log_error(APLOG_MARK, APLOG_WARNING, NULL,
"%s: gethostname() failed to determine ServerName\n",
ap_server_argv0);
- server_hostname = ap_pstrdup(a, "127.0.0.1");
}
else
{
@@ -2048,7 +2047,7 @@
if ((!(p = gethostbyname(str)))
|| (!(server_hostname = find_fqdn(a, p)))) {
/* Recovery - return the default servername by IP: */
- if (p->h_addr_list[0]) {
+ if (p && p->h_addr_list[0]) {
ap_snprintf(str, sizeof(str), "%pA", p->h_addr_list[0]);
server_hostname = ap_pstrdup(a, str);
/* We will drop through to report the IP-named server */
> > A work-around is setting the ServerName directive in httpd.conf so that
> > ap_get_local_host() doesn't get called.
yep
--
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m3wv9jcl84.fsf>
