Debian Bug report logs - #754623
percona-xtradb-cluster-galera-2.x: FTBFS on many archs

version graph

Package: src:percona-xtradb-cluster-galera-2.x; Maintainer for src:percona-xtradb-cluster-galera-2.x is (unknown);

Reported by: Cyril Brulebois <kibi@debian.org>

Date: Sun, 13 Jul 2014 01:27:02 UTC

Severity: serious

Found in version percona-xtradb-cluster-galera-2.x/175-2

Fixed in version percona-xtradb-cluster-galera-2.x/175-2.1

Done: Anibal Monsalve Salazar <anibal@debian.org>

Bug is archived. No further changes may be made.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, kibi@debian.org, Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>:
Bug#754623; Package src:percona-xtradb-cluster-galera-2.x. (Sun, 13 Jul 2014 01:27:07 GMT) (full text, mbox, link).


Acknowledgement sent to Cyril Brulebois <kibi@debian.org>:
New Bug report received and forwarded. Copy sent to kibi@debian.org, Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>. (Sun, 13 Jul 2014 01:27:07 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Cyril Brulebois <kibi@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: percona-xtradb-cluster-galera-2.x: FTBFS on many archs
Date: Sun, 13 Jul 2014 03:23:22 +0200
Source: percona-xtradb-cluster-galera-2.x
Version: 175-2
Severity: serious
Justification: FTBFS

Hi,

your package no longer builds on many archs. Build excerpt from powerpc:
| gcc -o galerautils/src/gu_rand.o -c -std=c99 -fno-strict-aliasing -pipe -g -O3 -DNDEBUG -Wall -Wextra -Wno-unused-parameter -pedantic -pthread -D_XOPEN_SOURCE=600 -DHAVE_COMMON_H -DGALERA_USE_GU_NETWORK -DHAVE_BYTESWAP_H -DHAVE_ENDIAN_H -DHAVE_BOOST_SHARED_PTR_HPP -DHAVE_TR1_UNORDERED_MAP -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG=1 -DHAVE_ASIO_HPP -DHAVE_ASIO_SSL_HPP -Werror -Icommon -Iasio -Igalerautils/src -Igcomm/src -Igcomm/src/gcomm -Igcache/src -Igcs/src -Iwsdb/src -Igalera/src galerautils/src/gu_rand.c
| In file included from galerautils/src/gu_hash.h:30:0,
|                  from galerautils/src/gu_rand.c:15:
| galerautils/src/gu_rand.c: In function 'gu_rand_seed_long':
| galerautils/src/gu_mmh3.h:195:21: error: '*((void *)&rse+23)' is used uninitialized in this function [-Werror=uninitialized]
|      case  8: k1 ^= ((uint64_t)tail[ 7]) << 56;
|                      ^
| galerautils/src/gu_rand.c:32:14: note: '*((void *)&rse+23)' was declared here
|      gu_rse_t rse = { time, heap_ptr, &time, pid };
|               ^
| In file included from galerautils/src/gu_hash.h:30:0,
|                  from galerautils/src/gu_rand.c:15:
| galerautils/src/gu_mmh3.h:196:21: error: '*((void *)&rse+22)' is used uninitialized in this function [-Werror=uninitialized]
|      case  7: k1 ^= ((uint64_t)tail[ 6]) << 48;
|                      ^
| galerautils/src/gu_rand.c:32:14: note: '*((void *)&rse+22)' was declared here
|      gu_rse_t rse = { time, heap_ptr, &time, pid };
|               ^
| In file included from galerautils/src/gu_hash.h:30:0,
|                  from galerautils/src/gu_rand.c:15:
| galerautils/src/gu_mmh3.h:197:21: error: '*((void *)&rse+21)' is used uninitialized in this function [-Werror=uninitialized]
|      case  6: k1 ^= ((uint64_t)tail[ 5]) << 40;
|                      ^
| galerautils/src/gu_rand.c:32:14: note: '*((void *)&rse+21)' was declared here
|      gu_rse_t rse = { time, heap_ptr, &time, pid };
|               ^
| In file included from galerautils/src/gu_hash.h:30:0,
|                  from galerautils/src/gu_rand.c:15:
| galerautils/src/gu_mmh3.h:198:21: error: '*((void *)&rse+20)' is used uninitialized in this function [-Werror=uninitialized]
|      case  5: k1 ^= ((uint64_t)tail[ 4]) << 32;
|                      ^
| galerautils/src/gu_rand.c:32:14: note: '*((void *)&rse+20)' was declared here
|      gu_rse_t rse = { time, heap_ptr, &time, pid };
|               ^
| cc1: all warnings being treated as errors
| scons: *** [galerautils/src/gu_rand.o] Error 1

Full build log:
  https://buildd.debian.org/status/fetch.php?pkg=percona-xtradb-cluster-galera-2.x&arch=powerpc&ver=175-2&stamp=1404609797

Build log summary:
  https://buildd.debian.org/status/package.php?p=percona-xtradb-cluster-galera-2.x&suite=sid

Mraw,
KiBi.



Information forwarded to debian-bugs-dist@lists.debian.org, Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>:
Bug#754623; Package src:percona-xtradb-cluster-galera-2.x. (Fri, 15 Aug 2014 12:03:04 GMT) (full text, mbox, link).


Acknowledgement sent to Dejan Latinovic <Dejan.Latinovic@imgtec.com>:
Extra info received and forwarded to list. Copy sent to Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>. (Fri, 15 Aug 2014 12:03:05 GMT) (full text, mbox, link).


Message #10 received at 754623@bugs.debian.org (full text, mbox, reply):

From: Dejan Latinovic <Dejan.Latinovic@imgtec.com>
To: "754623@bugs.debian.org" <754623@bugs.debian.org>
Subject: RE: Bug#754623: percona-xtradb-cluster-galera-2.x: FTBFS on many archs
Date: Fri, 15 Aug 2014 12:00:32 +0000
[Message part 1 (text/plain, inline)]
Hi,

The reason for this failure is a difference
in alignment of long long for MIPS ISA and IA32.
This results that size of gu_rse structure on mips is 24,
instead of expected 20 (on ia32).

As long long is first attribute in structure,
so it is safe to use pack(4).

> struct gu_rse
> {
>     long long   time;
>     const void* heap_ptr;
>     const void* stack_ptr;
>     long        pid;
> };


I assume that this fix could be used for other architectures like:
armel, armhf, powerpc, sparc.
I did not have a chance to test it on those architectures,
so my changes affects only mips and mipsel.



Solving this issue, fallowing error appears:

> gcs/src/gcs.c:1161: undefined reference to `__sync_fetch_and_add_8'


Mips platform does not have 64-bit __sync_* operations.
To avoid this behaviuor it is needed to use
corresponding __atomic_* from libatomic library.


Patch that solves both issues for mips/mipsel is attached.

Could you please consider including this patch?


Best Regards,
Dejan




[fix-mips.patch (text/x-patch, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>:
Bug#754623; Package src:percona-xtradb-cluster-galera-2.x. (Wed, 08 Oct 2014 09:21:08 GMT) (full text, mbox, link).


Acknowledgement sent to Aníbal Monsalve Salazar <anibal@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>. (Wed, 08 Oct 2014 09:21:08 GMT) (full text, mbox, link).


Message #15 received at 754623@bugs.debian.org (full text, mbox, reply):

From: Aníbal Monsalve Salazar <anibal@debian.org>
To: "754623@bugs.debian.org" <754623@bugs.debian.org>
Cc: Dejan Latinovic <Dejan.Latinovic@imgtec.com>
Subject: NMU defdiff for percona-xtradb-cluster-galera-2.x_175-2.1 archs
Date: Wed, 8 Oct 2014 20:17:32 +1100
debdiff percona-xtradb-cluster-galera-2.x_175-2.dsc percona-xtradb-cluster-galera-2.x_175-2.1.dsc
diff -Nru percona-xtradb-cluster-galera-2.x-175/debian/changelog percona-xtradb-cluster-galera-2.x-175/debian/changelog
--- percona-xtradb-cluster-galera-2.x-175/debian/changelog	2014-06-18 17:41:42.000000000 +0100
+++ percona-xtradb-cluster-galera-2.x-175/debian/changelog	2014-08-15 11:18:08.000000000 +0100
@@ -1,3 +1,14 @@
+percona-xtradb-cluster-galera-2.x (175-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix difference in alignment of long long for MIPS ISA and IA32.
+    Use corresponding __atomic_* from libatomic library.
+    Add fix-mips.patch.
+    Patch by Dejan Latinovic <Dejan.Latinovic@imgtec.com>.
+    Closes: #754623.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org>  Fri, 15 Aug 2014 11:18:03 +0100
+
 percona-xtradb-cluster-galera-2.x (175-2) unstable; urgency=medium
 
   * d/p/detect-atomic.patch: Add check to determine whether -latomic is required
diff -Nru percona-xtradb-cluster-galera-2.x-175/debian/patches/fix-mips.patch percona-xtradb-cluster-galera-2.x-175/debian/patches/fix-mips.patch
--- percona-xtradb-cluster-galera-2.x-175/debian/patches/fix-mips.patch	1970-01-01 01:00:00.000000000 +0100
+++ percona-xtradb-cluster-galera-2.x-175/debian/patches/fix-mips.patch	2014-08-15 11:11:22.000000000 +0100
@@ -0,0 +1,129 @@
+Date: Wed, 13 Aug 2014 16:30:32 +0100
+From: Dejan Latinovic <Dejan.Latinovic@imgtec.com>
+Subject: fix for percona-xtradb-cluster-galera-2.x
+
+package percona-xtradb-cluster-galera-2.x FTBFS for mips/mipsel with an error:
+
+> galerautils/src/gu_rand.c: In function 'gu_rand_seed_long':
+> galerautils/src/gu_mmh3.h:195:21: error: '*((void *)&rse+23)' is used uninitialized in this function [-Werror=uninitialized]
+>      case  8: k1 ^= ((uint64_t)tail[ 7]) << 56;
+
+https://buildd.debian.org/status/fetch.php?pkg=percona-xtradb-cluster-galera-2.x&arch=mipsel&ver=175-2&stamp=1403112913
+
+This problem is reported here:
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754623
+
+The reason for this failure is a difference in alignment of long long for MIPS
+ISA and IA32.  This results that size of gu_rse structure on mips is 24,
+instead of expected 20 (on ia32).
+
+As long long is first attribute in structure, so it is safe to use pack(4). 
+
+> struct gu_rse
+> {
+>     long long   time;
+>     const void* heap_ptr;
+>     const void* stack_ptr;
+>     long        pid;
+> };
+
+I assume that this fix could be used for other architectures like: armel,
+armhf, powerpc, sparc.  I did not have a chance to test it on those
+architectures, so my changes affects only mips and mipsel.
+
+Solving this issue, fallowing error appears:
+
+> gcs/src/gcs.c:1161: undefined reference to `__sync_fetch_and_add_8'
+
+Mips platform does not have 64-bit __sync_* operations.  To avoid this
+behaviuor it is needed to use corresponding __atomic_* from libatomic library.
+
+Patch that solves both issues for mips/mipsel is attached.
+
+Index: percona-xtradb-cluster-galera-2.x-175/SConstruct
+===================================================================
+--- percona-xtradb-cluster-galera-2.x-175.orig/SConstruct
++++ percona-xtradb-cluster-galera-2.x-175/SConstruct
+@@ -368,7 +368,7 @@ else:
+     print 'Not using boost'
+ 
+ # Check to see if -latomic is need for GCC atomic built-ins.
+-if conf.CheckLib(library='atomic', symbol='__sync_fetch_and_add_8'):
++if conf.CheckLib(library='atomic', symbol='__sync_fetch_and_add_8') or conf.CheckLib(library='atomic', symbol='__atomic_fetch_add_8'):
+     conf.env.Append(LIBS=['atomic'])
+ 
+ # asio
+Index: percona-xtradb-cluster-galera-2.x-175/galerautils/src/gu_atomic.h
+===================================================================
+--- percona-xtradb-cluster-galera-2.x-175.orig/galerautils/src/gu_atomic.h
++++ percona-xtradb-cluster-galera-2.x-175/galerautils/src/gu_atomic.h
+@@ -11,6 +11,8 @@
+ 
+ #ifdef __GNUC__
+ 
++#if !defined(__mips__) || defined(__mips64)
++
+ #define gu_sync_fetch_and_add  __sync_fetch_and_add
+ #define gu_sync_fetch_and_sub  __sync_fetch_and_sub
+ #define gu_sync_fetch_and_or   __sync_fetch_and_or
+@@ -26,6 +28,28 @@
+ #define gu_sync_xor_and_fetch  __sync_xor_and_fetch
+ #define gu_sync_nand_and_fetch __gu_sync_nand_and_fetch
+ 
++#else  /* __mips__ */
++
++/* Mips platform does not have 64-bit __sync_* operations.
++ * so it is needed to use corresponding __atomic_* operations from libatomic library. */
++
++#define gu_sync_fetch_and_add(value_, x)  __atomic_fetch_add(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_fetch_and_sub(value_, x)  __atomic_fetch_sub(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_fetch_and_or(value_, x)   __atomic_fetch_or(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_fetch_and_and(value_, x)  __atomic_fetch_and(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_fetch_and_xor(value_, x)  __atomic_fetch_xor(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_fetch_and_nand(value_, x) __atomic_fetch_nand(value_, x, __ATOMIC_SEQ_CST)
++
++
++#define gu_sync_add_and_fetch(value_, x)  __atomic_add_fetch(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_sub_and_fetch(value_, x)  __atomic_sub_fetch(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_or_and_fetch(value_, x)   __atomic_or_fetch(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_and_and_fetch(value_, x)  __atomic_and_fetch(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_xor_and_fetch(value_, x)  __atomic_xor_fetch(value_, x, __ATOMIC_SEQ_CST)
++#define gu_sync_nand_and_fetch(value_, x) __atomic_nand_fetch(value_, x, __ATOMIC_SEQ_CST)
++
++#endif
++
+ #else /* __GNUC__ */
+ #error "Compiler not supported"
+ #endif
+Index: percona-xtradb-cluster-galera-2.x-175/galerautils/src/gu_rand.c
+===================================================================
+--- percona-xtradb-cluster-galera-2.x-175.orig/galerautils/src/gu_rand.c
++++ percona-xtradb-cluster-galera-2.x-175/galerautils/src/gu_rand.c
+@@ -16,6 +16,16 @@
+ 
+ /*! Structure to hold entropy data.
+  *  Should be at least 20 bytes on 32-bit systems and 28 bytes on 64-bit */
++
++/*  Unlike ia32, aligment of long long for MIPS ISA is 8, and size of gu_rse is 24.
++ *  As "long long" atribute is first in gu_rse structure there is no harm in use pack(4) to avoid
++ *  undexpected behavior while using gu_rse structure. */
++
++#if defined(__mips__) && !defined(__mips64__)
++#pragma pack(push)
++#pragma pack(4)
++#endif
++
+ struct gu_rse
+ {
+     long long   time;
+@@ -24,6 +34,10 @@ struct gu_rse
+     long        pid;
+ };
+ 
++#if defined(__mips__) && !defined(__mips64__)
++#pragma pack(pop)
++#endif
++
+ typedef struct gu_rse gu_rse_t;
+ 
+ long int
diff -Nru percona-xtradb-cluster-galera-2.x-175/debian/patches/series percona-xtradb-cluster-galera-2.x-175/debian/patches/series
--- percona-xtradb-cluster-galera-2.x-175/debian/patches/series	2014-06-18 17:17:46.000000000 +0100
+++ percona-xtradb-cluster-galera-2.x-175/debian/patches/series	2014-08-15 11:10:54.000000000 +0100
@@ -1 +1,2 @@
 detect-atomic.patch
+fix-mips.patch



Reply sent to Anibal Monsalve Salazar <anibal@debian.org>:
You have taken responsibility. (Wed, 08 Oct 2014 09:27:14 GMT) (full text, mbox, link).


Notification sent to Cyril Brulebois <kibi@debian.org>:
Bug acknowledged by developer. (Wed, 08 Oct 2014 09:27:14 GMT) (full text, mbox, link).


Message #20 received at 754623-close@bugs.debian.org (full text, mbox, reply):

From: Anibal Monsalve Salazar <anibal@debian.org>
To: 754623-close@bugs.debian.org
Subject: Bug#754623: fixed in percona-xtradb-cluster-galera-2.x 175-2.1
Date: Wed, 08 Oct 2014 09:23:54 +0000
Source: percona-xtradb-cluster-galera-2.x
Source-Version: 175-2.1

We believe that the bug you reported is fixed in the latest version of
percona-xtradb-cluster-galera-2.x, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 754623@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Anibal Monsalve Salazar <anibal@debian.org> (supplier of updated percona-xtradb-cluster-galera-2.x package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 15 Aug 2014 11:18:03 +0100
Source: percona-xtradb-cluster-galera-2.x
Binary: percona-xtradb-cluster-galera-2.x
Architecture: source mips
Version: 175-2.1
Distribution: unstable
Urgency: medium
Maintainer: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
Changed-By: Anibal Monsalve Salazar <anibal@debian.org>
Description:
 percona-xtradb-cluster-galera-2.x - Synchronous multi-master replication plugin for transactional app
Closes: 754623
Changes:
 percona-xtradb-cluster-galera-2.x (175-2.1) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Fix difference in alignment of long long for MIPS ISA and IA32.
     Use corresponding __atomic_* from libatomic library.
     Add fix-mips.patch.
     Patch by Dejan Latinovic <Dejan.Latinovic@imgtec.com>.
     Closes: #754623.
Checksums-Sha1:
 125359f7d406f5e43f1ae1fa3df818bb625ad9bd 2290 percona-xtradb-cluster-galera-2.x_175-2.1.dsc
 32b387221290ff446948f9f4b3b3a27578c2177a 5136 percona-xtradb-cluster-galera-2.x_175-2.1.debian.tar.xz
 9fa21dcd419d669bfd1669481caef1df70bfc4f9 820478 percona-xtradb-cluster-galera-2.x_175-2.1_mips.deb
Checksums-Sha256:
 e01507455d290a245de59c1bf48307a7f8ef1ca832ba8a70ecef8ebc8eea45e1 2290 percona-xtradb-cluster-galera-2.x_175-2.1.dsc
 8718acc3a864dadb8749cd16621a8396b50628bffff78fc95e1e605222878330 5136 percona-xtradb-cluster-galera-2.x_175-2.1.debian.tar.xz
 96b74286ff8876d594c1209e9ca61d6aa5ba00fcea01c4a81458a555521303d6 820478 percona-xtradb-cluster-galera-2.x_175-2.1_mips.deb
Files:
 6e6bf05624f894c81827acbf38d011a0 2290 database extra percona-xtradb-cluster-galera-2.x_175-2.1.dsc
 6897ae1b09235b568a7548f3633ae55d 5136 database extra percona-xtradb-cluster-galera-2.x_175-2.1.debian.tar.xz
 ffd017007e573227c792b55b1d493e27 820478 database extra percona-xtradb-cluster-galera-2.x_175-2.1_mips.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJUNQAzAAoJEHxWrP6UeJfYN4UP/1p5m1Pk/v7BfqP2Ayt4VHVj
aSZx/M5kDAZaOzHYA+TEXYW/OwUk+turDd3pysOczmWYalc002kTSA+J0E2tFJ7f
ArlR/CItM0RLMrWkhGsLPAP0qm6/ScCoDGphUWY8bOgaMWXNJYbRCwUKfleb4obR
u5tJEDmm0O3/OykRGBINyK5L8Yq3ECq47T5uAMZagIV4Wo8xymJswyADqZM2s8tn
H1uuTXA9H9Rs6fIsrU56+w7xBIotEliGS6FRBUvgt+DFxUzwJs6ubkirybs9+hcz
kpVRkGfgZYLA+lAeVAPutMecYG0nywqz2w4DK7QluTxKRTp9exCPhpQLbG+9gN3M
WQBDVldPe7yfN3Aj+1afscN9dMOlTUElhl0cmWxnx6V0VYQQ8r/6HG+b/atemYPo
eWwkCf3C54i5+s3a1hb2biFvGQgdgZTt1Mh2heaY9AUgg/EIcna6Yu58XdXNr8X4
3AFu9GoJCHehgfNg7U/luACryASfy4M1gzzgDUCIIFVIWoRcfCHbhEoUBNNG+8J2
h5+75yjicqTcNYg6/r14ZGmpNi7MR+Cc5RT9v+CGVVsSy1gy95RHCyYHNKAp+MkL
T2lRIDZCNCdncIJJju8AUo3s6ijNJ5i/IJdjBUbvoyNZdpBChgwXzSc7Uv9JLZkC
qiKAnh9Qv+2mwRUI7cfz
=eE74
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 06 Nov 2014 07:29:02 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Oct 7 02:49:17 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.