From owner-freebsd-apache@FreeBSD.ORG Thu Jun 12 05:59:19 2008 Return-Path: Delivered-To: freebsd-apache@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FDB11065671; Thu, 12 Jun 2008 05:59:19 +0000 (UTC) (envelope-from jdc@parodius.com) Received: from mx01.sc1.parodius.com (mx01.sc1.parodius.com [72.20.106.3]) by mx1.freebsd.org (Postfix) with ESMTP id 750198FC16; Thu, 12 Jun 2008 05:59:19 +0000 (UTC) (envelope-from jdc@parodius.com) Received: by mx01.sc1.parodius.com (Postfix, from userid 1000) id 0BE3F1CC068; Wed, 11 Jun 2008 22:59:19 -0700 (PDT) Date: Wed, 11 Jun 2008 22:59:19 -0700 From: Jeremy Chadwick To: Daniel O'Connor Message-ID: <20080612055919.GA27267@eos.sc1.parodius.com> References: <4846B64F.4090700@minibofh.org> <200806121118.45137.doconnor@gsoft.com.au> <48509419.6060206@pingle.org> <200806121445.30864.doconnor@gsoft.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200806121445.30864.doconnor@gsoft.com.au> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-stable@freebsd.org, freebsd-apache@freebsd.org, Jim Pingle Subject: Re: apachectl gracefult causes Signal 11 crash after 6.3 to 7.0 upgrade [SOLVED] X-BeenThere: freebsd-apache@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Support of apache-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2008 05:59:19 -0000 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 |