[MPlayer-dev-eng] segv in swscaler YV12->YUY2 with SIMD on x86_64

Jason Tackaberry tack at urandom.ca
Sun Apr 16 18:13:18 CEST 2006


Hi Michael,

On Sun, 2006-04-16 at 09:54 +0200, Michael Niedermayer wrote:
> no linenumbers, no disassembly, read:

Sorry about that.  My email was sent hastily; I should know better.

See the attached file.  Note this is cvs from 2006-04-15, although
postproc/ is from a few minutes ago.  At a glance, something looks
pretty wonky with the stride values that are being passed to
swScale_MMX2().

vf_greedyh is a filter I'm working on, but it is not the cause of the
crash.  Currently everything is commented out in the filter and it does
nothing but pass frames.  If I change query_format() to support YV12
instead of YUY2 then there's no crash, so it does seem to be a bug in
YV12->YUY2 conversion.

Cheers,
Jason.
-------------- next part --------------
(gdb) run something.avi -vf greedyh -vo null -ao null
Starting program: src/main/mplayer something.avi -vf greedyh -vo null -ao null
[Thread debugging using libthread_db enabled]
[New Thread 46912507208448 (LWP 23037)]
MPlayer dev-CVS-060415-23:54-4.0.2 (C) 2000-2006 MPlayer Team
CPU: Advanced Micro Devices Athlon 64 Newcastle,Winchester,San Diego,Venice; Sempron Palermo (Family: 15, Stepping: 0)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2


Playing something.avi.
AVI file format detected.
VIDEO:  [XVID]  618x464  24bpp  29.970 fps  1296.2 kbps (158.2 kbyte/s)
Clip info:
 Software: transcode-1.0.2
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening video filter: [greedyh]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
AO: [null] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 618 x 464 (preferred colorspace: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.

SwScaler: BICUBIC scaler, from Planar YV12 to Packed YUY2 using MMX2
VO: [null] 618x464 => 618x464 Packed YUY2
A:   0.0 V:   0.0 A-V:  0.010 ct:  0.000   1/  1 ??% ??% ??,?% 0 0
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912507208448 (LWP 23037)]
0x000000000054cf44 in swScale_MMX2 (c=0xc2e9c0, src=0x7fffff8ab970, srcStride=0x7fffff8ab830,
    srcSliceY=16, srcSliceH=16, dst=0xc36460, dstStride=0x7fffff8ab840) at swscale_template.c:952
952                             asm volatile(
(gdb) bt
#0  0x000000000054cf44 in swScale_MMX2 (c=0xc2e9c0, src=0x7fffff8ab970, srcStride=0x7fffff8ab830,
    srcSliceY=16, srcSliceH=16, dst=0xc36460, dstStride=0x7fffff8ab840) at swscale_template.c:952
#1  0x00000000005449e3 in sws_scale_ordered (c=0xc2e9c0, src=Variable "src" is not available.
) at swscale.c:2313
#2  0x0000000000491a68 in scale ()
#3  0x0000000000491ac0 in draw_slice ()
#4  0x000000000046a768 in draw_slice ()
#5  0x000000000056cb71 in ff_draw_horiz_band ()
#6  0x0000000000662815 in decode_slice ()
#7  0x0000000000663779 in ff_h263_decode_frame ()
#8  0x00000000005691c0 in avcodec_decode_video ()
#9  0x000000000046afa6 in decode ()
#10 0x0000000000467cd4 in decode_video ()
#11 0x0000000000413d53 in main (argc=Variable "argc" is not available.
) at mplayer.c:3559
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0x54cf24 to 0x54cf64:
0x000000000054cf24 <swScale_MMX2+14388>:        test   %esi,%esi
0x000000000054cf26 <swScale_MMX2+14390>:        jne    0x54cf00 <swScale_MMX2+14352>
0x000000000054cf28 <swScale_MMX2+14392>:        lea    0x58(%rcx),%rdx
0x000000000054cf2c <swScale_MMX2+14396>:        mov    (%rdx),%rsi
0x000000000054cf2f <swScale_MMX2+14399>:        movq   0x2060(%rcx),%mm1
0x000000000054cf36 <swScale_MMX2+14406>:        movq   %mm1,%mm7
0x000000000054cf39 <swScale_MMX2+14409>:        data16
0x000000000054cf3a <swScale_MMX2+14410>:        data16
0x000000000054cf3b <swScale_MMX2+14411>:        data16
0x000000000054cf3c <swScale_MMX2+14412>:        nop
0x000000000054cf3d <swScale_MMX2+14413>:        data16
0x000000000054cf3e <swScale_MMX2+14414>:        data16
0x000000000054cf3f <swScale_MMX2+14415>:        nop
0x000000000054cf40 <swScale_MMX2+14416>:        movq   0x8(%rdx),%mm0
0x000000000054cf44 <swScale_MMX2+14420>:        movq   (%rsi,%rax,2),%mm2
0x000000000054cf48 <swScale_MMX2+14424>:        movq   0x8(%rsi,%rax,2),%mm5
0x000000000054cf4d <swScale_MMX2+14429>:        add    $0x10,%rdx
0x000000000054cf51 <swScale_MMX2+14433>:        mov    (%rdx),%rsi
0x000000000054cf54 <swScale_MMX2+14436>:        pmulhw %mm0,%mm2
0x000000000054cf57 <swScale_MMX2+14439>:        pmulhw %mm0,%mm5
0x000000000054cf5a <swScale_MMX2+14442>:        paddw  %mm2,%mm1
0x000000000054cf5d <swScale_MMX2+14445>:        paddw  %mm5,%mm7
0x000000000054cf60 <swScale_MMX2+14448>:        test   %rsi,%rsi
0x000000000054cf63 <swScale_MMX2+14451>:        jne    0x54cf40 <swScale_MMX2+14416>
End of assembler dump.
(gdb) info all-registers
rax            0x1f768  128872
rbx            0xc2e980 12773760
rcx            0xc316d0 12785360
rdx            0xc31728 12785448
rsi            0xc39130 12816688
rdi            0x2aaaaea9dfa0   46912563175328
rbp            0xc3abe0 0xc3abe0
rsp            0x7fffff8ab4e0   0x7fffff8ab4e0
r8             0x38     56
r9             0xfffffffffffffd96       -618
r10            0xc36380 12804992
r11            0xc408d0 12847312
r12            0xc2e9c0 12773824
r13            0x0      0
r14            0xe      14
r15            0xf      15
rip            0x54cf44 0x54cf44 <swScale_MMX2+14420>
eflags         0x210246 2163270
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0
st0            -nan(0xffc0ffc0ffc0ffc)  (raw 0xffff0ffc0ffc0ffc0ffc)
st1            -nan(0x4000400040004)    (raw 0xffff0004000400040004)
st2            <invalid float value>    (raw 0xffff0000000000000000)
st3            -nan(0x4000400040004)    (raw 0xffff0004000400040004)
st4            -nan(0x4000400040004)    (raw 0xffff0004000400040004)
st5            <invalid float value>    (raw 0xffff0000000000000000)
st6            -nan(0x2000200020002)    (raw 0xffff0002000200020002)
st7            -nan(0x4000400040004)    (raw 0xffff0004000400040004)
fctrl          0x37f    895
fstat          0x0      0
ftag           0xaaaa   43690
fiseg          0x0      0
fioff          0x0      0
foseg          0x0      0
fooff          0x0      0
fop            0x0      0
xmm0           {f = {0x1, 0x1, 0x0, 0x0}}       {f = {1.33189654, 1.91648698, 0, 0}}
xmm1           {f = {0x0, 0x3, 0x0, 0x0}}       {f = {0, 3.953125, 0, 0}}
xmm2           {f = {0x2ee00, 0x0, 0x0, 0x0}}   {f = {192000, 0, 0, 0}}
xmm3           {f = {0x0, 0x0, 0x0, 0x0}}       {f = {0.0333666652, 0, 0, 0}}
xmm4           {f = {0x0, 0x0, 0x0, 0x0}}       {f = {0, 0, 0, 0}}
xmm5           {f = {0x0, 0x0, 0x0, 0x0}}       {f = {0.359999985, 0, 0, 0}}
xmm6           {f = {0x0, 0x0, 0x0, 0x0}}       {f = {0, 0, 0, 0}}
xmm7           {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-4.42406053e-05, 0, 0, 0}}
xmm8           {f = {0x0, 0x0, 0x0, 0x0}}       {f = {1.95569883e-05, 0, 0, 0}}
xmm9           {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-1.87683072e-05, 0, 0, 0}}
xmm10          {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-2.32956518e-05, 0, 0, 0}}
xmm11          {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-1.42818976e-06, 0, 0, 0}}
xmm12          {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-2.54722981e-05, 0, 0, 0}}
xmm13          {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-3.87055024e-06, 0, 0, 0}}
xmm14          {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-3.63782092e-05, 0, 0, 0}}
xmm15          {f = {0x0, 0x0, 0x0, 0x0}}       {f = {-4.44095967e-05, 0, 0, 0}}
mxcsr          0x1fa0   8096
(gdb)


More information about the MPlayer-dev-eng mailing list