[rrd-developers] MRTG , Segmentation Fault , After re-installing perl .

kevin brintnall kbrint at rufus.net
Thu Feb 19 02:35:36 CET 2009


On Wed, Feb 18, 2009 at 03:13:18PM -0900, Mr. James W. Laferriere wrote:
> Starting program: /usr/local/bin/perl /usr/local/mrtg-2/bin/mrtg-ORIG 
> /var/www/htdocs/router2cgi/cfg/to-rtr01.cfg
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1210280256 (LWP 20444)]
> 0xb7e3822b in strlen () from /lib/libc.so.6
> (gdb) bt
> #0  0xb7e3822b in strlen () from /lib/libc.so.6
> #1  0xb7e0a281 in vfprintf () from /lib/libc.so.6
> #2  0xb7e28d91 in vsnprintf () from /lib/libc.so.6
> #3  0xb7d552ac in sprintf_alloc (fmt=0xb7d615c2 "[%lli]RRA[%s][%lu]DS[%s]") at rrd_info.c:34
> #4  0xb7d5a193 in write_to_rras (rrd=0xbffd7a24, rrd_file=0x89c2c88, rra_step_cnt=<value optimized out>, rra_begin=2760,
>      current_time=1234999805, skip_update=0x89ce7c8, pcdp_summary=0xbffd7a80) at rrd_update.c:1944
> #5  0xb7d5ad1f in process_arg (step_start=0x89ccfa0 "1234999805", rrd=0xbffd7a24, rrd_file=0x89c2c88, rra_begin=81864,
>      current_time=0xbffd7a58, current_time_usec=0xbffd7a54, pdp_temp=0x81520c0, pdp_new=0x89ce7f0, rra_step_cnt=0x89ce6f0,
>      updvals=0x87fcce0, tmpl_idx=0x88748d8, tmpl_cnt=3, pcdp_summary=0xbffd7a80, version=3, skip_update=0x89ce7c8,
>      schedule_smooth=0xbffd7a50) at rrd_update.c:819
> #6  0xb7d5be8a in _rrd_update (filename=0x89ce730 "/var/www/htdocs/router2cgi/graphs/to-rtr01/to-rtr01_1.rrd", tmplt=0x0, argc=1,
>      argv=0x8873d80, pcdp_summary=0x887c9d0) at rrd_update.c:497
> #7  0xb7d5c4a1 in rrd_update_v (argc=2, argv=0x8873d78) at rrd_update.c:362

This dump validates your statement that the error only occurs during
updatev...  This is where sprintf_alloc() is being called.  updatev
implies (*pcdp_summary != null).

-----------------------------------
        if (*pcdp_summary != NULL) {
            *pcdp_summary = rrd_info_push(*pcdp_summary,
                                          sprintf_alloc
                                          ("[%lli]RRA[%s][%lu]DS[%s]",
                                          rra_time,
                                           rrd->rra_def[rra_idx].cf_nam,
                                           rrd->rra_def[rra_idx].pdp_cnt,
                                           rrd->ds_def[ds_idx].ds_nam),
                                          RD_I_VAL, iv);
        }
-----------------------------------

However, that doesn't match up exactly with the call trace you posted (it
should be in the function 'write_RRA_row').  It's probably because the
compiler is optimizing away some of the function calls.  You may want to
re-compile with debugging enabled and no optimizations (i.e. CFLAGS=-g).

We need to see inside the args being passed to sprintf_alloc().  Can you
reproduce the problem and then do the following:

  (gdb) bt
  -- note which frame is the call to write_RRA_row(), use in the next command

  (gdb) select <FRAME>
  (gdb) p *rrd
  (gdb) p rra_idx
  (gdb) p rrd->rra_def[rrd_idx]
  (gdb) p rrd->rra_def[rrd_idx].cf_nam
  (gdb) p rrd->rra_def[rra_idx].pdp_cnt
  (gdb) p rrd->ds_def[ds_idx].ds_nam

Also, I have a few other questions:

 - is it always the same RRD file that causes the crash?
 - does that RRD cause the crash every time?

 - do you have any similar files (i.e. same RRA and DS definitions) that
   do not cause crash?

-- 
 kevin brintnall =~ /kbrint at rufus.net/



More information about the rrd-developers mailing list