[rrd-users] ERROR: attempting to write beyond end of file

Tobias Oetiker tobi at oetiker.ch
Sat Jan 15 13:51:49 CET 2011


Hi Stefan,

Tuesday Stefan Brandl wrote:

> On Thu, Jan 06, 2011 at 04:01:28PM +0100, Tobias Oetiker wrote:
> > Hi Stefan,
> >
> > Dec 28 Stefan M. Brandl wrote:
> >
> > > On Sun, Dec 26, 2010 at 04:16:18PM +0100, Tobias Oetiker wrote:
> > > > Hi Stefan,
> > > >
> > > > I tried to repoduce that but faild .. can you please provide
> > > > the create line for your rrd as well ...
> > > >
> > >
> > > noc at lowrider:~$
> > > noc at lowrider:~$ rrdtool create tester.rrd DS:inet:GAUGE:600:0:U RRA:AVERAGE:0.5:1:600
> > > noc at lowrider:~$  rrdtool resize tester.rrd 0 GROW 100
> > > ERROR: attempting to write beyond end of file
> > > noc at lowrider:~$
> >
> > I could not reproduce this ... are you using rrdtool with mmemory
> > mapping ? could you try without ? what system, kernel are you using
> > ?
> >
>
> I'm using mmap.
> System is a slackware Linux with an "handmade" Kernel 2.6.32.24
>
> Compiling rrdtoool with --disable-mmap I get:
>
> noc at lowrider:~$
> noc at lowrider:~$ /opt/rrdtool-1.4.5.002167/bin/rrdtool create tester.rrd DS:inet:GAUGE:600:0:U RRA:AVERAGE:0.5:1:600
> noc at lowrider:~$ /opt/rrdtool-1.4.5.002167/bin/rrdtool resize tester.rrd 0 GROW 100
> Segmentation fault
> noc at lowrider:~$

I think I found the issue ...

try this:

Index: rrd_resize.c
===================================================================
--- rrd_resize.c        (revision 2168)
+++ rrd_resize.c        (working copy)
@@ -161,6 +161,12 @@
     default:
         rrd_set_error("Do not know how to handle RRD version %s",
                       rrdold.stat_head->version);
+
+        rrdnew.ds_def = NULL;
+        rrdnew.live_head = NULL;
+        rrdnew.pdp_prep = NULL;
+        rrdnew.cdp_prep = NULL;
+
         rrd_free(&rrdnew);
         rrd_free(&rrdold);
         rrd_close(rrd_file);
@@ -282,6 +288,12 @@
     rrd_close(rrd_file);
     rrd_close(rrd_out_file);
     rrd_free(&rrdold);
+
+    rrdnew.ds_def = NULL;
+    rrdnew.live_head = NULL;
+    rrdnew.pdp_prep = NULL;
+    rrdnew.cdp_prep = NULL;
+
     rrd_free(&rrdnew);
     return (0);
 }

cheers
tobi


> Stefan
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-users mailing list