Bug#721617: [liblo] Bug#721617: pyliblo: FTBFS on sparc: testSendOthers (unit.ServerTestCase) ... Bus error (core dumped)

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Wed Jun 1 22:19:03 UTC 2016


On 06/02/2016 12:01 AM, Stephen Sinclair wrote:
> That's a good attitude, currently I don't know anyone using sparc64
> with liblo nor do I have access to such a machine, so reproducing and
> testing, and therefore fixing, this bug is not possible for me.  So, I
> look forward to your contribution.

We have a large machine available on which I can create an account for
you if you want to look at the problem yourself. It runs Debian unstable
with a current kernel and toolchain.

If you're interested, send me a private email with your public SSH key
and sign the mail with your GPG key if possible.

>> Which is absolutely not specific to SPARC. The moment you are recasting
>> a pointer that way, you are leaving the territory of the C99 specification
>> which explicitly states that declarations which refer to the same object must
>> have compatible types, otherwise the behavior is undefined (C99, 6.2.7/2) [1].
> 
> It is a good point.  If you have some examples where this fails it
> would be a good contribution to our unit testing.  (testlo.c)
> 
> At the moment no one has actually complained about this bug, and
> therefore I can only assume it has not actually been encountered and
> remains an entirely theoretical bug, but I do welcome ideas for how to
> fix it nonetheless, because compatibility with future architectures is
> certainly a desirable goal.

The problem is that this violates strict aliasing and can lead to
unpredictable results. I don't know enough about liblo though
to understand the ramifications without looking at the code.

>> The code in question is therefore buggy and has to be fixed anyway as there
>> is otherwise no guarantee it will work on future architectures or compilers.
>>
>> I'll have a look at this issue, it's a common programming mistake.
> 
> Unfortunately one that seems to be baked into the liblo API, but
> perhaps there is a way to fix it without sacrificing efficiency, at
> least on unaffected architectures.

Well, you can do these casts, but when you copy data, you must actually
use memcpy instead of a direct assignment. Then the compiler will
automatically take care of the proper alignment.

To fix those issues, it's normally enough to build with debug symbols
enabled, run gdb over it and the corresponding assignment will show
in the backtrace. Replacing the assignment with memcpy then fixes
the issue. I just recently did that for systemd [1].

Adrian

> [1] https://github.com/systemd/systemd/pull/3360

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



More information about the pkg-multimedia-maintainers mailing list