[rrd-users] Segmentation Fault - Basic Test of RRDTool 1.2.19

Sam Umbach sumbach at gmail.com
Tue Apr 17 01:48:32 CEST 2007


On 4/16/07, Mark Easton <mark.easton at azurebell.co.nz> wrote:
>
> //Create Graph - but this returns a segmentation fault (core dumped)
> sprintf(argstr, "temp.png --start %lu --end %lu
> DEF:mytemp=temperature.rrd:temp:AVERAGE", (long)start_time, (long)end_time);
>
> ret = wrap_rrd_graph( argstr);

rrd_wrapper from the contrib section of the rrdtool website is dated
17-Dec-2001.  It has not been kept up and isn't compatible with
rrdtool 1.2.x.  Actually, I'm not sure how you got it to compile; I
receive the following error:

$ gcc -o test -lrrd main.c rrdwrap.c
rrdwrap.c: In function 'wrap_rrd_graph':
rrdwrap.c:165: error: too few arguments to function 'rrd_graph'

I would guess you have an old version of rrd.h and rrd_tool.h, but
somehow linking to the 1.2.x version of the library (librrd.so).  I've
attached a patch against rrdwrap.c that at least makes it compile (and
fixes a memory leak).

As you can see, rrd_wrapper is out-of-date and unmaintained.  I urge
you to consider using the librrd API directly.  Look at main() in
src/rrd_tool.c you'll see how the command-line rrdtool does this.

-Sam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rrdwrap.patch
Type: text/x-patch
Size: 951 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20070416/1425d6bf/attachment-0001.bin 


More information about the rrd-users mailing list