pthreaded program killed by sigsegv from time to time under load

Andriy Tkachuk ant at emict.com
Fri Jun 3 09:29:08 PDT 2005


the same program linked with -lthr killed from the start:



> gdb client client.core
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"...
Core was generated by `client'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libthr.so.1...done.
Loaded symbols for /usr/lib/libthr.so.1
Reading symbols from /usr/lib/libstdc++.so.4...done.
Loaded symbols for /usr/lib/libstdc++.so.4
Reading symbols from /lib/libm.so.3...done.
Loaded symbols for /lib/libm.so.3
Reading symbols from /lib/libc.so.5...done.
Loaded symbols for /lib/libc.so.5
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x282439ff in flockfile () from /lib/libc.so.5
(gdb) bt
#0  0x282439ff in flockfile () from /lib/libc.so.5
#1  0x282258fb in fgets () from /lib/libc.so.5
#2  0x28220c66 in gethostent () from /lib/libc.so.5
#3  0x28220e95 in _ht_gethostbyname () from /lib/libc.so.5
#4  0x28220809 in nsdispatch () from /lib/libc.so.5
#5  0x2821fcf5 in gethostbyname2 () from /lib/libc.so.5
#6  0x2821fca3 in gethostbyname () from /lib/libc.so.5
#7  0x0804d86c in client_connect (host_addr=0x8805100 "10.100.3.1", port=1604) at lib.cc:93
#8  0x0804d46c in client_thread (termc=0x8800d24) at client.cc:1685
#9  0x28097390 in _thread_start () at /usr/src/lib/libthr/thread/thr_create.c:167
#10 0x2822d253 in _ctx_start () from /lib/libc.so.5



On Friday 03 June 2005 13:15, Andriy Tkachuk wrote:
> hi folks. what can be the reason of $subj ?
> 
> is the problem with libpthread or with my prog?
> 
> thanks.
> 
> > gdb client client.core
> 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"...
> 
> warning: exec file is newer than core file.
> Core was generated by `client'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /usr/lib/libpthread.so.1...done.
> Loaded symbols for /usr/lib/libpthread.so.1
> Reading symbols from /usr/lib/libstdc++.so.4...done.
> Loaded symbols for /usr/lib/libstdc++.so.4
> Reading symbols from /lib/libm.so.3...done.
> Loaded symbols for /lib/libm.so.3
> Reading symbols from /lib/libc.so.5...done.
> Loaded symbols for /lib/libc.so.5
> Reading symbols from /libexec/ld-elf.so.1...done.
> Loaded symbols for /libexec/ld-elf.so.1
> #0  0x280ac31b in pthread_testcancel () from /usr/lib/libpthread.so.1
> (gdb) bt
> #0  0x280ac31b in pthread_testcancel () from /usr/lib/libpthread.so.1
> #1  0x280a4902 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
> #2  0x00000000 in ?? ()
> (gdb) > uname -a
> FreeBSD ant 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #3: Wed May 18 09:08:16 EEST 2005     ant at ant:/lin/fbsd_obj/usr/src/sys/ANT  i386
> 


More information about the freebsd-threads mailing list