[Ffmpeg-devel] Seeming problem with mpegaudiodec.c

jason at cubedthree.com jason
Tue Sep 19 01:51:16 CEST 2006


There seems to be a problem with mpegaudiodec.c.  Here's why:

1) I tried to transcode an mpeg file to a flv file
2) I received the error message while encoding: Floating point exception
3) The command line I used during this was: # ffmpeg -i test1.mpeg test1.flv
4) The console output I received was this:

==================================================
# ffmpeg -i test1.mpeg test1.flv
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --enable-mp3lame --enable-amr_nb --enable-amr_nb-fixed
--enable-amr_wb --enable-amr_if2
  libavutil version: 49.0.0
  libavcodec version: 51.14.0
  libavformat version: 50.5.0
  built on Sep 18 2006 17:22:26, gcc: 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0,
pie-8.7.9)
Input #0, mpeg, from 'test1.mpeg':
  Duration: 00:00:07.5, start: 0.204244, bitrate: 1818 kb/s
  Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320x240, 1500 kb/s, 29.97
fps(r)
  Stream #0.1[0x1c0]: Audio: mp2, 32000 Hz, mono, 48 kb/s
Output #0, flv, to 'test1.flv':
  Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 29.97 fps(c)
  Stream #0.1: Audio: mp3, 32000 Hz, mono, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Floating point exception
==================================================

5) Running gdb as requested, I received the following:

==================================================
lifeoutsystems ~ # gdb ffmpeg_g
GNU gdb 6.4
Copyright 2005 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 "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) r -i test1.mpeg test1.flv
Starting program: /usr/local/bin/ffmpeg_g -i test1.mpeg test1.flv
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --enable-mp3lame --enable-amr_nb --enable-amr_nb-fixed
--enable-amr_wb --enable-amr_if2
  libavutil version: 49.0.0
  libavcodec version: 51.14.0
  libavformat version: 50.5.0
  built on Sep 18 2006 17:22:26, gcc: 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0,
pie-8.7.9)
Input #0, mpeg, from 'test1.mpeg':
  Duration: 00:00:07.5, start: 0.204244, bitrate: 1818 kb/s
  Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320x240, 1500 kb/s, 29.97
fps(r)
  Stream #0.1[0x1c0]: Audio: mp2, 32000 Hz, mono, 48 kb/s
Output #0, flv, to 'test1.flv':
  Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 200 kb/s, 29.97 fps(c)
  Stream #0.1: Audio: mp3, 32000 Hz, mono, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1

Program received signal SIGFPE, Arithmetic exception.
0x081897e1 in decode_init (avctx=0x8497660) at mpegaudiodec.c:430
430             for(i=0; i<512*16; i++){
(gdb) bt
#0  0x081897e1 in decode_init (avctx=0x8497660) at mpegaudiodec.c:430
#1  0x080c2f9f in avcodec_open (avctx=0x8497660, codec=0x840a380)
    at utils.c:858
#2  0x08065561 in main (argc=139040960, argv=0x1) at ffmpeg.c:1775
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0x81897c1 to 0x8189801:
0x081897c1 <decode_init+2273>:  test   %bl,0x0(%edx)
0x081897c4 <decode_init+2276>:  add    %ch,%bl
0x081897c6 <decode_init+2278>:  fimul  0xfff9c49d(%ebx)
0x081897cc <decode_init+2284>:  (bad)
0x081897cd <decode_init+2285>:  mov    $0x818bbb0,%esi
0x081897d2 <decode_init+2290>:  mov    %esi,0x5a80(%ebx)
0x081897d8 <decode_init+2296>:  jmp    0x8188f1d <decode_init+61>
0x081897dd <decode_init+2301>:  xor    %edi,%edi
0x081897df <decode_init+2303>:  jmp    0x81897f0 <decode_init+2320>
0x081897e1 <decode_init+2305>:  fstp   %st(0)
0x081897e3 <decode_init+2307>:  inc    %edi
0x081897e4 <decode_init+2308>:  cmp    $0x1fff,%edi
0x081897ea <decode_init+2314>:  jg     0x818940d <decode_init+1325>
0x081897f0 <decode_init+2320>:  fldl   0x8383580
0x081897f6 <decode_init+2326>:  mov    %edi,%ebx
0x081897f8 <decode_init+2328>:  mov    %edi,%esi
0x081897fa <decode_init+2330>:  and    $0xf,%ebx
0x081897fd <decode_init+2333>:  sar    $0x4,%esi
0x08189800 <decode_init+2336>:  fstpl  0x8(%esp)
End of assembler dump.
(gdb) info all-registers
eax            0x1      1
ecx            0x188e   6286
edx            0x7a44f780       2051340160
ebx            0xd      13
esp            0xbfffe9a0       0xbfffe9a0
ebp            0xbffff088       0xbffff088
esi            0x188    392
edi            0x188e   6286
eip            0x81897e1        0x81897e1 <decode_init+2305>
eflags         0x10202  66050
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x0      0
st0            2264386816       (raw 0x401e86f7cd0000000000)
st1            2264386816       (raw 0x401e86f7cd0000000000)
st2            -nan(0x878d949899999a9b) (raw 0xffff878d949899999a9b)
st3            -nan(0x87008d00940098)   (raw 0xffff0087008d00940098)
st4            -nan(0x888d949897979798) (raw 0xffff888d949897979798)
st5            1        (raw 0x3fff8000000000000000)
st6            13       (raw 0x4002d000000000000000)
st7            26       (raw 0x4003d000000000000000)
fctrl          0x372    882
fstat          0xf0a1   61601
ftag           0xfff    4095
fiseg          0x73     115
fioff          0x818986c        135829612
foseg          0x7b     123
fooff          0xbfffea64       -1073747356
fop            0x39d    925
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm1           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}
mxcsr          0x1f80   8064
mm0            {uint64 = 0xd000000000000000, v2_int32 = {0x0, 0xd0000000},
  v4_int16 = {0x0, 0x0, 0x0, 0xd000}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0,
    0x0, 0xd0}}
mm1            {uint64 = 0xd000000000000000, v2_int32 = {0x0, 0xd0000000},
  v4_int16 = {0x0, 0x0, 0x0, 0xd000}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0,
    0x0, 0xd0}}
mm2            {uint64 = 0x86f7cd0000000000, v2_int32 = {0x0, 0x86f7cd00},
  v4_int16 = {0x0, 0x0, 0xcd00, 0x86f7}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0xcd, 0xf7, 0x86}}
mm3            {uint64 = 0x86f7cd0000000000, v2_int32 = {0x0, 0x86f7cd00},
  v4_int16 = {0x0, 0x0, 0xcd00, 0x86f7}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0xcd, 0xf7, 0x86}}
mm4            {uint64 = 0x878d949899999a9b, v2_int32 = {0x99999a9b,
    0x878d9498}, v4_int16 = {0x9a9b, 0x9999, 0x9498, 0x878d}, v8_int8 =
{0x9b,
    0x9a, 0x99, 0x99, 0x98, 0x94, 0x8d, 0x87}}
mm5            {uint64 = 0x87008d00940098, v2_int32 = {0x940098, 0x87008d},
  v4_int16 = {0x98, 0x94, 0x8d, 0x87}, v8_int8 = {0x98, 0x0, 0x94, 0x0,
0x8d,
    0x0, 0x87, 0x0}}
mm6            {uint64 = 0x888d949897979798, v2_int32 = {0x97979798,
    0x888d9498}, v4_int16 = {0x9798, 0x9797, 0x9498, 0x888d}, v8_int8 =
{0x98,
    0x97, 0x97, 0x97, 0x98, 0x94, 0x8d, 0x88}}
mm7            {uint64 = 0x8000000000000000, v2_int32 = {0x0, 0x80000000},
  v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0,
    0x0, 0x80}}
==================================================

6) So... knowing enough about software to get myself into trouble (and being
a software engineer doesn't hurt)... I noticed the problem being at
(mpegaudiodec.c:430).  So I tracked back through the subversion blame
history and found that this was changed at revision 6082.  Well, I
downloaded that version, and recompiled.  Same error, but a couple lines
down.  So I tracked back one more revision to 6081.  Downloaded, compiled,
and voila ... it worked.

I won't begin to actually try to decipher the code and figure out the
problem... I'll leave that to the experts.  But hopefully that can provide
you guys with enough information to work out a bug.  :-)

Let me know if you have any questions or need anything else from me.

Thanks!





More information about the ffmpeg-devel mailing list