Ticket #97 (closed defect: worksforme)
rrdtool segfaults under odd circumstances
| Reported by: | human | Owned by: | oetiker |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | rrd_graph | Version: | 1.2.23 |
| Keywords: | Cc: |
Description
I had a segmentation fault from rrdtool. gdb backtrack shows it happened at line 1054 of rrd_graph.c. The graph it was trying to plot was quite complex, 8 stacked curves. I can provide the rrd file if necessary.
What is odd is that it segfaults if environment variable LANG is set to C, but does not segfault if it is set to anything else, even something meaningless, like 'banana'. I made a wrapper that sets LANG to a non-C value and then execs rrdtool. It works fine and I have my plots.
some information that may be useful:
# cat /etc/redhat-release
CentOS release 4.4 (Final)
# ldd -d /usr/bin/rrdtool
librrd.so.2 => /usr/lib/librrd.so.2 (0x00ef9000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x005da000)
libz.so.1 => /usr/lib/libz.so.1 (0x00865000)
libart_lgpl_2.so.2 => /usr/lib/libart_lgpl_2.so.2 (0x00b73000)
libm.so.6 => /lib/tls/libm.so.6 (0x0074b000)
libc.so.6 => /lib/tls/libc.so.6 (0x00618000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00bae000)
/lib/ld-linux.so.2 (0x005ff000)
# rrdtool
RRDtool 1.2.23 ......
command line that segfaults (copied from cacti)
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Telar network services scores" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit=80 \
--lower-limit=0 \
--units-exponent=0 \
--vertical-label="performance scores" \
--slope-mode \
DEF:a="/usr/local/cacti/rra/scoreboard.rrd":ping:AVERAGE \
DEF:b="/usr/local/cacti/rra/scoreboard.rrd":squid:AVERAGE \
DEF:c="/usr/local/cacti/rra/scoreboard.rrd":website:AVERAGE \
DEF:d="/usr/local/cacti/rra/scoreboard.rrd":mail:AVERAGE \
DEF:e="/usr/local/cacti/rra/scoreboard.rrd":pop:AVERAGE \
DEF:f="/usr/local/cacti/rra/scoreboard.rrd":ldap:AVERAGE \
DEF:g="/usr/local/cacti/rra/scoreboard.rrd":cifs:AVERAGE \
DEF:h="/usr/local/cacti/rra/scoreboard.rrd":dbcorpore:AVERAGE \
AREA:a#8D00BA:"Ping test" \
GPRINT:a:LAST:" Current\:%8.2lf %s\n" \
AREA:b#0000FF:"Web proxy server":STACK \
GPRINT:b:LAST:" Current\:%8.2lf %s\n" \
AREA:c#00BED9:"Websites":STACK \
GPRINT:c:LAST:" Current\:%8.2lf %s\n" \
AREA:d#00FF00:"e-mail round trip":STACK \
GPRINT:d:LAST:" Current\:%8.2lf %s\n" \
AREA:e#FFF200:"Mailbox access":STACK \
GPRINT:e:LAST:" Current\:%8.2lf %s\n" \
AREA:f#FF7D00:"Intranet directory":STACK \
GPRINT:f:LAST:"Current\:%8.2lf %s\n" \
AREA:g#FF0000:"File sharing":STACK \
GPRINT:g:LAST:" Current\:%8.2lf %s\n" \
AREA:h#FF00FF:"Corpore DB":STACK \
GPRINT:h:LAST:" Current\:%8.2lf %s\n" \
LINE1::""
gdb backtrack:
#0 0x00566b60 in data_proc (im=0xbfe7cf60) at rrd_graph.c:1054
#1 0x0056ce77 in graph_paint (im=0xbfe7cf60, calcpr=0xbfe7ed1c)
at rrd_graph.c:2615
#2 0x0056de78 in rrd_graph (argc=40, argv=0xbfe7ef68, prdata=0xbfe7ed1c,
xsize=0xbfe7ed20, ysize=0xbfe7ed24, stream=0x0, ymin=0xbfe7ed28,
ymax=0xbfe7ed30) at rrd_graph.c:3059
#3 0x0057b145 in HandleInputLine (argc=41, argv=0xbfe7ef64, out=0x73f480)
at rrd_tool.c:763
#4 0x0057bbc5 in main (argc=41, argv=0xbfe7ef64) at rrd_tool.c:459
#5 0x0062cde3 in __libc_start_main () from /lib/tls/libc.so.6
#6 0x080483f9 in _start ()



Dear User,
please supply a little script to reproduce the bug. The info you are giving here does not ring a bell.
cheers tobi