Source: c-blosc
Version: 1.14.0+ds1-1
Severity: important
Tags: patch

Hi Daniel,

After your update of the package to 1.14.0 (thanks for being so quick!),
it was synced to Ubuntu's bionic-proposed, where it failed building on
armhf due to an alignment bug.

The bug only manifested itself in the Ubuntu build, because of the way
they have their ARM building infrastructure set up (ARMv7 chroot on
ARMv8 hardware).

The bug was quickly fixed [1] upstream, and mwhudson @ #ubuntu-release
kindly verified [2] the fix on his Ubuntu porter box.

Attached is a debdiff that adds the upstream patch to the package.

Sorry for the trouble, but would be great if a new version could be
released.

Thanks in advance,
Elvis

[1] 
https://github.com/Blosc/c-blosc/commit/8a84d51487eed81431b0fa488805a62c2d8f0163
[2] https://github.com/Blosc/c-blosc/issues/223#issuecomment-373320351

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.13.0-36-generic (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968), LANGUAGE=C 
(charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect
diff -Nru c-blosc-1.14.0+ds1/debian/changelog 
c-blosc-1.14.0+ds1/debian/changelog
--- c-blosc-1.14.0+ds1/debian/changelog 2018-03-12 17:01:18.000000000 +0000
+++ c-blosc-1.14.0+ds1/debian/changelog 2018-03-15 10:26:45.000000000 +0000
@@ -1,3 +1,9 @@
+c-blosc (1.14.0+ds1-1.1) UNRELEASED; urgency=medium
+
+  * Add fix-unaligned-access.patch.
+
+ -- Elvis Stansvik <elvst...@gmail.com>  Thu, 15 Mar 2018 10:26:45 +0000
+
 c-blosc (1.14.0+ds1-1) unstable; urgency=medium
 
   * New upstream release:
diff -Nru c-blosc-1.14.0+ds1/debian/patches/fix-unaligned-access.patch 
c-blosc-1.14.0+ds1/debian/patches/fix-unaligned-access.patch
--- c-blosc-1.14.0+ds1/debian/patches/fix-unaligned-access.patch        
1970-01-01 00:00:00.000000000 +0000
+++ c-blosc-1.14.0+ds1/debian/patches/fix-unaligned-access.patch        
2018-03-15 10:26:45.000000000 +0000
@@ -0,0 +1,38 @@
+From 8a84d51487eed81431b0fa488805a62c2d8f0163 Mon Sep 17 00:00:00 2001
+From: Francesc Alted <fal...@gmail.com>
+Date: Thu, 15 Mar 2018 09:32:34 +0000
+Subject: [PATCH] [FIX] Do not use unaligned access when copying.  Fixes #223.
+
+---
+ blosc/fastcopy.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/blosc/fastcopy.c b/blosc/fastcopy.c
+index 3c933b2..8e1b0d8 100644
+--- a/blosc/fastcopy.c
++++ b/blosc/fastcopy.c
+@@ -64,9 +64,13 @@ static inline unsigned char *copy_7_bytes(unsigned char 
*out, const unsigned cha
+ }
+ 
+ static inline unsigned char *copy_8_bytes(unsigned char *out, const unsigned 
char *from) {
++#if defined(BLOSC_STRICT_ALIGN)
+   uint64_t chunk;
+   memcpy(&chunk, from, 8);
+   memcpy(out, &chunk, 8);
++#else
++  *(uint64_t *) out = *(uint64_t *) from;
++#endif
+   return out + 8;
+ }
+ 
+@@ -449,9 +453,7 @@ unsigned char *fastcopy(unsigned char *out, const unsigned 
char *from, unsigned
+     case 16:
+       return copy_16_bytes(out, from);
+     case 8:
+-      *(uint64_t *) out = *(uint64_t *) from;
+-      out += 8;
+-      return out;
++      return copy_8_bytes(out, from);
+     default: {
+     }
+   }
diff -Nru c-blosc-1.14.0+ds1/debian/patches/series 
c-blosc-1.14.0+ds1/debian/patches/series
--- c-blosc-1.14.0+ds1/debian/patches/series    2018-03-12 16:14:26.000000000 
+0000
+++ c-blosc-1.14.0+ds1/debian/patches/series    2018-03-15 10:26:45.000000000 
+0000
@@ -0,0 +1 @@
+fix-unaligned-access.patch

Reply via email to