Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jun 2008 22:59:19 -0700
From:      Jeremy Chadwick <koitsu@FreeBSD.org>
To:        Daniel O'Connor <doconnor@gsoft.com.au>
Cc:        freebsd-stable@freebsd.org, freebsd-apache@freebsd.org, Jim Pingle <lists@pingle.org>
Subject:   Re: apachectl gracefult causes Signal 11 crash after 6.3 to 7.0 upgrade [SOLVED]
Message-ID:  <20080612055919.GA27267@eos.sc1.parodius.com>
In-Reply-To: <200806121445.30864.doconnor@gsoft.com.au>
References:  <4846B64F.4090700@minibofh.org> <200806121118.45137.doconnor@gsoft.com.au> <48509419.6060206@pingle.org> <200806121445.30864.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 12, 2008 at 02:45:21PM +0930, Daniel O'Connor wrote:
> On Thu, 12 Jun 2008, Jim Pingle wrote:
> > I need to see if I can improve the script any (suggestions are most
> > welcome) then open a PR to see if it -- or logic like it -- can be
> > included in the php-extensions meta port.
> 
> Adding the script to the port seems like the way to go (baring an 
> upstream fix but it seems like a difficult problem to solve).
> 
> Unfortunately it doesn't help me :(
> If I disable everything except either pgsql or mhash (either separately 
> or together) Apache crashes with..
> 
> #0  0x28ad6d40 in ?? ()
> #1  0x281c6f2e in _pthread_main_np () from /lib/libc.so.7
> #2  0x2819fa0c in puts () from /lib/libc.so.7
> #3  0x281a0177 in gethostbyname () from /lib/libc.so.7
> #4  0x08069a12 in ap_get_local_host ()
> #5  0x08068b9c in ap_fini_vhost_config ()
> #6  0x0805639c in ap_read_config ()
> #7  0x0805f133 in standalone_main ()
> #8  0x08060c1f in main ()
> 
> I don't understand why gethostbyname() would call puts() - and why that 
> would then crash!

I can't explain why it's calling puts() directly either.  Bad RAM could
cause something bizarre like this, or a corrupt/broken binary.

The libc code I'm looking at (src/lib/libc/net/gethostnameadr.c and
gethostbydns.c) don't call puts) don't appear to call puts() directly.
Of course, there may be macros used which do this.

There are some places in the resolver code where printing to stdout or
stderr can occur.  I'd expect to see a longer stack trace (meaning more
functions between gethostbyname() and puts()) if that were the case,
though.

There's a decent document on how to debug httpd below.  You'll need to
start httpd with -X or with "MaxClients 1", to keep it from forking.
You can do that through gdb if you want, or (what I prefer, since I'm
not very good with gdb) use truss.

http://httpd.apache.org/dev/debugging.html

If you go the truss route, be sure to use -a -s 4096.  You'd be able to
see what actual string is being output via puts(), assuming it gets as
far as to start writing data to the fd.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080612055919.GA27267>