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

Mr. James W. Laferriere babydr at baby-dragons.com
Wed Apr 1 21:01:24 CEST 2009


   	Hello Kevin ,

On Thu, 12 Mar 2009, kevin brintnall wrote:
> On Thu, Mar 12, 2009 at 02:07:18PM -0800, Mr. James W. Laferriere wrote:
>> On Thu, 12 Mar 2009, kevin brintnall wrote:
>>> On Thu, Mar 12, 2009 at 10:43:16AM -0800, Mr. James W. Laferriere wrote:
>>>>
>>>>  	CFLAGS=-g ./configure ; CFLAGS=-g make ; CFLAGS=-g make install
>
> Somehow I think your compiler still has optimizations on..  it appears to
> be in-lining write_RRA_row.  When I compile with a similar procedure,
> write_RRA_rows is not in-lined.  FYI I believe you only need to specify
> the CFLAGS on the 'configure'.
>
> Can you show the command line that's being used to compile rrd_update.c ?

 	There are two places in the make process that that file is compiled or 
built ,  They're in the attached file , make-rrdtool-1_3_6.rrd_update_c.log .
 	I also have a full make log capture if you ever need that .


> It will be very helpful to see the ds_idx value; I suspect it's this
> pointer de-reference that's causing the SIGSEGV, because all the other
> pointers look correct: 	rrd->ds_def[ds_idx].ds_nam

 	See attached ,  rrdtool-segfault-20090401.log .


> This could also happen if your stat_head->ds_cnt is corrupted somehow.
>
> 	(gdb) p rrd->stat_head->ds_cnt
> 	(gdb) p rrd->stat_head

 	See attached ,  rrdtool-segfault-20090401.log .

> Also, what happens if you run an equivalent 'rrdtool updatev' from the
> command line?

 	Don't know I'll try it (I hope I can build the proper command line) ,
 	Hopefully this did not break anything ...  But no error that I can see , 
that is interesting ...

# /usr/local/rrdtool/bin/rrdtool updatev /var/www/htdocs/router2cgi/graphs/to-rtr01/to-rtr01_1.rrd -t ds0:ds1 `date "+%s"`:4942:3254
return_value = 0
# 
# /usr/local/rrdtool/bin/rrdtool -V
RRDtool 1.3.6  Copyright 1997-2008 by Tobias Oetiker <tobi at oetiker.ch>
                Compiled Feb  6 2009 09:28:18
...snip...

-- 
+------------------------------------------------------------------+
| James   W.   Laferriere | System    Techniques | Give me VMS     |
| Network&System Engineer | 2133    McCullam Ave |  Give me Linux  |
| babydr at baby-dragons.com | Fairbanks, AK. 99701 |   only  on  AXP |
+------------------------------------------------------------------+
-------------- next part --------------
[?1034hGNU gdb 6.6
Copyright (C) 2006 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 "i486-slackware-linux"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) set args /usr/local/mrtg-2/bin/mrtg-ORIG /var/www/htdocs/router2cgi/cfg/to-rtr01.cfg
(gdb) run
Starting program: /usr/local/bin/perl /usr/local/mrtg-2/bin/mrtg-ORIG /var/www/htdocs/router2cgi/cfg/to-rtr01.cfg
[Thread debugging using libthread_db enabled]
[New Thread -1210906944 (LWP 4125)]
Error while reading shared library symbols:
Cannot find new threads: generic error

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210906944 (LWP 4125)]
0xb7d9f22b in strlen () from /lib/libc.so.6
(gdb) bt
#0  0xb7d9f22b in strlen () from /lib/libc.so.6
#1  0xb7d71281 in vfprintf () from /lib/libc.so.6
#2  0xb7d8fd91 in vsnprintf () from /lib/libc.so.6
#3  0xb7cbc2ac in sprintf_alloc (fmt=0xb7cc85c2 "[%lli]RRA[%s][%lu]DS[%s]") at rrd_info.c:34
#4  0xb7cc1193 in write_to_rras (rrd=0xbff20944, rrd_file=0x897b658, rra_step_cnt=<value optimized out>, rra_begin=2760, 
    current_time=1238611056, skip_update=0x89cdfb0, pcdp_summary=0xbff209a0) at rrd_update.c:1944
#5  0xb7cc1d1f in process_arg (step_start=0x8980460 "1238611056", rrd=0xbff20944, rrd_file=0x897b658, rra_begin=81864, 
    current_time=0xbff20978, current_time_usec=0xbff20974, pdp_temp=0x89cdf98, pdp_new=0x897b280, rra_step_cnt=0x897b258, 
    updvals=0x88878f0, tmpl_idx=0x8888fc0, tmpl_cnt=3, pcdp_summary=0xbff209a0, version=3, skip_update=0x89cdfb0, 
    schedule_smooth=0xbff20970) at rrd_update.c:819
#6  0xb7cc2e8a in _rrd_update (filename=0x89ce000 "/var/www/htdocs/router2cgi/graphs/to-rtr01/to-rtr01_1.rrd", tmplt=0x0, argc=1, 
    argv=0x885f7c0, pcdp_summary=0x88795e0) at rrd_update.c:497
#7  0xb7cc34a1 in rrd_update_v (argc=2, argv=0x885f7b8) at rrd_update.c:362
#8  0xb7cd00cf in XS_RRDs_updatev () from /usr/local/lib/perl5/site_perl/5.10.0/i686-linux//auto/RRDs/RRDs.so
#9  0x0809ed60 in Perl_pp_entersub ()
#10 0x0809d638 in Perl_runops_standard ()
#11 0x08099fa4 in perl_run ()
#12 0x0805ed7f in main ()
(gdb) p rrd->stat_head->ds_cnt
No symbol "rrd" in current context.
(gdb) p rrd->stat_head
No symbol "rrd" in current context.
(gdb) p rrd->ds_def[ds_idx].ds_nam
No symbol "rrd" in current context.
(gdb) exit
Undefined command: "exit".  Try "help".
(gdb) quit
The program is running.  Exit anyway? (y or n) 
-------------- next part --------------
if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR="\"/usr/local/rrdtool-1.3.6/share/locale\"" -DRRD_DEFAULT_FONT=\""DejaVu Sans Mono,Bitstream Vera Sans Mono,monospace,Courier"\" -DNUMVERS=1.3006 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2   -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/include/libxml2  -g -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W  -fPIC -DPIC -MT rrd_update.lo -MD -MP -MF ".deps/rrd_update.Tpo" -c -o rrd_update.lo rrd_update.c; \

 gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR=\"/usr/local/rrdtool-1.3.6/share/locale\" "-DRRD_DEFAULT_FONT=\"DejaVu Sans Mono,Bitstream Vera Sans Mono,monospace,Courier\"" -DNUMVERS=1.3006 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libxml2 -g -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -fPIC -DPIC -MT rrd_update.lo -MD -MP -MF .deps/rrd_update.Tpo -c rrd_update.c  -fPIC -DPIC -o .libs/rrd_update.o

 gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR=\"/usr/local/rrdtool-1.3.6/share/locale\" "-DRRD_DEFAULT_FONT=\"DejaVu Sans Mono,Bitstream Vera Sans Mono,monospace,Courier\"" -DNUMVERS=1.3006 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libxml2 -g -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -fPIC -DPIC -MT rrd_update.lo -MD -MP -MF .deps/rrd_update.Tpo -c rrd_update.c -o rrd_update.o >/dev/null 2>&1


if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR="\"/usr/local/rrdtool-1.3.6/share/locale\"" -DRRD_DEFAULT_FONT=\""DejaVu Sans Mono,Bitstream Vera Sans Mono,monospace,Courier"\" -DNUMVERS=1.3006 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2   -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12   -I/usr/include/libxml2 -pthread -g -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W  -fPIC -DPIC -MT librrd_th_la-rrd_update.lo -MD -MP -MF ".deps/librrd_th_la-rrd_update.Tpo" -c -o librrd_th_la-rrd_update.lo `test -f 'rrd_update.c' || echo './'`rrd_update.c; \

 gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR=\"/usr/local/rrdtool-1.3.6/share/locale\" "-DRRD_DEFAULT_FONT=\"DejaVu Sans Mono,Bitstream Vera Sans Mono,monospace,Courier\"" -DNUMVERS=1.3006 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libxml2 -pthread -g -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -fPIC -DPIC -MT librrd_th_la-rrd_update.lo -MD -MP -MF .deps/librrd_th_la-rrd_update.Tpo -c rrd_update.c  -fPIC -DPIC -o .libs/librrd_th_la-rrd_update.o

 gcc -DHAVE_CONFIG_H -I. -I. -I.. -DLOCALEDIR=\"/usr/local/rrdtool-1.3.6/share/locale\" "-DRRD_DEFAULT_FONT=\"DejaVu Sans Mono,Bitstream Vera Sans Mono,monospace,Courier\"" -DNUMVERS=1.3006 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libxml2 -pthread -g -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -fPIC -DPIC -MT librrd_th_la-rrd_update.lo -MD -MP -MF .deps/librrd_th_la-rrd_update.Tpo -c rrd_update.c -o librrd_th_la-rrd_update.o >/dev/null 2>&1


More information about the mrtg-developers mailing list