[Python-modules-team] Bug#917652: pywavelets 0.5.1-1.1: FTBFS, alignment problem
Steve McIntyre
steve at einval.com
Sat Dec 29 19:23:33 GMT 2018
Source: pywavelets
Version: 0.5.1-1.1
Severity: important
User: debian-arm at lists.debian.org
Usertags: alignment
Hi!
I've been doing a full rebuild of the Debian archive, building all
source packages targeting armel and armhf using arm64 hardware. We are
planning in future to move all of our 32-bit armel/armhf builds to
using arm64 machines, so this rebuild is to identify packages that
might have problems with this configuration.
A feature of the arm64 kernel is that it does *not* support fixing up
code with broken alignment, so code that might have built and run OK
on our older armel/armhf build machines due to kernel fixups will now
fail.
When building your package, I've found a bus error (aka alignment
fault). The full log is online at
https://www.einval.com/debian/arm/rebuild-logs/armel/FAIL/pywavelets_0.5.1-1.1_armel.log
for reference
I've done a quick bit of debugging to find the source of the
bug. Here's a gdb stacktrace and variable printout to demonstrate the
problem.
(sid-armel)steve at maul:~/debian/build/pywavelets/pywavelets-0.5.1$ gdb /usr/bin/python2.7 core
...
Reading symbols from /usr/bin/python2.7...(no debugging symbols found)...done.
[New LWP 3291]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabi/libthread_db.so.1".
Core was generated by `python2.7 -c import sys ; sys.path.insert(0, '/home/steve/debian/build/pywavele'.
Program terminated with signal SIGBUS, Bus error.
#0 double_downcoef_axis (input=0x1011b90, input_info=..., output=0xfe4500, output_info=..., wavelet=0x1161b78, axis=0, coef=COEF_APPROX, dwt_mode=MODE_SYMMETRIC, swt_level=0,
transform=DWT_TRANSFORM) at pywt/_extensions/c/wt.template.c:100
100 temp_input[j] = *(TYPE *)(((char *) input) + input_offset
(gdb) list
95
96 // Copy to temporary input if necessary
97 if (make_temp_input)
98 for (j = 0; j < input_info.shape[axis]; ++j)
99 // Offsets are byte offsets, to need to cast to char and back
100 temp_input[j] = *(TYPE *)(((char *) input) + input_offset
101 + j * input_info.strides[axis]);
102
103 // Select temporary or direct output and input
104 input_row = make_temp_input ? temp_input
(gdb) p input
$1 = (const double * const restrict) 0x1011b90
(gdb) p input_offset
$2 = <optimized out>
(gdb) p j
$3 = <optimized out>
This is a classic pattern for alignment problems. You can't just cast
things like this and expect them to work safely.
-- System Information:
Debian Release: 9.6
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.9.0-8-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
More information about the Python-modules-team
mailing list