From owner-freebsd-stable@FreeBSD.ORG Thu Nov 10 13:50:38 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FF8516A41F for ; Thu, 10 Nov 2005 13:50:38 +0000 (GMT) (envelope-from johan@stromnet.org) Received: from pne-smtpout1-sn2.hy.skanova.net (pne-smtpout1-sn2.hy.skanova.net [81.228.8.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA5A643D45 for ; Thu, 10 Nov 2005 13:50:37 +0000 (GMT) (envelope-from johan@stromnet.org) Received: from stromnet.org (81.231.107.13) by pne-smtpout1-sn2.hy.skanova.net (7.2.060.1) id 43721F89000473E7 for freebsd-stable@freebsd.org; Thu, 10 Nov 2005 14:50:37 +0100 Received: (qmail 11119 invoked from network); 10 Nov 2005 13:50:36 -0000 Received: from unknown (HELO ?10.10.0.6?) (10.10.0.6) by elfi.stromnet.org with SMTP; 10 Nov 2005 13:50:36 -0000 Mime-Version: 1.0 (Apple Message framework v746.2) In-Reply-To: References: <89E441A8-CC50-4F11-BE3E-AE6C384F5305@stromnet.org> <20051109232546.GP37350@green.homeunix.org> Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: =?ISO-8859-1?Q?Johan_Str=F6m?= Date: Thu, 10 Nov 2005 14:51:23 +0100 To: freebsd-stable@freebsd.org, users@httpd.apache.org, mod_python@modpython.org X-Mailer: Apple Mail (2.746.2) Cc: Subject: Re: Apache2, mod_python and nss_ldap: Coredump... X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2005 13:50:38 -0000 On 10 nov 2005, at 12.54, Johan Str=F6m wrote: > On 10 nov 2005, at 00.25, Brian Fundakowski Feldman wrote: > >> On Wed, Nov 09, 2005 at 10:20:26AM +0100, Johan Str=F6m wrote: >>> Hi >>> >>> I got a new 6.0-STABLE box. Rebuilt kernel and world 2 hours ago >>> (against RELENG_6), so it should be pretty new. >>> >>> Im trying to have apache 2.0.55, mod_python 3.1.4 and nss_ldap 239, >>> all the latest from ports. >>> The problem I have is this: If i have LoadModule python_module >>> libexec/apache2/mod_python.so in my httpd.conf, and at the same time >>> have either >>> "group: files ldap" and/or "passwd: files ldap" in my nsswitch.conf, >>> i get Segfaults. Example: >>> >>> root@elfi2:~$ apachectl configtest >>> Syntax OK >>> Segmentation fault (core dumped) >>> root@elfi2:~$ >>> >>> However, apache itself is running fine, even using mod_python. >>> If i remove either the LoadModule or both the ldap-entrys in >>> nsswitch, the segfaults dissappear. I've compiled httpd with debug >>> symbols, and this is what I found with gdb (httpd -t is same as >>> apachectl configtest): >>> [...] >>> (gdb) where >>> #0 0x00000000 in ?? () >>> #1 0x28be6744 in ?? () from /usr/local/lib/nss_ldap.so.1 >>> #2 0x28bf2200 in ?? () from /usr/local/lib/nss_ldap.so.1 >> >> Can you try making sure that nss_ldap gets built and linked with -g, >> and is not stripped, so that all symbols and debug info are preserved >> as well? Looks to be atexit(3)-related, from here, but the symbols >> should clear things up. > > Hi, thanks for the answer! > I *think* i got the nss_ldap.so to not be strip'd, at least I cant =20 > find any call in the port Makefile or the sources makefile/=20 > configure stuff that would strip it. Same result as before, no new =20 > symbols.. Strange? I'm compiling with -g and -O0.. > > However, I've noticed one thing, if I run gdb httpd and then run -=20 > t, I get this: > > root@elfi2:~$ gdb httpd > GNU gdb 6.1.1 [FreeBSD] > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, =20 > and you are > welcome to change it and/or distribute copies of it under certain =20 > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for =20 > details. > This GDB was configured as "i386-marcel-freebsd"... > (gdb) run -t > Starting program: /usr/local/sbin/httpd -t > warning: Unable to get location for thread creation breakpoint: =20 > generic error > [New LWP 100128] > [New Thread 0x80fa000 (LWP 100128)] > wWarning: DocumentRoot [/usr/local/nagios/share] does not exist > Syntax OK > [New LWP 100128] > > Program received signal SIGTRAP, Trace/breakpoint trap. > [Switching to LWP 100128] > 0x28bce277 in pthread_testcancel () from /usr/lib/libpthread.so.2 > (gdb) where > #0 0x28bce277 in pthread_testcancel () from /usr/lib/libpthread.so.2 > Error accessing memory address 0x28bcd7a8: Bad address. > (gdb) > > > Thats the pthread_cancel thing I was talking about before... > However, if I do run httpd -t and then check the dump with gdb =20 > httpd -c httpd.core, I get the same as first posted. > > Did the test over and over again, got the same pthread_cancel =20 > error, reading the same memory address, re-ran httpd -t a couple of =20= > times and seems I only get these pthread_cancel calls... > > Is there any way to check if a lib is strip'd/got debug symbols or =20 > not? > > Thanks > Johan Okay, some news here then.. Thanks to David Adam I used file to =20 determine if it was striped or not, seems it was.. So now I've fixed =20 it, not striped anymore (the install command striped it, i missed =20 that).. New debug output then: (gdb) where #0 0x00000000 in ?? () #1 0x28bd9730 in __do_global_dtors_aux () from /usr/local/lib/=20 nss_ldap.so.1 #2 0x28be2984 in _fini () from /usr/local/lib/nss_ldap.so.1 #3 0x280b5018 in tls_dtv_generation () from /libexec/ld-elf.so.1 #4 0x280b63d8 in ?? () from /libexec/ld-elf.so.1 #5 0xbfbfe628 in ?? () #6 0x2809d076 in elf_hash () from /libexec/ld-elf.so.1 #7 0x2809f958 in dlclose () from /libexec/ld-elf.so.1 #8 0x284b064c in _nsdbtaddsrc () from /lib/libc.so.6 #9 0x284b020f in endhostent () from /lib/libc.so.6 #10 0x284b06cc in _nsdbtaddsrc () from /lib/libc.so.6 #11 0x284cf35f in __cxa_finalize () from /lib/libc.so.6 #12 0x284cef9a in exit () from /lib/libc.so.6 #13 0x0806b746 in destroy_and_exit_process (process=3D0x80a4090, =20 process_exit_value=3D0) at main.c:216 #14 0x0806c0fe in main (argc=3D2, argv=3D0xbfbfe838) at main.c:565 (Also sent this to the other lists this thread is discussed in). Johan