Apache2, mod_python and nss_ldap: Coredump...

Johan Ström johan at stromnet.org
Thu Nov 10 03:53:58 PST 2005


On 10 nov 2005, at 00.25, Brian Fundakowski Feldman wrote:

> On Wed, Nov 09, 2005 at 10:20:26AM +0100, Johan Ström 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 at elfi2:~$ apachectl configtest
>> Syntax OK
>> Segmentation fault (core dumped)
>> root at 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  
find any call in the port Makefile or the sources makefile/configure  
stuff that would strip it. Same result as before, no new symbols..  
Strange? I'm compiling with -g and -O0..

However, I've noticed one thing, if I run gdb httpd and then run -t,  
I get this:

root at 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, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
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:  
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 httpd - 
c httpd.core, I get the same as first posted.

Did the test over and over again, got the same pthread_cancel error,  
reading the same memory address, re-ran httpd -t a couple of 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 not?

Thanks
Johan



More information about the freebsd-stable mailing list