ffmpeg gets "Illegal instruction" on Pentium II

Bug #386397 reported by Tricia
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ffmpeg (Debian)
Fix Released
Unknown
ffmpeg (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Karmic by Larry W

Bug Description

Binary package hint: ffmpeg

Tried to create a video out of jpeg frames. Used this command: `ffmpeg -i r%05d.jpg tl.avi`

Came back with this:

FFmpeg version 0.5-svn17737+3:0.svn20090303-1ubuntu6, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --extra-version=svn17737+3:0.svn20090303-1ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --disable-stripping --disable-vhook --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-armvfp --disable-neon --disable-altivec --disable-vis --enable-shared --disable-static
  libavutil 49.15. 0 / 49.15. 0
  libavcodec 52.20. 0 / 52.20. 0
  libavformat 52.31. 0 / 52.31. 0
  libavdevice 52. 1. 0 / 52. 1. 0
  libavfilter 0. 4. 0 / 0. 4. 0
  libswscale 0. 7. 1 / 0. 7. 1
  libpostproc 51. 2. 0 / 51. 2. 0
  built on Apr 10 2009 23:18:41, gcc: 4.3.3
Input #0, image2, from 'r%05d.jpg':
  Duration: 00:06:51.28, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 640x480 [PAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
File 'tl.avi' already exists. Overwrite ? [y/N] y
Output #0, avi, to 'tl.avi':
    Stream #0.0: Video: mpeg4, yuv420p, 640x480 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
Illegal instruction

Using Ubuntu 9.04. ffmpeg package is 3:0.svn20090303-1ubuntu6.

ffmpeg should be configured with runtime cpudetect flag to avoid this problem.

Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 386397] [NEW] ffmpeg gets "Illegal instruction" on Pentium II

Josh <email address hidden> writes:

> Public bug reported:
>
> Binary package hint: ffmpeg
>
> Tried to create a video out of jpeg frames. Used this command: `ffmpeg
> -i r%05d.jpg tl.avi`

can you please create a proper backtrace? I need to know what
instruction is illegal.

please also attach the contents of your /proc/cpuinfo

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

affects: ffmpeg (Ubuntu) → ffmpeg-debian (Ubuntu)
Changed in ffmpeg-debian (Ubuntu):
status: New → Incomplete
Revision history for this message
Tricia (whtiger) wrote :

Sorry for late response, attached is the backtrace from `gdb ffmpeg` and then `r -i r00001.jpg tl.avi`.

(gdb) bt
#0 0xb7fda444 in ?? () from /usr/lib/i686/cmov/libswscale.so.0
#1 0x09ddc960 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) display /i $pc
1: x/i $pc
0xb7fda444: movntq %mm0,(%ecx,%eax,1)

cpuinfo:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 5
model name : Pentium II (Deschutes)
stepping : 2
cpu MHz : 448.053
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr up
bogomips : 896.10
clflush size : 32
power management:

Revision history for this message
biebel (badk666) wrote :

I am experiencing the same problem.

It seems to be related to the architecture and mjpeg handling.

I could transform from h264 avi to flv without a problem, but when trying to extract a frame as jpeg I also got the "Illegal instruction" error:
ffmpeg -i Fenix.flv -t 00:00:1 -f mjpeg Fenix.jpg
FFmpeg version 0.5-svn17737+3:0.svn20090303-1ubuntu6, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --extra-version=svn17737+3:0.svn20090303-1ubuntu6 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --disable-stripping --disable-vhook --enable-libdc1394 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-armvfp --disable-neon --disable-altivec --disable-vis --enable-shared --disable-static
  libavutil 49.15. 0 / 49.15. 0
  libavcodec 52.20. 0 / 52.20. 0
  libavformat 52.31. 0 / 52.31. 0
  libavdevice 52. 1. 0 / 52. 1. 0
  libavfilter 0. 4. 0 / 0. 4. 0
  libswscale 0. 7. 1 / 0. 7. 1
  libpostproc 51. 2. 0 / 51. 2. 0
  built on Apr 10 2009 23:18:41, gcc: 4.3.3

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 50.42 (605/12)
Input #0, flv, from 'Fenix.flv':
  Duration: 00:00:33.30, start: 0.000000, bitrate: 1000 kb/s
    Stream #0.0: Video: flv, yuv420p, 640x480, 1000 kb/s, 50.42 tbr, 1k tbn, 1k tbc
Output #0, mjpeg, to 'Fenix.jpg':
    Stream #0.0: Video: mjpeg, yuvj420p, 640x480, q=2-31, 200 kb/s, 90k tbn, 50.42 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
Illegal instruction

Assuming Josh's backtrace is a proper one (never done one before) here is my output after press [q]...:
[New Thread 0xb6e096c0 (LWP 4504)]

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0xb6e096c0 (LWP 4504)]
0xb802a714 in ?? () from /usr/lib/libswscale.so.0

and /proc/cpuinfo

processor : 0
vendor_id : GenuineIntel
cpu family : 5
model : 4
model name : Pentium MMX
stepping : 3
cpu MHz : 233.859
cache size : 0 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : yes
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr mce cx8 mmx up
bogomips : 467.71
clflush size : 32
power management:

Running the same command on the same file on my amd 64x x2 works as it should.

Revision history for this message
Reinhard Tartler (siretart) wrote :

this bug seems is valid to me

it seems that mplayer is using a newer version of MMX than is supported on Pentium II machines. As easy workaround, you can move /usr/lib/i686/cmov/libswscale.so.0 out of the way.

Changed in ffmpeg-debian (Ubuntu):
importance: Undecided → Medium
status: Incomplete → Confirmed
affects: ffmpeg-debian (Ubuntu) → ffmpeg (Ubuntu)
Changed in ffmpeg (Debian):
status: Unknown → New
Changed in ffmpeg (Debian):
status: New → Fix Released
Revision history for this message
Dylan Aïssi (daissi) wrote :

Fixed in Lucid

Changed in ffmpeg (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.