[MPlayer-users] Fresh svn mplayer crashes on many ac3 streams

Vladimir Mosgalin mosgalin at VM10124.spb.edu
Sat May 28 20:46:34 CEST 2011


Hi Ivan Kalvachev!

 On 2011.05.28 at 20:51:34 +0300, Ivan Kalvachev wrote next:

> This is amazing because [i][0] in the above line seems to be OK.
> 
> The -O3/2 is clear sign of misscompilation. It may not be gcc bug, if
> the code in question is having some issue e.g. aliasing. It should
> produce warning in that case.
> (It would be useful the list of warning only for the ac3dec.c file)
> 
> However the code looks quite straight forward, without any hacks or abuses.
> 
> 
> Anyway, If you are eager for a further debugging you can try to following ideas:
> 
> 1. Test the cflag option -fno-tree-vectorize . FFmpeg have it by default.
> Other possibly interesting flags -mno-sse -mno-mmx -mno-avx (if there
> is such option).
> Try to find if changing the -march to a older model fixes it at some point.
> (i7-avx is quite cutting edge :)

Thanks for good guide, Ivan; I was able to narrow the problem with this
very fast.
In short, for ac3dec.c:
-march=corei7-avx -O3 - crashes
-march=corei7-avx -O3 -fno-tree-vectorize  - works fine
-march=corei7-avx -O2 -ftree-vectorize - crashes
-march=corei7 -O3 - works (or any other optimization flags)

I recompiled only ac3dec.o in these tests, rest of mplayer was compiled
with -march=corei7-avx -O3 all the time, it didn't make a difference.

So, some problem arises only when compiling ac3dec.o with both avx and
-ftree-vectorize turned on.


The thing is, you see, this is default mode; on sandy bridge systems
"-march=native" with gcc 4.6 or higher turns on avx so default options
"-march=native -O4" cause the crash. If it's hard to find and fix real
problem in ac3dec, maybe current mplayer build flags should be tweaked a
bit?


> 2. valgrind. If the segfault is result of earlier memory corruption
> this is the program that is likely to find it out. (avx may not be
> supported):
> Recommended options:
> 
> --log-file=error.log --undef-value-errors=no
> 
> (the last option is to silence many xlib/xcb related warnings that
> always pop-up).

Out of question, I guess; valgrind hates avx and crashes with illegal
instruction, saying it's not supported.


Anyhow, what now?

I can attach -S assembler output from ac3dec.c with -ftree-vectorize and
without one, for example. Or with avx and without..


-- 

Vladimir


More information about the MPlayer-users mailing list