[FFmpeg-devel] [PATCH] fix h264_deblock_sse2.asm segfaults on clang/x86-32

Ronald S. Bultje rsbultje
Wed Sep 1 13:43:29 CEST 2010


Hi,

On Wed, Sep 1, 2010 at 3:44 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Ronald S. Bultje <rsbultje <at> gmail.com> writes:
>> on fate/clang/freebsd/x86-32 [1], all h264 tests fail with a sigbus.
>> There's some alignment issues in the sse2 asm. The asm appears to
>> assume that the caller function guarantees a certain alignment, which
>> is (IMO) not necessarily true. If the function is called directly from
>> C, stack can have any alignment, depending on the compiler used, so
>> the functions shouldn't assume any specific alignment imo.
>
> Did you look at line 3062 in x86/dsputil_mmx.c (__ICC > 1110) for the time you
> are trying to fix it?

That's not a fix, the patch should be reverted and the actual bug
fixed. gstreamer used to "fix" random pieces of inline assembly in
"gst-ffmpeg" that didn't compile with -fPIC/-DPIC like this, it's
completely unacceptable.

We can optimize the code for compilers that do realign the way we want
if people prefer that. That's a compile-time option, not a runtime
option, of course, and needs some small #ifdef magic and probably a
config.asm, as Alexander Strange suggested earlier in the thread.

I can also look into -mllvm -stack-alignment=16, but that'll have to
wait for tomorrow probably.

Ronald



More information about the ffmpeg-devel mailing list