[MPlayer-dev-eng] sig11 in -vo x11 - probably bug in SwScaler

Arpi arpi at thot.banki.hu
Sun Mar 31 12:37:28 CEST 2002


Hi,

I've reported it already earlier, that -vo x11 randomly crashes when
resizing window (keep pressing key 'f' for few seconds - easiest way to
reproduce here).

Now, while tracing a bug in RLE codec, i've got reproducable sig11 again,
now with no scaling but in the scaler doing 24->32bpp bgr conversion.
It seems that in 24bpp modes it reads more than the allocated image, maybe
reads few bytes (lines?) too lot.

I'm also started using njamd-0.8.1, a very nice (and working) memory
debugger. It somehow locks memory areas and tell me when teh code
reads/writes more than the allocated size or if it tries to free/realloc
unallocated memory. I suggest using it for testing, catched several strange
random crashes yesterday.

MPlayer used to be stable, but nowdays even I got random sig11s
everywhere... it's not good... especially as we're getting closer to
the big bumm - the first gpl release. it may be v1.0, maybe we should
release some 0.9x first, but I think we've done the planned feature list for
1.0 so no more sense of delaying it... so don't make big-bug-pack.


now the logs, first from njamd, second is the usual gdb stuff:


MPlayer CVS-020331-04:01-2.95.3 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
CPU vendor name: GenuineIntel  max cpuid level: 2
CPU: Intel Pentium 4 Xeon Foster (Type: 8, Stepping: 2)
extended cpuid-level: 4
Testing OS support for SSE... yes.
Testing OS support for SSE unmasked exceptions... yes.
Tests of OS support for SSE passed.
Compiled with RUNTIME CPU Detection - warning, it's not optimal! To get best performance, recompile mplayer from sources with --disable-runtime-cpudetection
CommandLine:Reading /root/.mplayer/codecs.conf: 30 audio & 80 video codecs
get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
 'Logo-RLE(best).avi' '-vo' 'x11' '-v'
Using Linux's hardware RTC timing (1024Hz)
Font /root/.mplayer/font/font.desc loaded successfully! (206 chars)
get_path('input.conf') -> '/root/.mplayer/input.conf'
Can't open input config file /root/.mplayer/input.conf : No such file or directory
Falling back on default (hardcoded) config
Playing Logo-RLE(best).avi
Can't open IFO file: No such file or directory
File size is 98272 bytes
Not an URL!
Detected AVI file format!
==> Found video stream: 0
list_end=0x4D4
======= AVI Header =======
us/frame: 66666  (fps=15.000)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (16) HAS_INDEX
frames  total: 35   initial: 0
streams: 1
Suggested BufferSize: 32768
Size:  64 x 64
list_end=0x4D4
found 'bih', 1064 bytes of 40
======= STREAM Header =======
Type: vids   FCC: RLE  (20454C52)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 15/1 = 15.000
Start: 0   Len: 35
Suggested BufferSize: 4096
Quality 10000
Sample size: 0
Broken chunk?  chunksize=2840  (id=JUNK)
======= VIDEO Format ======
  biSize 1064
  biWidth 64
  biHeight 64
  biPlanes 1
  biBitCount 8
  biCompression 1=''
  biSizeImage 8192
===========================
Found movie at 0x1000 - 0x17C66
list_end=0x17C66
Reading INDEX block, 35 chunks for 35 frames
Broken chunk?  chunksize=0  (id=idx1)
Reading INDEX block, 35 chunks for 35 frames
AVI index offset: 0xFFC (movi=0x1000 idx0=0x4 idx1=0xB92)
list_end=0x17F6C
list_end=0x17FE0
Auto-selected AVI video ID = 0
AVI_NI: No Audio stream found...  ->nosound
AVI: Searching for audio stream (id:-1)
AVI: No Audio stream found...  ->nosound
AVI video length=93014
VIDEO:  []  64x64  8bpp  15.00 fps  318.9 kbps (38.9 kbyte/s)
[V] filefmt:3  fourcc:0x1  size:64x64  fps:15.00  ftime:=0.0667
get_path('sub/') -> '/root/.mplayer/sub/'
==========================================================================
X11 opening display: :0.0
vo: X11 color mask:  FFFF  (R:F800 G:7E0 B:1F)
vo: X11 running at 1024x768 with depth 16 and 16 bits/pixel (":0.0" => local display)
VDec: vo config request - 64 x 64, BGR 24-bit  
Opening Video Decoder: [msrle] RLE Video decoder
Movie-Aspect is undefined - no prescaling applied.
VO: [x11] 64x64 => 64x64 BGR 24-bit 
VO: Description: X11 ( XImage/Shm )
VO: Author: Aaron Holtzman <aholtzma at ess.engr.uvic.ca>
video_out->init(64x64->64x64,flags=0,'MPlayer',0x42475218)

SwScaler: BICUBIC scaler, from BGR 24-bit to dithered BGR 16-bit using MMX2
Detected video codec: [msrle] drv:9 prio:0 (Microsoft RLE)
Sharing memory.
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 1
SwScaler: reducing / aligning filtersize 4 -> 4
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 (BGR)
SwScaler: using MMX YV12->BGR16 Converter
SwScaler: 64x64 -> 64x64
==========================================================================
Audio: no sound!!!
Freeing 0 unused audio chunks
Start playing...
*** Allocating mp_image_t, 64x64x24bpp RGB packed, 12288 bytes

Segmentation fault (caught by NJAMD)
	called from mplayer(vo_vm_close+0x1289)[0x8086581]
	called from mplayer(vo_vm_close+0x1330)[0x8086628]
	called from mplayer(decode_video+0xcc)[0x809f0e4]
	called from mplayer(main+0x2413)[0x8063edf]
	called from /lib/libc.so.6(__libc_start_main+0xbb)[0x403e12eb]
	called from mplayer(_start+0x21)[0x8061271]

Cause of fault: Access to protected region
Address of fault is 0x4225d000

0x42259000-0x4225e000: Aligned len 12288
   Allocation callstack:
	called from mplayer(mpcodecs_get_image+0x33e)[0x809fa2a]
	called from mplayer(mpcodecs_get_image+0x1d44)[0x80a1430]
	called from mplayer(decode_video+0x36)[0x809f04e]
   Not Freed


MPlayer interrupted by signal 11 in module: decode_video 
- MPlayer crashed by bad usage of CPU/FPU/RAM. Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and disassembly. For details, see DOCS/bugreports.html section 5.b.
- MPlayer crashed. This shouldn't happen. It can be a bug in the MPlayer code _or_ in your drivers _or_ in your gcc version. If you think it's MPlayer's fault, please read DOCS/bugreports.html and follow instructions there. We can't and won't help unless you provide these informations when reporting a possible bug.

*** free_stream() called ***


GNU gdb 5.0
Copyright 2000 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-slackware-linux"...
(gdb) run Logo-RLE\(best\).avi -v -vo x11
Starting program: /usr/local/bin/mplayer Logo-RLE\(best\).avi -v -vo x11


MPlayer CVS-020331-04:01-2.95.3 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
CPU vendor name: GenuineIntel  max cpuid level: 2
CPU: Intel Pentium 4 Xeon Foster (Type: 8, Stepping: 2)
extended cpuid-level: 4
Testing OS support for SSE... yes.
Testing OS support for SSE unmasked exceptions... yes.
Tests of OS support for SSE passed.
Compiled with RUNTIME CPU Detection - warning, it's not optimal! To get best performance, recompile mplayer from sources with --disable-runtime-cpudetection
CommandLine:Reading /root/.mplayer/codecs.conf: 30 audio & 80 video codecs
get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
 'Logo-RLE(best).avi' '-v' '-vo' 'x11'
Using Linux's hardware RTC timing (1024Hz)
Font /root/.mplayer/font/font.desc loaded successfully! (206 chars)
get_path('input.conf') -> '/root/.mplayer/input.conf'
Can't open input config file /root/.mplayer/input.conf : No such file or directory
Falling back on default (hardcoded) config
Playing Logo-RLE(best).avi
Can't open IFO file: No such file or directory
File size is 98272 bytes
Not an URL!
Detected AVI file format!
==> Found video stream: 0
list_end=0x4D4
======= AVI Header =======
us/frame: 66666  (fps=15.000)
max bytes/sec: 0
padding: 0
MainAVIHeader.dwFlags: (16) HAS_INDEX
frames  total: 35   initial: 0
streams: 1
Suggested BufferSize: 32768
Size:  64 x 64
list_end=0x4D4
found 'bih', 1064 bytes of 40
======= STREAM Header =======
Type: vids   FCC: RLE  (20454C52)
Flags: 0
Priority: 0   Language: 0
InitialFrames: 0
Rate: 15/1 = 15.000
Start: 0   Len: 35
Suggested BufferSize: 4096
Quality 10000
Sample size: 0
Broken chunk?  chunksize=2840  (id=JUNK)
======= VIDEO Format ======
  biSize 1064
  biWidth 64
  biHeight 64
  biPlanes 1
  biBitCount 8
  biCompression 1=''
  biSizeImage 8192
===========================
Found movie at 0x1000 - 0x17C66
list_end=0x17C66
Reading INDEX block, 35 chunks for 35 frames
Broken chunk?  chunksize=0  (id=idx1)
Reading INDEX block, 35 chunks for 35 frames
AVI index offset: 0xFFC (movi=0x1000 idx0=0x4 idx1=0xB92)
list_end=0x17F6C
list_end=0x17FE0
Auto-selected AVI video ID = 0
AVI_NI: No Audio stream found...  ->nosound
AVI: Searching for audio stream (id:-1)
AVI: No Audio stream found...  ->nosound
AVI video length=93014
VIDEO:  []  64x64  8bpp  15.00 fps  318.9 kbps (38.9 kbyte/s)
[V] filefmt:3  fourcc:0x1  size:64x64  fps:15.00  ftime:=0.0667
get_path('sub/') -> '/root/.mplayer/sub/'
==========================================================================
X11 opening display: :0.0
vo: X11 color mask:  FFFF  (R:F800 G:7E0 B:1F)
vo: X11 running at 1024x768 with depth 16 and 16 bits/pixel (":0.0" => local display)
VDec: vo config request - 64 x 64, BGR 24-bit  
Opening Video Decoder: [msrle] RLE Video decoder
Movie-Aspect is undefined - no prescaling applied.
VO: [x11] 64x64 => 64x64 BGR 24-bit 
VO: Description: X11 ( XImage/Shm )
VO: Author: Aaron Holtzman <aholtzma at ess.engr.uvic.ca>
video_out->init(64x64->64x64,flags=0,'MPlayer',0x42475218)

SwScaler: BICUBIC scaler, from BGR 24-bit to dithered BGR 16-bit using MMX2
Detected video codec: [msrle] drv:9 prio:0 (Microsoft RLE)
Sharing memory.
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 1
SwScaler: reducing / aligning filtersize 4 -> 4
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 (BGR)
SwScaler: using MMX YV12->BGR16 Converter
SwScaler: 64x64 -> 64x64
==========================================================================
Audio: no sound!!!
Freeing 0 unused audio chunks
Start playing...
*** Allocating mp_image_t, 64x64x24bpp RGB packed, 12288 bytes
[New Thread 1024 (LWP 883)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 883)]
0x81845b8 in swScale_MMX2 (c=0x41e80180, srcParam=0x42257fe0, 
    srcStrideParam=0xbfffe590, srcSliceY=0, srcSliceH=64, dstParam=0xbfffe550, 
    dstStrideParam=0xbfffe544) at swscale_template.c:1648
1648		asm volatile(
(gdb) bt
#0  0x81845b8 in swScale_MMX2 (c=0x41e80180, srcParam=0x42257fe0, 
    srcStrideParam=0xbfffe590, srcSliceY=0, srcSliceH=64, dstParam=0xbfffe550, 
    dstStrideParam=0xbfffe544) at swscale_template.c:1648
#1  0x8086581 in draw_slice (src=0x42257fe0, stride=0xbfffe590, w=64, h=64, 
    x=0, y=0) at vo_x11.c:520
#2  0x8086628 in draw_frame (src=0x42257fe0) at vo_x11.c:534
#3  0x809f0e4 in decode_video (video_out=0x81ebda0, sh_video=0x41da2f4c, 
    start=0x41dac47a "@\n", in_size=2950, drop_frame=0) at dec_video.c:193
#4  0x8063edf in main (argc=5, argv=0xbffff8a4, envp=0xbffff8bc)
    at mplayer.c:1503
#5  0x403e12eb in __libc_start_main (main=0x8061acc <main>, argc=5, 
    ubp_av=0xbffff8a4, init=0x805f9a8 <_init>, fini=0x81acef0 <_fini>, 
    rtld_fini=0x4000c130 <_dl_fini>, stack_end=0xbffff89c)
    at ../sysdeps/generic/libc-start.c:129
(gdb) disass $eip-32 $eip+32
Dump of assembler code from 0x8184598 to 0x81845d8:
0x8184598 <swScale_MMX2+1820>:	lds    (%edi),%ecx
0x818459a <swScale_MMX2+1822>:	cmc    
0x818459b <swScale_MMX2+1823>:	aad    $0xf
0x818459d <swScale_MMX2+1825>:	imul   $0xf,%edx,%eax
0x81845a0 <swScale_MMX2+1828>:	jno    0x8184582 <swScale_MMX2+1798>
0x81845a2 <swScale_MMX2+1830>:	pop    %es
0x81845a3 <swScale_MMX2+1831>:	movd   0xc(%edx,%ebx,1),%mm4
0x81845a8 <swScale_MMX2+1836>:	movd   0xf(%edx,%ebx,1),%mm1
0x81845ad <swScale_MMX2+1841>:	punpcklbw %mm7,%mm4
0x81845b0 <swScale_MMX2+1844>:	punpcklbw %mm7,%mm1
0x81845b3 <swScale_MMX2+1847>:	movd   0x12(%edx,%ebx,1),%mm2
0x81845b8 <swScale_MMX2+1852>:	movd   0x15(%edx,%ebx,1),%mm3
0x81845bd <swScale_MMX2+1857>:	punpcklbw %mm7,%mm2
0x81845c0 <swScale_MMX2+1860>:	punpcklbw %mm7,%mm3
0x81845c3 <swScale_MMX2+1863>:	pmaddwd %mm6,%mm4
0x81845c6 <swScale_MMX2+1866>:	pmaddwd %mm6,%mm1
0x81845c9 <swScale_MMX2+1869>:	pmaddwd %mm6,%mm2
0x81845cc <swScale_MMX2+1872>:	pmaddwd %mm6,%mm3
0x81845cf <swScale_MMX2+1875>:	packssdw %mm1,%mm4
0x81845d2 <swScale_MMX2+1878>:	packssdw %mm3,%mm2
0x81845d5 <swScale_MMX2+1881>:	pmaddwd %mm5,%mm4
End of assembler dump.
(gdb) printf "eax=%08lX\n",$eax
eax=FFFFFFF8
(gdb) printf "ebx=%08lX\n",$ebx
ebx=FFFFFFE8
(gdb) printf "ecx=%08lX\n",$ecx
ecx=FFFFFFC0
(gdb) printf "edx=%08lX\n",$edx
edx=4225D000
(gdb) printf "esp=%08lX\n",$esp
esp=BFFFE174
(gdb) printf "ebp=%08lX\n",$ebp
ebp=BFFFE4FC
(gdb) printf "edi=%08lX\n",$edi
edi=4222FFD0
(gdb) printf "esi=%08lX\n",$esi
esi=41E80228
(gdb) q
The program is running.  Exit anyway? (y or n) 


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list