Xymon Mailing List Archive search

Bug in xymon 4.3.4 null template

2 messages in this thread

list Peter Maguire · Fri, 02 Sep 2011 14:40:26 +1000 ·
*Bug has consequences near line 213* do_rrd.c, function
flush_cached_updates.

extract from rrd-status.log

3451 2011-09-01 15:04:31 Sending from devmon to RRD for temp ACpu0Core1:
1314853471:45.0
3451 2011-09-01 15:04:31 Flushing '/upeterm/temp.ACpu0Core1.rrd' with 2
updates pending, template *'(null)'*

2011-09-01 15:04:31 RRD error updating
/usr/local/xymon/data/rrd/upeterm/temp.ACpu0Core1.rrd from 127.0.0.1:
unknown option *'-t'*

xymond_rrd crashing

*gdb report*

#0  0x00007f7699d33d05 in raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f7699d37ab6 in abort () at abort.c:92
#2  0x000000000042dc43 in sigsegv_handler (signum=<value optimised out>)
at sig.c:51
#3  <signal handler called>
#4  __strncasecmp_l_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:2113
#5  0x000000000041fd12 in setup_template (params=<value optimised out>)
at xymonrrd.c:337
#6  0x00000000004066cf in create_and_update_rrd (hostname=<value
optimised out>, testname=<value optimised out>, classname=0x7f769a8b226d
"services",
    pagepaths=0x7f769a8b2276 "0", creparams=0x7fff9d827cc0,
template=<value optimised out>) at do_rrd.c:501
#7  0x0000000000412e4b in do_devmon_rrd (hostname=0x7f769a8b221f
"upeterm", testname=0x7f769a8b2227 "motherboard",
classname=0x7f769a8b226d "services",
    pagepaths=0x7f769a8b2276 "0", msg=<value optimised out>,
tstamp=1314851366) at rrd/do_devmon.c:108
#8  0x0000000000413dd5 in update_rrd (hostname=0x7f769a8b221f "upeterm",
testname=0x7f769a8b2227 "motherboard", msg=<value optimised out>,
tstamp=1314851366,
    sender=<value optimised out>, ldef=<value optimised out>,
classname=0x7f769a8b226d "services", pagepaths=0x7f769a8b2276 "0") at
do_rrd.c:760
#9  0x0000000000403411 in main (argc=<value optimised out>, argv=<value
optimised out>) at xymond_rrd.c:351


*with xymon compiled with debugging suppor*t
CFLAGS = -g -DDEBUG -Wall -D_REENTRANT $(LFSDEF) $(OSDEF) enabled

no more null template, xymond_rrd not crashing

attached is script that collects the data that triggers the problem

*Versions*

xymon is at 4.3.4

OS

Distributor ID: Ubuntu
Description:    Ubuntu 11.04
Release:        11.04
Codename:       natty

Linux upeterm 2.6.38-11-server #48-Ubuntu SMP Fri Jul 29 19:20:32 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux


suggest you add
if ( cacheitem->tpl->template != NULL) {
    :
}

around your code to protect yourself from yourself


Peter
Attachments (1)
list Henrik Størner · Fri, 02 Sep 2011 07:48:31 +0200 ·
Hi Peter,
quoted from Peter Maguire
3451 2011-09-01 15:04:31 Sending from devmon to RRD for temp ACpu0Core1:
1314853471:45.0
3451 2011-09-01 15:04:31 Flushing '/upeterm/temp.ACpu0Core1.rrd' with 2
updates pending, template *'(null)'*
yes, that would be bad...
quoted from Peter Maguire
#3 <signal handler called>
#4 __strncasecmp_l_ssse3 () at ../sysdeps/x86_64/multiarch/../strcmp.S:2113
#5 0x000000000041fd12 in setup_template (params=<value optimised out>)
at xymonrrd.c:337
#6 0x00000000004066cf in create_and_update_rrd (hostname=<value
optimised out>, testname=<value optimised out>, classname=0x7f769a8b226d
"services",
pagepaths=0x7f769a8b2276 "0", creparams=0x7fff9d827cc0, template=<value
optimised out>) at do_rrd.c:501
#7 0x0000000000412e4b in do_devmon_rrd (hostname=0x7f769a8b221f
"upeterm", testname=0x7f769a8b2227 "motherboard",
classname=0x7f769a8b226d "services",
pagepaths=0x7f769a8b2276 "0", msg=<value optimised out>,
tstamp=1314851366) at rrd/do_devmon.c:108
Interesting call trace. I cannot map the line numbers to the 4.3.4 sources; xymond/do_rrd.c line 501 does not contain a call to setup_template() - the only call to setup_template() from create_and_update_rrd() happens at line 307.

If you compiled this yourself, did you apply any patches ?
xymon is at 4.3.4
suggest you add
if ( cacheitem->tpl->template != NULL) {
:
}
No, this isn't the correct fix - it would just try to cover up the underlying problem. cacheitem->tpl->template is not supposed to be NULL, it can only happen if the code calling into the RRD module provides bogus data.

Could you try going back into gdb, then do

    frame 6
    p creparams
    frame 7
    p devmon_params

Another thing you could try for me, please: In xymond/rrd/do_devmon.c, could you change the line

    char *devmon_params[MAXCOLS+7];
to
    char *devmon_params[MAXCOLS+7] = { NULL, };

recompile, copy xymond/xymond_rrd into ~xymon/server/bin/, restart Xymon and let me know if it makes any difference ?


Thanks,
Henrik