[MPlayer-users] Seg fault in YSCALEYUV2YV12X called from yuv2yuvX doing vertical rescaling

Stephen Davies steve at daviesfam.org
Fri May 24 17:49:02 CEST 2002


Hi,

I'm hitting a segfault in CVS mencoder trying to do vertical rescaling.  I
hit the same problem for mpeg1, mpeg2 (dvb) and divx4 source
files.  Output to libavcodec or divx4.  Horizontal scaling works fine.

The segfault occurs within yuv2yuvX (my box has MMX).  Specically, falls
over in YSCALEYUV2YV12X.  As far as I see its on the first frame or
near...

This surprises me since it was also broken for me in my May 4th CVS copy
and nobody else seems to have reported the problem.

My mencoder was configured with:

./configure --enable-css --with-csslibdir=/usr/local/lib \
--with-cssincdir=/usr/local/include --with-win32libdir=/usr/lib/win32 \
--enable-lirc --enable-largefiles --enable-streaming --enable-tv \
--disable-mp1e --disable-vidix --disable-dvb --enable-debug=3

(Guess some opts there are now obsolete)

Anyway, per bugreport:

* Your Linux distribution or operating system e.g.:

Is Linux Mandrake 7.1, quite a lot of updates

* kernel version:

Linux tim.daviesfam.org 2.4.18-ide-xfs1.1-bttvstuff-lvm1.03 #3 Thu Apr 25 17:23:01 BST 2002 i686 unknown

* libc version:

-rwxr-xr-x    1 root     root      1216268 Feb 21  2001 /lib/libc-2.2.2.so*
lrwxrwxrwx    1 root     root           13 May 14  2001 /lib/libc.so.6 -> libc-2.2.2.so*

* X version:

[steve at tim movies]$ X -version

This is a pre-release version of XFree86, and is not supported in any
way.  Bugs may be reported to XFree86 at XFree86.Org and patches submitted
to fixes at XFree86.Org.  Before reporting bugs in pre-release versions,
please check the latest version in the XFree86 CVS repository
(http://www.XFree86.Org/cvs)

XFree86 Version 4.0.99.3 / X Window System
(protocol Version 11, revision 0, vendor release 6510)
Release Date: 26 April 2001
        If the server is older than 6-12 months, or if your card is
        newer than the above date, look for a newer version before
        reporting problems.  (See http://www.XFree86.Org/FAQ)
Operating System: Linux 2.4.4-xfs i686 [ELF]
Module Loader present

(But irrelevant for this report I'd imagine)

* gcc and ld versions:

Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/specs
gcc version 2.95.3 19991030 (prerelease)
GNU ld version 2.10.91 (with BFD 2.10.1.0.2)

* binutils version:

GNU assembler 2.10.91
Copyright 2000 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `i586-mandrake-linux'.

* CPU info (this works on Linux only):

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 4
model name      : AMD Athlon(tm) Processor
stepping        : 2
cpu MHz         : 1136.744
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow
bogomips        : 2267.54

* Video card manufacturer and model, e.g.:

3dfx Voodoo3 3000 TV

* Video driver type & version, e.g.:

XFree 4.0.1 DRI driver

* Sound card type & driver, e.g.:

Creative SBLive 5.1, oss driver




For the crash, here's the output and gdb debugging:

[steve at tim movies]$ gdb ~/stivo/mplayer/development/main/mencoder
GNU gdb 5.0mdk-11mdk Linux-Mandrake 8.0
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...
(gdb) run -v   -o test.avi -vop scale=720:288  -ovc divx4 -aspect 4:3 the4thprotocol-michaelcaine.mpg
Starting program: /home/steve/stivo/mplayer/development/main/mencoder -v -o test.avi -vop scale=720:288  -ovc divx4 -aspect 4:3 the4thprotocol-michaelcaine.mpg [New Thread 1024 (LWP 26207)]


MEncoder CVS-020524-12:05-2.95.3 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPU: Advanced Micro Devices Athlon TB Thunderbird (Family: 6, Stepping: 2)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Reading /home/steve/.mplayer/codecs.conf: 34 audio & 92 video codecs
Font /home/steve/.mplayer/font/font.desc loaded successfully! (140 chars)
File not found: 'frameno.avi'
Not an URL!
File size is 4798971902 bytes
success: format: 0  data: 0x0 - 0x1E0A7FFE
Checking for YUV4MPEG2
DEMUXER: freeing demuxer at 0x826fde0
ASF_check: not ASF guid!
DEMUXER: freeing demuxer at 0x826fde0
Checking for NuppelVideo
DEMUXER: freeing demuxer at 0x826fde0
Checking for MOV
DEMUXER: freeing demuxer at 0x826fde0
Checking for VIVO
header block 1 size: 0
DEMUXER: freeing demuxer at 0x826fde0
Checking for REAL
DEMUXER: freeing demuxer at 0x826fde0
DEMUXER: freeing demuxer at 0x826fde0
DEMUXER: freeing demuxer at 0x826fde0
DEMUXER: freeing demuxer at 0x826fde0
DEMUXER: freeing demuxer at 0x826fde0
DEMUXER: freeing demuxer at 0x826fde0
system stream synced at 0xD (0)!
==> Found video stream: 0
Detected MPEG-PS file format!
==> Found audio stream: 0
Searching for sequence header... OK!
VIDEO:  MPEG2  720x576  (aspect 3)  25.00 fps  18750.0 kbps (2343.8 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x576  fps:25.00  ftime:=0.0400
Detected audio codec: [mp3] drv:1 (MPEG layer-2, layer-3)
Initializing audio codec...
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer
mp3lib: made decode tables with MMX optimization
init layer2&3 finished, tables done
mp3lib: using 3DNow!Ex optimized decore!
MPEG 1.0, Layer II, 48000 Hz 256 kbit Stereo, BPF: 768
Channels: 2, copyright: No, original: Yes, CRC: Yes, emphasis: 0
AUDIO: srate=48000  chans=2  bps=2  sfmt=0x10  ratio: 32000->192000
Opening video filter: [expand=-1:-1:-1:-1:1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale=720:288]
SwScale params: 720 x 288 (-1=no scaling)
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576 (preferred csp: Mpeg PES)
vo_debug: query(Mpeg PES) returned 0x0 (i=0)
Sorry, selected video_out device is incompatible with this codec.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder v2.0
libmpeg2: Using MMXEXT for IDCT transform
libmpeg2: Using MMXEXT for motion compensation
VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
scale: query(BGR 32-bit) -> 0
scale: query(BGR 24-bit) -> 1
scale: query(BGR 16-bit) -> 0
scale: query(BGR 15-bit) -> 0
scale: query(Planar YV12) -> 3
vo_debug: query(Planar YV12) returned 0x443 (i=0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
video_out->init(720x576->1024x576,flags=0,'MPlayer',0x32315659)
scale: query(BGR 32-bit) -> 0
scale: query(BGR 24-bit) -> 1
scale: query(BGR 16-bit) -> 0
scale: query(BGR 15-bit) -> 0
scale: query(Planar YV12) -> 3
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 9 -> 8
SwScaler: reducing / aligning filtersize 9 -> 8
SwScaler: BICUBIC scaler, 720x576 Planar YV12 -> 720x288 Planar YV12 using
MMX2
SwScaler: using 4-tap MMX scaler for horizontal luminance scaling
SwScaler: using 4-tap MMX scaler for horizontal chrominance scaling
SwScaler: using n-tap MMX scaler for vertical scaling (YV12 like)
SwScaler: 720x576 -> 720x288
REQ: flags=0x403  req=0x0
REQ: flags=0x3  req=0x0
Detected video codec: [mpeg12] drv:1 (MPEG 1 or 2)
==========================================================================
MP3 audio selected
Writing AVI header...
LAME version 3.90 (alpha 8, Nov 16 2001 17:28:40) (http://www.mp3dev.org/)
Using polyphase lowpass  filter, transition band: 19548 Hz - 20129 Hz

misc:

        scaling: 0.000000
        ch0 (left) scaling: 0.000000
        ch1 (right) scaling: 0.000000
        filter type: 0
        quantization: ISO
        huffman search: normal
        experimental X=0 Y=0 Z=0
        ...

stream format:

        MPEG-1 Layer 3
        2 channel - stereo
        padding: auto
        variable bitrate - VBR rh (default)
        ...

psychoacoustic:

        tonality estimation limit: 8871.700195 Hz
        using short blocks: allowed
        adjust masking: -1.000000 dB
        psymodel: 1
        noise shaping: 1
         ^ amplification: 0
         ^ stopping: 0
        ATH: using
         ^ type: 4
         ^ adjust type: 3
         ^ adapt threshold type: 2
        using temporal masking effect: yes
        ...

user_data: len=  7  44 54 47 31 'DTG1A'
*** [scale] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
user_data: len=  9  44 54 47 31 'DTG1A'  0min   0mb  A-V:0.000 [0:0] A/Vms 0/6 D/S 0/0
*** [scale] Allocating mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
*** [divx4] Allocating mp_image_t, 720x288x12bpp YUV planar, 311040 bytes
*** [expand] Direct Rendering mp_image_t, 720x288x12bpp YUV planar, 311040 bytes
sws Strides:720 360 360 -> 720 360 360
0 -1 8
1 14 -1 7
1 14
2 14 0 7
2 14
3 14 1 7
3 14
4 14 2 7
4 14
5 14 3 7
5 14
6 14 4 7
6 14
7 14 5 7
7 14
8 14 6 7
8 14
before yuv2yuvX

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 26207)]
0x0812e1b3 in swScale_MMX2 (c=0x8289b40, srcParam=0x8273050,
srcStrideParam=0x827305c, srcSliceY=0, srcSliceH=576, dstParam=0x8294b20,
dstStrideParam=0x8294b2c) at swscale_template.c:664
664                     asm volatile(
(gdb) bt
#0  0x0812e1b3 in swScale_MMX2 (c=0x8289b40, srcParam=0x8273050,
srcStrideParam=0x827305c, srcSliceY=0, srcSliceH=576, dstParam=0x8294b20,
dstStrideParam=0x8294b2c) at swscale_template.c:664
#1  0x0806d781 in put_image (vf=0x8289898, mpi=0x8273030) at
vf_scale.c:132
#2  0x08065e32 in decode_video (sh_video=0x8230410, start=0x404c9008 "",
in_size=12505, drop_frame=0) at dec_video.c:204
#3  0x0804da64 in main (argc=11, argv=0xbffffb04, envp=0xbffffb34) at
mencoder.c:964
#4  0x402560de in __libc_start_main () from /lib/libc.so.6
(gdb) disass $eip-32 $eip+32
Dump of assembler code from 0x812e193 to 0x812e1d3:
0x812e193 <swScale_MMX2+14567>: mov    %ebx,0xffffffbc(%ebp)
0x812e196 <swScale_MMX2+14570>: xor    %eax,%eax
0x812e198 <swScale_MMX2+14572>: pxor   %mm3,%mm3
0x812e19b <swScale_MMX2+14575>: pxor   %mm4,%mm4
0x812e19e <swScale_MMX2+14578>: mov    0xffffffc0(%ebp),%edx
0x812e1a1 <swScale_MMX2+14581>: jmp    0x812e1b0 <swScale_MMX2+14596>
0x812e1a3 <swScale_MMX2+14583>: nop
0x812e1a4 <swScale_MMX2+14584>: nop
0x812e1a5 <swScale_MMX2+14585>: nop
0x812e1a6 <swScale_MMX2+14586>: nop
0x812e1a7 <swScale_MMX2+14587>: nop
0x812e1a8 <swScale_MMX2+14588>: nop
0x812e1a9 <swScale_MMX2+14589>: nop
0x812e1aa <swScale_MMX2+14590>: nop
0x812e1ab <swScale_MMX2+14591>: nop
0x812e1ac <swScale_MMX2+14592>: nop
0x812e1ad <swScale_MMX2+14593>: nop
0x812e1ae <swScale_MMX2+14594>: nop
0x812e1af <swScale_MMX2+14595>: nop
0x812e1b0 <swScale_MMX2+14596>: mov    (%esi,%edx,4),%esi
0x812e1b3 <swScale_MMX2+14599>: movq   (%eax,%edx,8),%mm0
0x812e1b7 <swScale_MMX2+14603>: movq   0x0(%esi,%eax,2),%mm2
0x812e1bc <swScale_MMX2+14608>: movq   0x8(%esi,%eax,2),%mm5
0x812e1c1 <swScale_MMX2+14613>: pmulhw %mm0,%mm2
0x812e1c4 <swScale_MMX2+14616>: pmulhw %mm0,%mm5
0x812e1c7 <swScale_MMX2+14619>: paddw  %mm2,%mm3
0x812e1ca <swScale_MMX2+14622>: paddw  %mm5,%mm4
0x812e1cd <swScale_MMX2+14625>: add    $0x1,%edx
0x812e1d0 <swScale_MMX2+14628>: jne    0x812e1b0 <swScale_MMX2+14596>
0x812e1d2 <swScale_MMX2+14630>: psraw  $0x3,%mm3
End of assembler dump.



Thanks,
Steve





More information about the MPlayer-users mailing list