[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#769647: unblock: firebird2.5/firebird2.5_2.5.3.26778.ds4-4



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package firebird2.5

Version 2.5.3.26778.ds4-4 has a fix for #769161 which would cause data 
corruption when transferring data between the client and the server 
when one is on ppc64el and the other is not.

The reason for the bug is that ppc64el is mis-detected as powerpc in 
the configure script. Since firebird entangles endianness information 
with so called "Implementation ID", having an implementation ID 
associated with wrong endianness would cause either wrong or missing 
conversion between native and network byte-order.

The evidence of architecture misdetection can be found int he build 
log of version 2.5.3.26778.ds4-3[1] (look for "access method"):

  Firebird/linux PowerPC (access method), version "LI-V2.5.3.26778 
  Firebird 2.5".

In contrast, -4 build log[2] on ppc64el has

  Firebird/linux PPC64EL (access method), version "LI-V2.5.3.26778 
  Firebird 2.5"

[1] https://buildd.debian.org/status/fetch.php?pkg=firebird2.5&arch=ppc64el&ver=2.5.3.26778.ds4-3+b1&stamp=1415464014
[2] https://buildd.debian.org/status/fetch.php?pkg=firebird2.5&arch=ppc64el&ver=2.5.3.26778.ds4-4&stamp=1416001679


========= Patch description ============
add implementation ID for ppc64el architecture

Without this, binaries built on ppc64el use the implementation ID of powerpc,
which is big-endian, while ppc64el is little-endian. Wrong information about
endianness will cause data corruption when transferring big integers and
doubles over the network between ppc64el and other architectures.

The patch is taken from revisions 60194-60204 of upstream's B2_5_Release
branch with the following modifications:
 + the part that enables arm64 is omitted, since we already have a separate
   patch for that, upstream/r58859-arm64.patch
 + some white-space changes are trimmed so that the patch is to the point
Bug-Debian: https://bugs.debian.org/769161
Origin: upstream; https://anonscm.debian.org/cgit/pkg-firebird/upstream.git/log/?h=B2_5_Release
========================================

The full patch text is available at 
https://anonscm.debian.org/cgit/pkg-firebird/2.5.git/tree/debian/patches/upstream/r60194-60204-ppcel.patch

Debdiff attached.

I have built the package with that patch on pastel (ppc64el porter 
box) and amd64. It built fine, and this alone gives me enough 
confidence that there's no unexpected breakage, since the engine is 
used as a part of the build process.

It is also green[3] on all buildds.

 [3] https://buildd.debian.org/status/package.php?p=firebird2.5

unblock firebird2.5/firebird2.5_2.5.3.26778.ds4-4


Thanks,
    dam

-- System Information:
Debian Release: jessie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru firebird2.5-2.5.3.26778.ds4/debian/changelog firebird2.5-2.5.3.26778.ds4/debian/changelog
--- firebird2.5-2.5.3.26778.ds4/debian/changelog	2014-11-02 00:28:56.000000000 +0200
+++ firebird2.5-2.5.3.26778.ds4/debian/changelog	2014-11-14 23:09:51.000000000 +0200
@@ -1,3 +1,13 @@
+firebird2.5 (2.5.3.26778.ds4-4) unstable; urgency=medium
+
+  * add patch from upstream adding proper support for ppc64el
+    Avoids misreporting endianness on ppc64el, which would break transmitting
+    data between ppc64el and other architectures.
+    Thanks to marius popa for reporting and upstream implementation.
+    Closes: #769161
+
+ -- Damyan Ivanov <dmn@debian.org>  Fri, 14 Nov 2014 21:02:54 +0000
+
 firebird2.5 (2.5.3.26778.ds4-3) unstable; urgency=medium
 
   * add patch tightening fb_guard lock file permissions (Closes: #767497)
diff -Nru firebird2.5-2.5.3.26778.ds4/debian/patches/series firebird2.5-2.5.3.26778.ds4/debian/patches/series
--- firebird2.5-2.5.3.26778.ds4/debian/patches/series	2014-11-01 22:53:09.000000000 +0200
+++ firebird2.5-2.5.3.26778.ds4/debian/patches/series	2014-11-13 23:09:33.000000000 +0200
@@ -13,3 +13,4 @@
 #ignore-collation-version.patch
 out/spelling.patch
 out/fb_guard-lock-permissions.patch
+upstream/r60194-60204-ppcel.patch
diff -Nru firebird2.5-2.5.3.26778.ds4/debian/patches/upstream/r60194-60204-ppcel.patch firebird2.5-2.5.3.26778.ds4/debian/patches/upstream/r60194-60204-ppcel.patch
--- firebird2.5-2.5.3.26778.ds4/debian/patches/upstream/r60194-60204-ppcel.patch	1970-01-01 02:00:00.000000000 +0200
+++ firebird2.5-2.5.3.26778.ds4/debian/patches/upstream/r60194-60204-ppcel.patch	2014-11-13 23:54:29.000000000 +0200
@@ -0,0 +1,142 @@
+Description: add implementation ID for ppc64el architecture
+ Without this, binaries built on ppc64el use the implementation ID of powerpc,
+ which is big-endian, while ppc64el is little-endian. Wrong information about
+ endianness will cause data corruption when transferring big integers and
+ doubles over the network between ppc64el and other architectures.
+ .
+ The patch is taken from revisions 60194-60204 of upstream's B2_5_Release
+ branch with the following modifications:
+  + the part that enables arm64 is omitted, since we already have a separate
+    patch for that, upstream/r58859-arm64.patch
+  + some white-space changes are trimmed so that the patch is to the point
+Bug-Debian: https://bugs.debian.org/769161
+Origin: upstream; https://anonscm.debian.org/cgit/pkg-firebird/upstream.git/log/?h=B2_5_Release
+
+--- a/configure.in
++++ b/configure.in
+@@ -242,6 +242,17 @@ dnl CPU_TYPE=ppc64
+     ATOMIC_LIBS=-latomic_ops
+     ;;
+ 
++  powerpc64le-*-linux*)
++    MAKEFILE_PREFIX=linux_powerpc64el
++    INSTALL_PREFIX=linux
++    PLATFORM=LINUX
++    AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
++    EDITLINE_FLG=Y
++    SHRLIB_EXT=so
++    STD_EDITLINE=true
++    STD_ICU=true
++    ;;
++
+   sparc*-*-linux* | sparc*-*-gnu* | sparc*-*-k*bsd*-gnu)
+     MAKEFILE_PREFIX=linux_sparc32
+     INSTALL_PREFIX=linux
+--- /dev/null
++++ b/builds/posix/prefix.linux_powerpc64el
+@@ -0,0 +1,35 @@
++# The contents of this file are subject to the Interbase Public
++# License Version 1.0 (the "License"); you may not use this file
++# except in compliance with the License. You may obtain a copy
++# of the License at http://www.firebirdsql.org/en/interbase-public-license/
++#
++# Software distributed under the License is distributed on an
++# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
++# or implied. See the License for the specific language governing
++# rights and limitations under the License.
++#
++# The Original Code was created by Inprise Corporation
++# and its predecessors. Portions created by Inprise Corporation are
++# Copyright (C) Inprise Corporation.
++#
++# All Rights Reserved.
++# Contributor(s): ______________________________________.
++# Start of file prefix.linux:  $(VERSION)  $(PLATFORM)
++#      14 Apr 2008     Alan Barclay    alan AT escribe.co.uk
++
++
++#LD=@CXX@
++
++#PROD_FLAGS=-ggdb -O3 -fno-omit-frame-pointer -DLINUX -pipe -MMD -fPIC
++#DEV_FLAGS=-ggdb -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -p -fPIC -Wall -Wno-switch
++
++PROD_FLAGS=-O3 -DLINUX -DPPC64EL -pipe -p -MMD -fPIC -fsigned-char -fmessage-length=0
++DEV_FLAGS=-ggdb -DLINUX -DPPC64EL -pipe -p -MMD -fPIC -Wall -fsigned-char -fmessage-length=0 -Wno-non-virtual-dtor
++
++OS_ServerFiles=inet_server.cpp
++
++EMBED_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
++CLIENT_UTIL_TARGETS=gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr fbtracemgr
++
++Physical_IO_Module=os/posix/unix.cpp
++
+--- a/src/jrd/inf_pub.h
++++ b/src/jrd/inf_pub.h
+@@ -216,6 +216,7 @@ enum  info_db_implementations
+ 	isc_info_db_impl_linux_hppa = 82,
+ 	isc_info_db_impl_linux_alpha = 83,
+ 	isc_info_db_impl_linux_arm64 = 84,
++	isc_info_db_impl_linux_ppc64el = 85,
+ 
+ 	isc_info_db_impl_last_value   // Leave this LAST!
+ };
+--- a/src/jrd/common.h
++++ b/src/jrd/common.h
+@@ -196,6 +196,10 @@
+ #define IMPLEMENTATION  isc_info_db_impl_linux_arm64	/* 84  */
+ #endif /* ARM64 */
+ 
++#ifdef PPC64EL
++#define IMPLEMENTATION  isc_info_db_impl_linux_ppc64el	/* 85  */
++#endif /* PPC64EL */
++
+ #endif /* LINUX */
+ 
+ 
+--- a/src/jrd/pag.cpp
++++ b/src/jrd/pag.cpp
+@@ -164,9 +164,10 @@ static const int CLASS_LINUX_SHEB = 39;
+ static const int CLASS_LINUX_HPPA = 40;		// LINUX/HPPA
+ static const int CLASS_LINUX_ALPHA = 41;	// LINUX/ALPHA
+ static const int CLASS_LINUX_ARM64 = 42;	// LINUX/ARM64
++static const int CLASS_LINUX_PPC64EL = 43;	// LINUX/PowerPc64EL
+ 
+ static const int CLASS_MAX10 = CLASS_LINUX_AMD64;	// This should not be changed, no new ports with ODS10
+-static const int CLASS_MAX = CLASS_LINUX_ARM64;
++static const int CLASS_MAX = CLASS_LINUX_PPC64EL;
+ 
+ // ARCHITECTURE COMPATIBILITY CLASSES
+ 
+@@ -266,7 +267,9 @@ static const ArchitectureType archMatrix
+ 	archBigEndian,    // CLASS_LINUX_SHEB
+ 	archBigEndian,    // CLASS_LINUX_HPPA
+ 	archLittleEndian, // CLASS_LINUX_ALPHA
+-	archLittleEndian  // CLASS_LINUX_ARM64
++	archLittleEndian, // CLASS_LINUX_ARM64
++	archLittleEndian  // CLASS_LINUX_PPC64EL
++
+ };
+ 
+ #ifdef __sun
+@@ -332,6 +335,8 @@ const SSHORT CLASS		= CLASS_LINUX_HPPA;
+ const SSHORT CLASS		= CLASS_LINUX_ALPHA;
+ #elif defined(ARM64)
+ const SSHORT CLASS		= CLASS_LINUX_ARM64;
++#elif defined(PPC64EL)
++const SSHORT CLASS		= CLASS_LINUX_PPC64EL;
+ #else
+ #error no support on other hardware for Linux
+ #endif
+--- a/src/jrd/utl.cpp
++++ b/src/jrd/utl.cpp
+@@ -228,7 +228,9 @@ static const TEXT* const impl_implementa
+ 	"Firebird/linux SHEB",			// 81
+ 	"Firebird/linux HPPA",			// 82
+ 	"Firebird/linux ALPHA",			// 83
+-	"Firebird/linux ARM64"			// 84
++	"Firebird/linux ARM64",			// 84
++	"Firebird/linux PPC64EL"		// 85
++
+ };
+ 
+ 

Reply to: