[Pkg-bluetooth-maintainers] Bug#856487: libsbc1: compiling with gcc > 4.9 causes stack corruption
Nobuhiro Iwamatsu
iwamatsu at nigauri.org
Mon May 8 04:38:22 UTC 2017
Hi, all.
Thanks for your comments.
>On Mon, Apr 17, 2017 at 05:02:32PM +0100, Paul Brook wrote:
>> Package: libsbc1
>> Version: 1.3-1+b2
>> Followup-For: Bug #856487
>>
>> Not a stack corruption.
>>
>> This is miscompilation of sbc_analyze_4b_8s_armv6. gcc appears to look
>> into the asm function and decides that it does not clobber r3 (which the
>> normal ARM ABI says is call clobbered). The last out += out_stride ends
>> up incrementing the pointer by an arbitrary amount.
>>
>> The attached patch works around the bug.
>
>Unfortunately this is not correct since extended asm is not allowed in
>naked functions.
>
>Short-term I'd suggest to use the attached patch, that disables the
>ARMv6 asm implementation and uses the C implementation instead.
>
>> I'm not entirely sure whether this is a gcc bug or not, but at best it's
>> surprising behavior from gcc. I've attached a reduced testcase for the toolchain
>> folks to argue over (compile with gcc -O2, tested with gcc 6.3.0-2 from
>> sid).
>
>This is either a bug in gcc or insufficient documentation in gcc.
>
I see.
I will fix using --enable-high-precision of configure option.
>Could you (or did you already) submit that to the gcc bugzilla?
OK, I will report this to GCC.
>
>> Paul
>>...
>
>Thanks
>Adrian
Best regards,
Nobuhiro
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
More information about the Pkg-bluetooth-maintainers
mailing list