|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: rrdtool: update crashHi Sebastian,
thanks ... added tobi Today Sebastian Harl wrote: > tags 428780 + patch > retitle 428780 rrdtool create: Missing command line verification. > thanks > > Hi Justin, > > On Wed, Jun 13, 2007 at 10:09:25PM -0400, Justin Pryzby wrote: > > $ rrdtool create --start 1080000000 foo.rrd DS:bar:GAUGE:1:U:U RRA:AVERAGE:0:1:0 > > Sometimes, it's the small things: You've specified a row count of 0 in > the RRA definition (that's the zero at the end of the RRA definition), > that is, you're telling RRDtool to keep 0 values in that RRA. > > > $ rrdtool update ./foo.rrd N:1 0:0 > > Segmentation fault > > Obviously, rrdtool does not handle the case that the row count is zero > (FWIW that does not make any sense anyway). In the current SVN version > of the upcoming 1.3 release, rrdcreate segfaults in that case because of > an division by zero. The same seems to apply to rrdupdate in 1.2. > > If you specify a row count greater than zero everything works fine. > > Anyway, software should not segfault because of invalid input. Attached > is a patch against the current SVN trunk which will cause rrdcreate to > bail out with an error message when specifying a row count less than or > equal to zero. Tobi, could you please apply that to trunk? > > I'm not sure, if 1.3 is going to make it into Lenny, so I will backport > that fix to 1.2 and upload a new version to unstable soon. > > Cheers, > Sebastian > > -- Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten http://it.oetiker.ch tobi@... ++41 62 213 9902 _______________________________________________ rrd-developers mailing list rrd-developers@... https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers |
|
|
Re: rrdtool: update crashOn Tue, Jun 10, 2008 at 11:24:29AM +0200, Sebastian Harl wrote:
>diff --git a/program/src/rrd_create.c b/program/src/rrd_create.c >index bb8d45d..cc93109 100644 >--- a/program/src/rrd_create.c >+++ b/program/src/rrd_create.c >@@ -312,8 +313,10 @@ int rrd_create_r( > case CF_SEASONAL: > case CF_DEVPREDICT: > case CF_FAILURES: >- rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = >- atoi(token); >+ row_cnt = atoi(token); >+ rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt; >+ if (row_cnt <= 0) >+ rrd_set_error("Invalid row count: %i", row_cnt); It would look more obvious if you moved the check of row_cnt right after the atoi(). > break; > default: > rrd.rra_def[rrd.stat_head->rra_cnt]. >@@ -416,8 +419,10 @@ int rrd_create_r( > ("Unexpected extra argument for consolidation function DEVPREDICT"); > break; > default: >- rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = >- atoi(token); >+ row_cnt = atoi(token); >+ rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt; >+ if (row_cnt <= 0) >+ rrd_set_error("Invalid row count: %i", row_cnt); ditto. _______________________________________________ rrd-developers mailing list rrd-developers@... https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers |
| Free Forum Powered by Nabble | Forum Help |