rrdtool-1.4.3 from portage is unable to open even just created database, if compiled by gcc-4.5.1 on i586 or i686. On amd64 (64bit) it works without problems. Reproducible: Always Steps to Reproduce: 1.emerge rrdtool-1.4.3 on i[56]86 architecture 2.create any test.rrd database (for example as in man rrdcreate) 3.try to dump it by rrdtool dump test.rrd Actual Results: Any attempt to open the database fails with the message "ERROR: This RRD was created on another architecture" Expected Results: rrdtool should work The reason is wrong detection of the db by rrd_open procedure, the test modificaton: --- rrd_open.c.orig 2010-03-22 17:05:55.000000000 +0100 +++ rrd_open.c 2010-10-25 12:35:30.000000000 +0200 @@ -286,7 +286,9 @@ } if (rrd->stat_head->float_cookie != FLOAT_COOKIE) { - rrd_set_error("This RRD was created on another architecture"); + rrd_set_error("This RRD was created on another architecture, %g != %g, diff=%g ", + rrd->stat_head->float_cookie, FLOAT_COOKIE, + rrd->stat_head->float_cookie - FLOAT_COOKIE); goto out_nullify_head; } produces: rrdtool dump test.rrd ERROR: This RRD was created on another architecture, 8,64213e+130 != 8,64213e+130, diff=-2,76083e+114 Problem can be solved by the patch: --- rrd_format.h.orig 2010-03-22 17:05:55.000000000 +0100 +++ rrd_format.h 2010-10-25 20:40:13.977566766 +0200 @@ -35,7 +35,7 @@ /* changed because microsecond precision requires another field */ #define RRD_VERSION "0004" #define RRD_VERSION3 "0003" -#define FLOAT_COOKIE 8.642135E130 +#define FLOAT_COOKIE (double)8.642135E130 typedef union unival { unsigned long u_cnt; Tobi Oetiker was informed about the problem already. There is new vesion of rrdtool-1.4.4, which contains similar change for the proper work on i[56]86, but this version is not present in portage yet.
Created bug 343017 as a possible fix.
Please put a full atom in the Summary.
(In reply to comment #0) > Problem can be solved by the patch: > --- rrd_format.h.orig 2010-03-22 17:05:55.000000000 +0100 > +++ rrd_format.h 2010-10-25 20:40:13.977566766 +0200 > @@ -35,7 +35,7 @@ > /* changed because microsecond precision requires another field */ > #define RRD_VERSION "0004" > #define RRD_VERSION3 "0003" > -#define FLOAT_COOKIE 8.642135E130 > +#define FLOAT_COOKIE (double)8.642135E130 > > typedef union unival { > unsigned long u_cnt; +1 for this. I just spend few hours trying to dump and restore some datebases. Got the patch from rrdtools website, but yeah, it works.
I've just added rrdtool-1.4.4 to CVS which should also fix this.