[rrd-developers] Another bug in CVS 12/25/01?

Mike McHenry mmchenry at origix.net
Wed Feb 6 22:34:43 MET 2002

Hello all, I have found what appears to be another problem with the
changes introduced in the 12/25/01 CVS build. I have narrowed it down to
this diff in rrd_fetch.c

@@ -260,7 +310,8 @@
                    - (rrd.live_head->last_up % *step));
     rra_start_time = (rra_end_time
                 - ( *step * (rrd.rra_def[chosen_rra].row_cnt-1)));
-    start_offset =(long)(*start - rra_start_time) / (long)*step;
+    /* here's an error by one if we don't be careful */
+    start_offset =(long)(*start + *step - rra_start_time) /
     end_offset = (long)(rra_end_time - *end ) / (long)*step;
 #ifdef DEBUG
     fprintf(stderr,"rra_start %lu, rra_end %lu, start_off %li, end_off

Can anyone offer any comments on what this change was supposed to fix?
The 12/25/01 build seems to be giving incorrect data when I fetch data
from RRD structures and reverting back to the old 12/24/01 code seems to
fix the problem. However, I have not tested extensively with the removal
of this patch to see if there are any side effects to be had from
removing it.

Mike McHenry
 Senior Network Engineer
 Origix Corp.

Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-developers mailing list