[mod_python] Apache2, mod_python and nss_ldap: Coredump

Johan Ström johan at stromnet.org
Wed Nov 9 07:46:37 EST 2005


Hi

I got a new FreeBSD 6 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):

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 100104]
[New Thread 0x80ab000 (LWP 100104)]
Warning: DocumentRoot [/usr/local/nagios/share] does not exist
Syntax OK

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x80ab000 (LWP 100104)]
0x00000000 in ?? ()
(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
#3  0x280ba3d8 in ?? () from /libexec/ld-elf.so.1
#4  0xbfbfe618 in ?? ()
#5  0x280a0b26 in _rtld_error () from /libexec/ld-elf.so.1
#6  0x28bef998 in _fini () from /usr/local/lib/nss_ldap.so.1
#7  0x280b9018 in tls_dtv_generation () from /libexec/ld-elf.so.1
#8  0x280ba3d8 in ?? () from /libexec/ld-elf.so.1
#9  0xbfbfe628 in ?? ()
#10 0x280a1076 in elf_hash () from /libexec/ld-elf.so.1
#11 0x280a3958 in dlclose () from /libexec/ld-elf.so.1
#12 0x284de64c in _nsdbtaddsrc () from /lib/libc.so.6
#13 0x284de20f in endhostent () from /lib/libc.so.6
#14 0x284de6cc in _nsdbtaddsrc () from /lib/libc.so.6
#15 0x284fd35f in __cxa_finalize () from /lib/libc.so.6
#16 0x284fcf9a in exit () from /lib/libc.so.6
#17 0x0806f0ee in destroy_and_exit_process (process=0x80b6098,  
process_exit_value=0) at main.c:216
#18 0x0806faa6 in main (argc=2, argv=0xbfbfe838) at main.c:565
(gdb)

So, seems the segfault appears when apache calls exit(), explains why  
it seems to work good otherwise...
Googling gave me some similar problem (bug 65220), however that bug  
seemd to affect other programs, so far I've only encountered this  
problem with apache.
Currently I've compiled apache with the following:

portinstall apache-2.0.55 -M "WITH_DBM=bdb WITH_BERKELEYDB=db4  
WITH_LDAP=1 WITH_MPM=prefork WITH_THREADS=yes  
WITH_THREADS_MODULES=yes WITH_DEBUG=1"

The threads stuff was added after some suspect gdb'ing around a  
pthread function (can't remember exact name now.. something  
pthread_cancel.. the symptoms where the same, segfault just before  
exit).
mod_python is installed without any special options, there isnt realy  
any (ie no option to turn of threads).

I've also tried compiling python without threads, then apache without  
threads, then modpython.. same problem.

Does anyone have any clue about whats going on here?
Don't realy know where the problem lies, so I've sent this here , to  
apache-user and to freebsd-stable (http://lists.freebsd.org/pipermail/ 
freebsd-stable/2005-November/019476.html).

Thanks!
Johan


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server  
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe at httpd.apache.org
   "   from the digest: users-digest-unsubscribe at httpd.apache.org
For additional commands, e-mail: users-help at httpd.apache.org



More information about the Mod_python mailing list