[Ffmpeg-devel] Illegal instruction [PATCH]
John Dalgliesh
johnd
Wed Mar 14 11:11:03 CET 2007
On Wed, 14 Mar 2007, Alex2000deluxe at web.de wrote:
>
> NB7002:~/soft/ffmpeg-r8397 admin$ gdb ffmpeg_g
> GNU gdb 6.3.50-20050815 (Apple version gdb-563) (Wed Jul 19 05:10:58 GMT 2006)
> Copyright 2004 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-apple-darwin"...Reading symbols for shared libraries ......... done
>
> (gdb) r -i test.avi -y -s pal -r pal -ac 2 -ar 48000 test.avi.dv
> Starting program: /Users/admin/soft/ffmpeg-r8397/ffmpeg_g -i test.avi -y -s pal -r pal -ac 2 -ar 48000 test.avi.dv
> Reading symbols for shared libraries .+++++++ done
> FFmpeg version SVN-r8397, Copyright (c) 2000-2007 Fabrice Bellard, et al.
> configuration: --prefix=/opt/local --disable-vhook --mandir=/opt/local/share/man --extra-cflags=-I/opt/local/include --extra-ldflags=-dynamic -L/opt/local/lib --disable-ffplay --enable-gpl --enable-libmp3lame --enable-libfaac --enable-libfaad --enable-x264 --enable-pthreads --enable-shared
> libavutil version: 49.3.0
> libavcodec version: 51.38.0
> libavformat version: 51.10.0
> built on Mar 14 2007 10:48:38, gcc: 4.0.1 (Apple Computer, Inc. build 5363)
> Input #0, avi, from 'test.avi':
> Duration: 00:00:51.1, start: 0.000000, bitrate: 3726 kb/s
> Stream #0.0: Video: h264, yuv420p, 720x576, 25.00 fps(r)
> Stream #0.1: Audio: mp3, 48000 Hz, stereo, 192 kb/s
> Output #0, dv, to 'test.avi.dv':
> Stream #0.0: Video: dvvideo, yuv420p, 720x576, q=2-31, 200 kb/s, 25.00 fps(c)
> Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
> Stream mapping:
> Stream #0.0 -> #0.0
> Stream #0.1 -> #0.1
> Press [q] to stop encoding
>
> Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
> 0x011416df in ff_fdct_sse2 ()
> (gdb) bt
> #0 0x011416df in ff_fdct_sse2 ()
> #1 0xbfffbe40 in ?? ()
> Previous frame inner to this frame (corrupt stack?)
> (gdb) disass $pc-32 $pc+32
> Dump of assembler code from 0x11416bf to 0x11416ff:
...
> 0x011416df <ff_fdct_sse2+757>: movdqa %xmm1,0(%ecx)
...
> End of assembler dump.
>
> (gdb) info all-registers
> eax 0x13f4d20 20925728
> ecx 0xbfffe968 -1073747608
Oh, I think I've had this one too.
Never got around to submitting a patch because I wanted to explore it
further. (Why doesn't it happen on linux?)
Problem for me was insufficient alignment in DCT block. Patch attached.
{P^/
-------------- next part --------------
Index: dv.c
===================================================================
--- dv.c (revision 8397)
+++ dv.c (working copy)
@@ -842,7 +842,7 @@
uint8_t* data;
uint8_t* ptr;
int do_edge_wrap;
- DECLARE_ALIGNED_8(DCTELEM, block[64]);
+ DECLARE_ALIGNED_16(DCTELEM, block[64]);
EncBlockInfo enc_blks[5*6];
PutBitContext pbs[5*6];
PutBitContext* pb;
@@ -850,7 +850,7 @@
int vs_bit_size = 0;
int qnos[5];
- assert((((int)block) & 7) == 0);
+ assert((((int)block) & 15) == 0);
enc_blk = &enc_blks[0];
pb = &pbs[0];
More information about the ffmpeg-devel
mailing list