Package: python-dmidecode
Version: 3.12.2-3
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu artful ubuntu-patch

Hi Sandro,

On ARM, unaligned memory access is not guaranteed to succeed; depending on
the CPU and the kernel configuration, it may raise SIGBUS instead.

python-dmidecode defaults to using unaligned access, which causes it to fail
to build on the Ubuntu autobuilders which do raise SIGBUS.  Since
python-dmidecode does have a fallback code path for avoiding unaligned
access, I've applied the attached patch in Ubuntu to cause it to use this
instead on ARM.

Please consider applying this in Debian as well, where it may affect some
number of users even if it doesn't trigger on the Debian buildds.  Since
python-dmidecode is not a performance-sensitive library, I think there's a
strong argument for preferring portability here over performance.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru python-dmidecode-3.12.2/debian/patches/no-arm-unaligned-access 
python-dmidecode-3.12.2/debian/patches/no-arm-unaligned-access
--- python-dmidecode-3.12.2/debian/patches/no-arm-unaligned-access      
1969-12-31 16:00:00.000000000 -0800
+++ python-dmidecode-3.12.2/debian/patches/no-arm-unaligned-access      
2017-06-17 21:34:43.000000000 -0700
@@ -0,0 +1,17 @@
+Description: Don't use unaligned access on ARM
+ Depending on CPU and kernel config, unaligned access may raise SIGBUS on
+ ARM.  Use the slower, but safe, implementation instead.
+Author: Steve Langasek <steve.langa...@ubuntu.com>
+Last-Update: 2017-06-18
+
+--- python-dmidecode-3.12.2.orig/src/config.h
++++ python-dmidecode-3.12.2/src/config.h
+@@ -53,7 +53,7 @@
+ #endif
+ 
+ /* Use memory alignment workaround or not */
+-#ifdef __ia64__
++#if defined(__ia64__) || defined(__arm__)
+ #define ALIGNMENT_WORKAROUND
+ #endif
+ 
diff -Nru python-dmidecode-3.12.2/debian/patches/series 
python-dmidecode-3.12.2/debian/patches/series
--- python-dmidecode-3.12.2/debian/patches/series       2017-01-08 
09:36:23.000000000 -0800
+++ python-dmidecode-3.12.2/debian/patches/series       2017-06-17 
21:33:24.000000000 -0700
@@ -1 +1,2 @@
 tests_inject_correct_build_dir.patch
+no-arm-unaligned-access

Reply via email to