Source: nanomsg
Version: 1.1.5+dfsg-1
Severity: important
User: debian-...@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/nanomsg_1.1.5+dfsg-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@mjolnir:~/debian/build/nanomsg/nanomsg-1.1.5+dfsg$ gdb 
obj-arm-linux-gnueabi/ws_async_shutdown obj-arm-linux-gnueabi/core 

...

warning: core file may not match specified executable file.
[New LWP 5270]
[New LWP 5271]
[New LWP 5268]
[New LWP 5277]
[New LWP 5275]
[New LWP 5278]
[New LWP 5269]
[New LWP 5272]
[New LWP 5273]
[New LWP 5276]
[New LWP 5274]
[New LWP 5279]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabi/libthread_db.so.1".
Core was generated by 
`/home/steve/debian/build/nanomsg/nanomsg-1.1.5+dfsg/obj-arm-linux-gnueabi/ws_as'.
Program terminated with signal SIGBUS, Bus error.
#0  0xf7d14b58 in nn_sws_recv (self=0x17ed380, msg=0x0) at 
./src/transports/ws/sws.c:573
573         cmsg->cmsg_level = NN_WS;
[Current thread is 1 (Thread 0xf7316460 (LWP 5270))]
(gdb) p cmsg
$1 = (struct nn_cmsghdr *) 0xf7315d9d
(gdb) p *cmsg
$2 = {cmsg_len = 0, cmsg_level = 0, cmsg_type = 0}
(gdb) p cmsg->smsg_level
There is no member named smsg_level.
(gdb) p cmsg->cmsg_level
$3 = 0
(gdb) p &cmsg->cmsg_level
$4 = (int *) 0xf7315da1

The definition of nn_cmsghdr:

struct nn_cmsghdr {
    size_t cmsg_len;
    int cmsg_level;
    int cmsg_type;
};

says that cmsg_level is an int, but the structure here is not aligned
appropriately.

-- 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)

Reply via email to