Re: Apache2, mod_python and nss_ldap: Coredump...

2005-11-10 Thread Johan Ström

On 10 nov 2005, at 12.54, Johan Ström wrote:


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:

[EMAIL PROTECTED]:~$ apachectl configtest
Syntax OK
Segmentation fault (core dumped)
[EMAIL PROTECTED]:~$

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  0x 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:


[EMAIL PROTECTED]:~$ 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


Okay, some news here then.. Thanks to David Adam I used file to  
determine if it was striped or not, seems it was.. So now I've fixed  
it, not striped anymore (the install command striped it, i missed  
that)..

New debug output then:

(gdb) where
#0  0x in ?? ()
#1  0x28bd9730 in __do_global_dtors_aux () from /usr/local/lib/ 
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=0x80a4090,  
process_exit_value=0) at main.c:216

#14 0x0806c0fe in main (argc=2, argv=0xbfbfe838) at main.c:565


(Also sent this to the other lists this thread is discussed in).

Johan

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Apache2, mod_python and nss_ldap: Coredump...

2005-11-10 Thread David Adam
I can't help with most of your problem, but...

On Thu, 10 Nov 2005, Johan Ström wrote:
> Is there any way to check if a lib is strip'd/got debug symbols or not?

file(1) will tell you.

/usr/obj/usr/src/lib/libmagic/compress.o: ELF 32-bit LSB relocatable,
Intel 80386, version 1 (FreeBSD), not stripped

strip(1) the file, and it becomes...

/usr/obj/usr/src/lib/libmagic/compress.o: ELF 32-bit LSB relocatable,
Intel 80386, version 1 (FreeBSD), stripped

David Adam
[EMAIL PROTECTED]

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Apache2, mod_python and nss_ldap: Coredump

2005-11-10 Thread Johan Ström

On 10 nov 2005, at 13.55, Stephane Bortzmeyer wrote:


On Wed, Nov 09, 2005 at 01:46:37PM +0100,
 Johan Ström <[EMAIL PROTECTED]> wrote
 a message of 112 lines which said:


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:


The only thing I can say is that I have the same problem on
FreeBSD 5.4-RELEASE.




Intresting... So it seems im not the only one with problems then.

CC'ing this to the freebsd-stable-list (and the correct mod_python  
mail-address.. had it wrong in the first mail to apache-users)..


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Apache2, mod_python and nss_ldap: Coredump...

2005-11-10 Thread Johan Ström

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:

[EMAIL PROTECTED]:~$ apachectl configtest
Syntax OK
Segmentation fault (core dumped)
[EMAIL PROTECTED]:~$

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  0x 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:


[EMAIL PROTECTED]:~$ 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

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Apache2, mod_python and nss_ldap: Coredump...

2005-11-09 Thread Brian Fundakowski Feldman
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:
> 
> [EMAIL PROTECTED]:~$ apachectl configtest
> Syntax OK
> Segmentation fault (core dumped)
> [EMAIL PROTECTED]:~$
> 
> 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  0x 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.

-- 
Brian Fundakowski Feldman   \'[ FreeBSD ]''\
  <> [EMAIL PROTECTED]   \  The Power to Serve! \
 Opinions expressed are my own.   \,,\
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Apache2, mod_python and nss_ldap: Coredump...

2005-11-09 Thread Johan Ström

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:


[EMAIL PROTECTED]:~$ apachectl configtest
Syntax OK
Segmentation fault (core dumped)
[EMAIL PROTECTED]:~$

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):


[EMAIL PROTECTED]:~$ 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)]
0x in ?? ()
(gdb) where
#0  0x 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).


Does anyone have any clue about whats going on here?
Thanks!
Johan

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[EMAIL PROTECTED]"