ndo2db segfault

Antoine Musso antoine.musso at laposte.fr
Thu Oct 16 17:59:26 CEST 2008


Hello,

We have a segfault with ndo2db when sending large chunk of perfdata. I 
tracked the problem either with a tcp or an unix socket.

The usual backtrace, hopefully there is enough informations:

nagios at host$ ulimit -c 50000
nagios at host$ /opt/nagios/bin/ndo2db -c /opt/nagios/etc/ndo2db.cfg

Waiting a bit and launching gdb on the generated core

nagios at host$ gdb /opt/nagios/bin/ndo2db --core core.5964
<snip gdb header>
Core was generated by `/opt/nagios/bin/ndo2db -c 
/opt/nagios/etc/ndo2db.cfg'.
Program terminated with signal 11, Segmentation fault.
<snip symbols>
#0  0x0000003490e59564 in __find_specmb () from /lib64/tls/libc.so.6
(gdb) thread apply all bt full

Thread 1 (process 5174):
#0  0x0000003490e59564 in __find_specmb () from /lib64/tls/libc.so.6
No symbol table info available.
#1  0x0000003490e3f8f2 in vfprintf () from /lib64/tls/libc.so.6
No symbol table info available.
#2  0x0000003490e62496 in vasprintf () from /lib64/tls/libc.so.6
No symbol table info available.
#3  0x0000003490e487c6 in asprintf () from /lib64/tls/libc.so.6
No symbol table info available.
#4  0x00000000004105de in ndo2db_db_hello (idi=0x7fbffff100) at db.c:294
	buf = Variable "buf" is not available.
(gdb)


This is the system call trace on ndo2db listening on tcp 127.0.0.1 :

# strace -f -p 16316
Process 16316 attached - interrupt to quit
accept(4, {sa_family=AF_INET, sin_port=htons(57169), 
sin_addr=inet_addr("127.0.0.1")}, [4294967312]) = 5
clone(Process 9942 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, 
child_tidptr=0x2a9556e090) = 9942
[pid 16316] close(5)                    = 0
[pid 16316] accept(4,  <unfinished ...>
[pid  9942] close(3)                    = 0
[pid  9942] open("/tmp/ndo2db.debug", O_RDWR|O_CREAT|O_APPEND, 0666) = 3
[pid  9942] rt_sigaction(SIGQUIT, {0x402930, [QUIT], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, {0x402900, [QUIT], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, 8) = 0
[pid  9942] rt_sigaction(SIGTERM, {0x402930, [TERM], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, {0x402900, [TERM], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, 8) = 0
[pid  9942] rt_sigaction(SIGINT, {0x402930, [INT], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, {0x402900, [INT], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, 8) = 0
[pid  9942] rt_sigaction(SIGSEGV, {0x402930, [SEGV], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, {0x402900, [SEGV], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, 8) = 0
[pid  9942] rt_sigaction(SIGFPE, {0x402930, [FPE], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, {0x402900, [FPE], 
SA_RESTORER|SA_RESTART, 0x3490e2e2f0}, 8) = 0
[pid  9942] read(5, "\n\nHELLO\nPROTOCOL: 2\nAGENT: NDOMO"..., 511) = 511
[pid  9942] brk(0x55b000)               = 0x55b000
[pid  9942] brk(0x57c000)               = 0x57c000
[pid  9942] brk(0x59d000)               = 0x59d000
[pid  9942] brk(0x5be000)               = 0x5be000
[pid  9942] brk(0x5df000)               = 0x5df000
[pid  9942] brk(0x600000)               = 0x600000
[pid  9942] brk(0x621000)               = 0x621000
[pid  9942] brk(0x642000)               = 0x642000
[pid  9942] brk(0x663000)               = 0x663000
[pid  9942] brk(0x684000)               = 0x684000
<snip>
[pid  9942] brk(0xec4000)               = 0xec4000
[pid  9942] brk(0xee5000)               = 0xee5000
[pid  9942] brk(0xf06000)               = 0xf06000
[pid  9942] brk(0xf27000)               = 0xf27000
[pid  9942] brk(0xf48000)               = 0xf48000
[pid  9942] brk(0xf69000)               = 0xf69000
[pid  9942] brk(0xf8a000)               = 0xf8a000
[pid  9942] brk(0xfab000)               = 0xfab000
[pid  9942] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
[pid  9942] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 9942 detached
<... accept resumed> 0x7fbffff7b0, [4294967312]) = ? ERESTARTSYS (To be 
restarted)
--- SIGCHLD (Child exited) @ 0 (0) ---
wait4(-1, NULL, WNOHANG, NULL)          = 9942
rt_sigreturn(0xffffffffffffffff)        = 43
accept(4,  <unfinished ...>
Process 16316 detached


Our configuration :

Linux Redhat Enterprise 5
ndoutils 1.4b7
nagios 3.0.3

ldd ndo2db give us :

   libz.so.1.2.1.2
   libnsl-2.3.4.so
   libmysqlclient.so.14.0.0
   libm-2.3.4.so
   libc-2.3.4.so
   libcrypt-2.3.4.so
   libssl.so.0.9.7a
   libcrypto.so.0.9.7a
   libgssapi_krb5.so.2.2
   libkrb5.so.3.2
   libcom_err.so.2.1
   libk5crypto.so.3.0
   libresolv-2.3.4.so
   libdl-2.3.4.so
   /lib64/ld-linux-x86-64.so.2



-- 
Antoine MUSSO
DISIT/PROD/QFO/OUT
mailto:antoine.musso at laposte.fr
tél. 02 40 12 73 62
-------------- next part --------------
Post-scriptum La Poste

Ce message est confidentiel. Sous réserve de tout accord conclu par
écrit entre vous et La Poste, son contenu ne représente en aucun cas un
engagement de la part de La Poste. Toute publication, utilisation ou
diffusion, même partielle, doit être autorisée préalablement. Si vous
n'êtes pas destinataire de ce message, merci d'en avertir immédiatement
l'expéditeur.


-------------- next part --------------
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list