[MEncoder-users] SegFault when using mencoder
Sven Anders
anders at anduras.de
Fri Feb 8 10:16:41 CET 2013
Hello!
I tried to debug this a little further.
I tried two patches from
https://qa.mandriva.com/show_bug.cgi?id=63279
http://sourceforge.net/mailarchive/message.php?msg_id=25872020
but they did not help.
For the further tests I tried the following sample:
http://samples.mplayerhq.hu/MPEG2/libmpeg2-crash.vob
1) mpeg2dec -o null libmpeg2-crash.vob
=> works without problems.
2) mencoder libmpeg2-crash.vob -o /dev/null -vc mpeg12 -oac copy -ovc copy
=> works
3) mencoder libmpeg2-crash.vob -o /dev/null -vc mpeg12 -oac copy -ovc raw
=> crashes
4) mencoder libmpeg2-crash.vob -o /dev/null -vc mpeg12 -oac copy -ovc x264
=> crashes
What I do not understand is, why do I have now an error in a different function?
It seems, that the is a general problem with mencoder or the libmpeg2 library...
Can anybody weight this problem?!
Regards
Sven
====================================================================================================
The gdb analyis data:
For 3)
Starting program: /usr/bin/mencoder libmpeg2-crash.vob -o /dev/null -vc mpeg12 -oac copy -ovc raw
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
MEncoder svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team
success: format: 0 data: 0x0 - 0xa00000
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
MPEG-PS file format detected.
VIDEO: MPEG2 704x480 (aspect 2) 29.970 fps 9510.0 kbps (1188.8 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:704x480 fps:29.970 ftime:=0.0334
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
[ac3 @ 0xb6c7e7c0]frame sync error
AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Forced video codec: mpeg12
Opening video decoder: [libmpeg2] libmpeg2 MPEG 1/2 Video decoder
Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 B/s=32000 sample-1)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
Pos: 0.0s 1f ( 3%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
Program received signal SIGSEGV, Segmentation fault.
0xb75c1a36 in MC_put_xy_16_c (dest=0xb4008030 "", ref=0xe <Address 0xe out of bounds>, stride=1408, height=8) at motion_comp.c:127
127 motion_comp.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0xb75c1a36 in MC_put_xy_16_c (dest=0xb4008030 "", ref=0xe <Address 0xe out of bounds>, stride=1408, height=8) at motion_comp.c:127
#1 0xb75b4ea9 in motion_fr_field_420 (decoder=0x8442e00, motion=0x8442e78, table=0xb75c5120) at slice.c:1503
#2 0xb75be839 in mpeg2_slice (decoder=0x8442e00, code=1,
buffer=0xb45d5040 "B\352\004-\356̐\023,a/,W\262%\222F&\357\020
09:\321\v\351V=E`\316\364\353\017\\\273O\354\255\344\377\377_\367\224:\357X0\301\r\356\310\064\b\020\310P\276\357C`\202\261Ox\205\004\024\365H56CL\232RƐ$\337Q*\025\031\352R\216nX\271B\356r\307E\022\226HX{\235\351\262\t\215\036\v\222\210\310D0\341t\352\b\035'\t\222\202\fZ\020^\036\204\325\335\030ll\302(f\237\271\362\351\312\020\335ﭫ\214P\213]\233\024,P#\222!\321\v\024\f\030\314vuӣ\220\314\030\223\317x\213\311Sk\304Vx\331\346\274e\344\337Κp\231\016\273\216\363\373\241\314u\023"...)
at slice.c:1892
#3 0xb75b3074 in mpeg2_parse (mpeg2dec=0x8442e00) at decode.c:188
#4 0x081a6c18 in decode (sh=0x841c0b8, data=0xb4f50008, len=13284, flags=0) at libmpcodecs/vd_libmpeg2.c:179
#5 0x080c35c3 in decode_video (sh_video=0x841c0b8, start=0xb4f50008 "", in_size=13280, drop_frame=0, pts=-9.2233720368547758e+18,
full_frame=0x0) at libmpcodecs/dec_video.c:393
#6 0x08082921 in main (argc=<Fehler beim Lesen der Variable: Cannot access memory at address 0x58e>,
argv=<Fehler beim Lesen der Variable: Cannot access memory at address 0x592>) at mencoder.c:1463
(gdb)
(gdb) disass
Dump of assembler code for function MC_put_xy_16_c:
0xb75c1a10 <+0>: push %ebp
0xb75c1a11 <+1>: push %edi
0xb75c1a12 <+2>: push %esi
0xb75c1a13 <+3>: push %ebx
0xb75c1a14 <+4>: mov 0x1c(%esp),%eax
0xb75c1a18 <+8>: mov 0x18(%esp),%ebp
0xb75c1a1c <+12>: mov 0x14(%esp),%edi
0xb75c1a20 <+16>: mov %eax,%esi
0xb75c1a22 <+18>: lea 0x0(%ebp,%eax,1),%ebx
0xb75c1a26 <+22>: neg %esi
0xb75c1a28 <+24>: mov %ebx,%ecx
0xb75c1a2a <+26>: jmp 0xb75c1a36 <MC_put_xy_16_c+38>
0xb75c1a2c <+28>: lea 0x0(%esi,%eiz,1),%esi
0xb75c1a30 <+32>: mov 0x1c(%esp),%eax
0xb75c1a34 <+36>: add %eax,%ebx
=> 0xb75c1a36 <+38>: movzbl 0x0(%ebp),%edx
0xb75c1a3a <+42>: movzbl 0x1(%ebp),%eax
0xb75c1a3e <+46>: mov %ebx,%ebp
0xb75c1a40 <+48>: lea 0x2(%eax,%edx,1),%eax
0xb75c1a44 <+52>: movzbl (%ecx),%edx
0xb75c1a47 <+55>: add %edx,%eax
0xb75c1a49 <+57>: movzbl 0x1(%ecx),%edx
=================================================================================================================
For 4)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
MEncoder svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team
success: format: 0 data: 0x0 - 0xa00000
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
MPEG-PS file format detected.
VIDEO: MPEG2 704x480 (aspect 2) 29.970 fps 9510.0 kbps (1188.8 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:704x480 fps:29.970 ftime:=0.0334
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
[ac3 @ 0xb6c7e7c0]frame sync error
AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Forced video codec: mpeg12
Opening video decoder: [libmpeg2] libmpeg2 MPEG 1/2 Video decoder
Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 B/s=32000 sample-1)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0xb742ba20]using unscaled yuv420p -> yuv420p special converter
x264 [info]: using SAR=10/11
x264 [info]: using cpu capabilities: MMX2 SSE2Slow SlowCTZ
[New Thread 0xb4364b40 (LWP 651)]
[New Thread 0xb3b63b40 (LWP 652)]
[New Thread 0xb3362b40 (LWP 653)]
[New Thread 0xb1fe3b40 (LWP 654)]
x264 [info]: profile High, level 3.0
Pos: 0.0s 1f ( 3%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
Program received signal SIGSEGV, Segmentation fault.
0xb75c1a36 in MC_put_xy_16_c (dest=0xb16e9030 "", ref=0xe <Address 0xe out of bounds>, stride=1408, height=8) at motion_comp.c:127
127 motion_comp.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0xb75c1a36 in MC_put_xy_16_c (dest=0xb16e9030 "", ref=0xe <Address 0xe out of bounds>, stride=1408, height=8) at motion_comp.c:127
#1 0xb75b4ea9 in motion_fr_field_420 (decoder=0x8442e80, motion=0x8442ef8, table=0xb75c5120) at slice.c:1503
#2 0xb75be839 in mpeg2_slice (decoder=0x8442e80, code=1,
buffer=0xb45d5040 "B\352\004-\356̐\023,a/,W\262%\222F&\357\020
09:\321\v\351V=E`\316\364\353\017\\\273O\354\255\344\377\377_\367\224:\357X0\301\r\356\310\064\b\020\310P\276\357C`\202\261Ox\205\004\024\365H56CL\232RƐ$\337Q*\025\031\352R\216nX\271B\356r\307E\022\226HX{\235\351\262\t\215\036\v\222\210\310D0\341t\352\b\035'\t\222\202\fZ\020^\036\204\325\335\030ll\302(f\237\271\362\351\312\020\335ﭫ\214P\213]\233\024,P#\222!\321\v\024\f\030\314vuӣ\220\314\030\223\317x\213\311Sk\304Vx\331\346\274e\344\337Κp\231\016\273\216\363\373\241\314u\023"...)
at slice.c:1892
#3 0xb75b3074 in mpeg2_parse (mpeg2dec=0x8442e80) at decode.c:188
#4 0x081a6c18 in decode (sh=0x841c0b8, data=0xb4f50008, len=13284, flags=0) at libmpcodecs/vd_libmpeg2.c:179
#5 0x080c35c3 in decode_video (sh_video=0x841c0b8, start=0xb4f50008 "", in_size=13280, drop_frame=0, pts=-9.2233720368547758e+18,
full_frame=0x0) at libmpcodecs/dec_video.c:393
#6 0x08082921 in main (argc=<Fehler beim Lesen der Variable: Cannot access memory at address 0x58e>,
argv=<Fehler beim Lesen der Variable: Cannot access memory at address 0x592>) at mencoder.c:1463
(gdb)
(gdb) disass
Dump of assembler code for function MC_put_xy_16_c:
0xb75c1a10 <+0>: push %ebp
0xb75c1a11 <+1>: push %edi
0xb75c1a12 <+2>: push %esi
0xb75c1a13 <+3>: push %ebx
0xb75c1a14 <+4>: mov 0x1c(%esp),%eax
0xb75c1a18 <+8>: mov 0x18(%esp),%ebp
0xb75c1a1c <+12>: mov 0x14(%esp),%edi
0xb75c1a20 <+16>: mov %eax,%esi
0xb75c1a22 <+18>: lea 0x0(%ebp,%eax,1),%ebx
0xb75c1a26 <+22>: neg %esi
0xb75c1a28 <+24>: mov %ebx,%ecx
0xb75c1a2a <+26>: jmp 0xb75c1a36 <MC_put_xy_16_c+38>
0xb75c1a2c <+28>: lea 0x0(%esi,%eiz,1),%esi
0xb75c1a30 <+32>: mov 0x1c(%esp),%eax
0xb75c1a34 <+36>: add %eax,%ebx
=> 0xb75c1a36 <+38>: movzbl 0x0(%ebp),%edx
0xb75c1a3a <+42>: movzbl 0x1(%ebp),%eax
0xb75c1a3e <+46>: mov %ebx,%ebp
0xb75c1a40 <+48>: lea 0x2(%eax,%edx,1),%eax
0xb75c1a44 <+52>: movzbl (%ecx),%edx
0xb75c1a47 <+55>: add %edx,%eax
0xb75c1a49 <+57>: movzbl 0x1(%ecx),%edx
0xb75c1a4d <+61>: add %edx,%eax
0xb75c1a4f <+63>: sar $0x2,%eax
0xb75c1a52 <+66>: mov %al,(%edi)
> valgrind mencoder libmpeg2-crash.vob -o /dev/null -vc mpeg12 -oac copy -ovc x264
==666== Use of uninitialised value of size 4min 0mb A-V:0.000 [0:0]
==666== at 0x4A5CA36: MC_put_xy_16_c (motion_comp.c:127)
==666== by 0x4A4FEA8: motion_fr_field_420 (slice.c:1503)
==666== by 0x4A59838: mpeg2_slice (slice.c:1892)
==666== by 0x4A4E073: mpeg2_parse (decode.c:188)
==666== by 0x81A6C17: decode (vd_libmpeg2.c:179)
==666== by 0x80C35C2: decode_video (dec_video.c:393)
==666== by 0x5D704D2: (below main) (libc-start.c:226)
==666==
==666== Invalid read of size 1
==666== at 0x4A5CA36: MC_put_xy_16_c (motion_comp.c:127)
==666== by 0x4A4FEA8: motion_fr_field_420 (slice.c:1503)
==666== by 0x4A59838: mpeg2_slice (slice.c:1892)
==666== by 0x4A4E073: mpeg2_parse (decode.c:188)
==666== by 0x81A6C17: decode (vd_libmpeg2.c:179)
==666== by 0x80C35C2: decode_video (dec_video.c:393)
==666== by 0x5D704D2: (below main) (libc-start.c:226)
==666== Address 0xe is not stack'd, malloc'd or (recently) free'd
==666==
==666==
==666== Process terminating with default action of signal 11 (SIGSEGV)
==666== Access not within mapped region at address 0xE
==666== at 0x4A5CA36: MC_put_xy_16_c (motion_comp.c:127)
==666== by 0x4A4FEA8: motion_fr_field_420 (slice.c:1503)
==666== by 0x4A59838: mpeg2_slice (slice.c:1892)
==666== by 0x4A4E073: mpeg2_parse (decode.c:188)
==666== by 0x81A6C17: decode (vd_libmpeg2.c:179)
==666== by 0x80C35C2: decode_video (dec_video.c:393)
==666== by 0x5D704D2: (below main) (libc-start.c:226)
--
Sven Anders <anders at anduras.de> () UTF-8 Ribbon Campaign
/\ Support plain text e-mail
ANDURAS intranet security AG
Messestraße 3 - 94036 Passau - Germany
Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55
Rechtsform: Aktiengesellschaft - Sitz: Passau - Amtsgericht: Passau HRB 6032
Mitglieder des Vorstands: Dipl.-Inf. Sven Anders, Dipl.-Inf. Marcus Junker
Vorsitzender des Aufsichtsrats: RA Mark Peters
More information about the MEncoder-users
mailing list