Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 342919 - net-analyzer/rrdtool-1.4.3 compiled by sys-devel/gcc-4.5.1 does not work on i[56]86 architecture
Summary: net-analyzer/rrdtool-1.4.3 compiled by sys-devel/gcc-4.5.1 does not work on i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-27 12:10 UTC by J.Taimr
Modified: 2010-12-16 07:15 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J.Taimr 2010-10-27 12:10:16 UTC
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.
Comment 1 Michael Orlitzky gentoo-dev 2010-10-28 00:20:33 UTC
Created bug 343017 as a possible fix.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-29 06:34:44 UTC
Please put a full atom in the Summary.
Comment 3 Piotr Szymaniak 2010-12-05 19:32:32 UTC
(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.
Comment 4 Hans de Graaff gentoo-dev Security 2010-12-16 07:15:41 UTC
I've just added rrdtool-1.4.4 to CVS which should also fix this.