Opened 13 years ago

Closed 13 years ago

#219 closed defect (fixed)

ffmpeg.c crashes for more than 100 output streams

Reported by: Michi Owned by: Michael Niedermayer
Priority: minor Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I get an bus error while converting 474 images á 32kb with the following cmd-line:

ffmpeg -f image2 -i *.jpg ./a.mp4

Result:

FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Apr 27 2011 00:26:39 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
  configuration: --disable-debug --prefix=/usr/local/Cellar/ffmpeg/0.6.1 --enable-shared --enable-pthreads --enable-nonfree --enable-gpl --disable-indev=jack --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libfaad
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
Input #0, image2, from 'img001.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 640x480, 25 tbr, 25 tbn, 25 tbc
[1]    29252 bus error  ffmpeg -f image2 -i *.jpg ./a.mp4

Any ideas what's causing this error and how to get around it? Google wasn't much of a help. I'll attach a sample jpg file.

Attachments (1)

img001.jpg (32.1 KB ) - added by Michi 13 years ago.
Sample JPG file

Download all attachments as: .zip

Change History (7)

by Michi, 13 years ago

Attachment: img001.jpg added

Sample JPG file

comment:1 by Carl Eugen Hoyos, 13 years ago

Please test a newer version and please provide backtrace for crashes as explained on http://ffmpeg.org/bugreports.html

comment:2 by Michi, 13 years ago

ok, so I downloaded the latest git repository (Mai, 18th) and compiled it on my mac which gives me a version of UNKNOWN btw. Here we go with the crash report:

GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
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 "x86_64-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) r -f image2 -i ./tmp/*.jpg ./a.mp4
Starting program: /usr/local/bin/ffmpeg -f image2 -i ./tmp/*.jpg ./a.mp4
Reading symbols for shared libraries +++. done
ffmpeg version UNKNOWN, Copyright (c) 2000-2011 the FFmpeg developers

built on May 18 2011 19:12:57 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
configuration:
libavutil 51. 2. 1 / 51. 2. 1
libavcodec 53. 6. 0 / 53. 6. 0
libavformat 53. 1. 0 / 53. 1. 0
libavdevice 53. 0. 0 / 53. 0. 0
libavfilter 2. 5. 0 / 2. 5. 0
libswscale 0. 14. 0 / 0. 14. 0

Input #0, image2, from './tmp/img001.jpg':

Duration: 00:00:00.04, start: 0.000000, bitrate: N/A

Stream #0.0: Video: mjpeg, yuvj420p, 640x480, 25 tbr, 25 tbn, 25 tbc

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000000100005cb2 in start ()
(gdb) bt
#0 0x0000000100005cb2 in start ()
(gdb) disass $pc-32 $pc+32
Dump of assembler code from 0x100005c92 to 0x100005cd2:
0x0000000100005c92 <start+20114>: add %al,(%rax)
0x0000000100005c94 <start+20116>: add %ch,%al
0x0000000100005c96 <start+20118>: out %al,$0xef
0x0000000100005c98 <start+20120>: (bad)
0x0000000100005c99 <start+20121>: decl -0x77(%rcx)
0x0000000100005c9c <start+20124>: (bad)
0x0000000100005c9d <start+20125>: mov %rax,0x0(%r13,%rbx,8)
0x0000000100005ca2 <start+20130>: mov $0x240,%edi
0x0000000100005ca7 <start+20135>: callq 0x10052f330 <av_mallocz>
0x0000000100005cac <start+20140>: mov %rax,%rbx
0x0000000100005caf <start+20143>: movslq %ebp,%rax
0x0000000100005cb2 <start+20146>: mov %rbx,(%r12,%rax,8)
0x0000000100005cb6 <start+20150>: test %rbx,%rbx
0x0000000100005cb9 <start+20153>: je 0x100005d00 <start+20224>
0x0000000100005cbb <start+20155>: mov %r14d,(%rbx)
0x0000000100005cbe <start+20158>: mov %ebp,0x4(%rbx)
0x0000000100005cc1 <start+20161>: xor %edx,%edx
0x0000000100005cc3 <start+20163>: lea 0x53145d(%rip),%rsi # 0x100537127
0x0000000100005cca <start+20170>: lea 0x6ec7af(%rip),%rax # 0x1006f2480 <sws_opts>
0x0000000100005cd1 <start+20177>: mov (%rax),%rdi
End of assembler dump.
(gdb) info all-registers
rax 0x0 0
rbx 0x100d1f480 4308726912
rcx 0x0 0
rdx 0x240 576
rsi 0x0 0
rdi 0x100d1f6c0 4308727488
rbp 0x0 0x0
rsp 0x7fff5fbf7db0 0x7fff5fbf7db0
r8 0x0 0
r9 0x100d1f460 4308726880
r10 0x0 0
r11 0x100d1f480 4308726912
r12 0x0 0
r13 0x10079f260 4302959200
r14 0x68 104
r15 0x0 0
rip 0x100005cb2 0x100005cb2 <start+20146>
eflags 0x10202 66050
cs 0x27 39
ss 0x0 0
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
st0 -nan(0x7f7f7f7f7f7f7f7f) (raw 0xffff7f7f7f7f7f7f7f7f)
st1 -nan(0x7f007f007f007f) (raw 0xffff007f007f007f007f)
st2 -nan(0x7f7f7f7f7f7f7f7f) (raw 0xffff7f7f7f7f7f7f7f7f)
st3 -nan(0x7f007f007f007f) (raw 0xffff007f007f007f007f)
st4 1 (raw 0x3fff8000000000000000)
st5 0.99895315831621804195496541756149611 (raw 0x3ffeffbb64e9343dbabd)
st6 0.0020914946669737078490037456360295387 (raw 0x3ff689117531c4e2b988)
st7 -46.051701859880913733635843243519048 (raw 0xc004b834f1551552d72c)
fctrl 0x37f 895
fstat 0x220 544
ftag 0xffff 65535
fiseg 0x27 39
fioff 0x854d2572 -2058541710
foseg 0x1f 31
fooff 0x5fbf7cd8 1606384856
fop 0x51c 1308
xmm0 {

v4_float = {0, 0, 0, 0},
v2_double = {0, 0},
v16_int8 = {0 <repeats 16 times>},
v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
v4_int32 = {0, 0, 0, 0},
v2_int64 = {0, 0},
uint128 = 0

} (raw 0x00000000000000000000000000000000)
xmm1 {

v4_float = {0, 0, 0, 0},
v2_double = {0, 0},
v16_int8 = {0 <repeats 16 times>},
v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
v4_int32 = {0, 0, 0, 0},
v2_int64 = {0, 0},
uint128 = 0

} (raw 0x00000000000000000000000000000000)
xmm2 {

v4_float = {-nan(0x7fffff), -nan(0x7fffff), 1.875, 0},
v2_double = {-nan(0xfffffffffffff), 1},
v16_int8 = {-1, -1, -1, -1, -1, -1, -1, -1, 63, -16, 0, 0, 0, 0, 0, 0},
v8_int16 = {-1, -1, -1, -1, 16368, 0, 0, 0},
v4_int32 = {-1, -1, 1072693248, 0},
v2_int64 = {-1, 4607182418800017408},
uint128 = 0xffffffffffffffff3ff0000000000000

} (raw 0x000000000000f03fffffffffffffffff)
xmm3 {

v4_float = {0, 0, 1.875, 0},
v2_double = {0, 1},
v16_int8 = {0, 0, 0, 0, 0, 0, 0, 0, 63, -16, 0, 0, 0, 0, 0, 0},
v8_int16 = {0, 0, 0, 0, 16368, 0, 0, 0},
v4_int32 = {0, 0, 1072693248, 0},
v2_int64 = {0, 4607182418800017408},
uint128 = 61503

} (raw 0x000000000000f03f0000000000000000)
xmm4 {

v4_float = {0, 0, 0, 0},
v2_double = {0, 0},
v16_int8 = {0 <repeats 16 times>},
v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
v4_int32 = {0, 0, 0, 0},
v2_int64 = {0, 0},
uint128 = 0

} (raw 0x00000000000000000000000000000000)
xmm5 {

v4_float = {2.79450204e+20, 45993108, 1.16307773e-43, 3221.14087},
v2_double = {2.5846849126832884e+161, 1.7669996890498162e-312},
v16_int8 = {97, 114, 98, 105, 76, 47, 115, 37, 0, 0, 0, 83, 69, 73, 82, 65},
v8_int16 = {24946, 25193, 19503, 29477, 0, 83, 17737, 21057},
v4_int32 = {1634886249, 1278178085, 83, 1162433089},
v2_int64 = {7021782973413290789, 357644718657},
uint128 = 0x617262694c2f73250000005345495241

} (raw 0x415249455300000025732f4c69627261)
xmm6 {

v4_float = {0, 0, 0.519702733, 3.49028971e+16},
v2_double = {0, 4.0138063351236042e-05},
v16_int8 = {0, 0, 0, 0, 0, 0, 0, 0, 63, 5, 11, 61, 90, -8, 0, 0},
v8_int16 = {0, 0, 0, 0, 16133, 2877, 23288, 0},
v4_int32 = {0, 0, 1057295165, 1526202368},
v2_int64 = {0, 4541048157420126208},
uint128 = 273066454877503

} (raw 0x0000f85a3d0b053f0000000000000000)
xmm7 {

v4_float = {0, 0, 1.90625, 0},
v2_double = {0, 1.25},
v16_int8 = {0, 0, 0, 0, 0, 0, 0, 0, 63, -12, 0, 0, 0, 0, 0, 0},
v8_int16 = {0, 0, 0, 0, 16372, 0, 0, 0},
v4_int32 = {0, 0, 1072955392, 0},
v2_int64 = {0, 4608308318706860032},
uint128 = 62527

} (raw 0x000000000000f43f0000000000000000)
xmm8 {

v4_float = {0, 0, -1.62499988, 3.68934881e+19},
v2_double = {0, -0.24999992549419403},
v16_int8 = {0, 0, 0, 0, 0, 0, 0, 0, -65, -49, -1, -1, 96, 0, 0, 0},
v8_int16 = {0, 0, 0, 0, -16433, -1, 24576, 0},
v4_int32 = {0, 0, -1076887553, 1610612736},
v2_int64 = {0, -4625196819993853952},
uint128 = 416611815359

} (raw 0x00000060ffffcfbf0000000000000000)
xmm9 {

v4_float = {-nan(0x7fffff), 9.18340949e-41, -nan(0x7fffff), -nan(0x7fffff)},
v2_double = {-nan(0xfffff0000ffff), -nan(0xfffffffffffff)},
v16_int8 = {-1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
v8_int16 = {-1, -1, 0, -1, -1, -1, -1, -1},
v4_int32 = {-1, 65535, -1, -1},
v2_int64 = {-4294901761, -1},
uint128 = 0xffffffff0000ffffffffffffffffffff

} (raw 0xffffffffffffffffffff0000ffffffff)
xmm10 {

v4_float = {-nan(0x7f0000), -nan(0x7fffff), -nan(0x7fffff), -nan(0x7fffff)},
v2_double = {-nan(0xf0000ffffffff), -nan(0xfffffffffffff)},
v16_int8 = {-1, -1, 0, 0, -1 <repeats 12 times>},
v8_int16 = {-1, 0, -1, -1, -1, -1, -1, -1},
v4_int32 = {-65536, -1, -1, -1},
v2_int64 = {-281470681743361, -1},
uint128 = 0xffff0000ffffffffffffffffffffffff

} (raw 0xffffffffffffffffffffffff0000ffff)
xmm11 {

v4_float = {-nan(0x7fffff), 0, -nan(0x7fffff), -nan(0x7fffff)},
v2_double = {-nan(0xfffff00000000), -nan(0xfffffffffffff)},
v16_int8 = {-1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1},
v8_int16 = {-1, -1, 0, 0, -1, -1, -1, -1},
v4_int32 = {-1, 0, -1, -1},
v2_int64 = {-4294967296, -1},
uint128 = 0xffffffff00000000ffffffffffffffff

} (raw 0xffffffffffffffff00000000ffffffff)
xmm12 {

v4_float = {-nan(0x7fffff), 0, -nan(0x7fffff), -nan(0x7fffff)},
v2_double = {-nan(0xfffff00000000), -nan(0xfffffffffffff)},
v16_int8 = {-1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1},
v8_int16 = {-1, -1, 0, 0, -1, -1, -1, -1},
v4_int32 = {-1, 0, -1, -1},
v2_int64 = {-4294967296, -1},
uint128 = 0xffffffff00000000ffffffffffffffff

} (raw 0xffffffffffffffff00000000ffffffff)
xmm13 {

v4_float = {-nan(0x7f0000), -nan(0x7fffff), -nan(0x7fffff), -nan(0x7fffff)},
v2_double = {-nan(0xf0000ffffffff), -nan(0xfffffffffffff)},
v16_int8 = {-1, -1, 0, 0, -1 <repeats 12 times>},
v8_int16 = {-1, 0, -1, -1, -1, -1, -1, -1},
v4_int32 = {-65536, -1, -1, -1},
v2_int64 = {-281470681743361, -1},
uint128 = 0xffff0000ffffffffffffffffffffffff

} (raw 0xffffffffffffffffffffffff0000ffff)
xmm14 {

v4_float = {-nan(0x7f0000), -nan(0x7fffff), -nan(0x7fffff), -nan(0x7fffff)},
v2_double = {-nan(0xf0000ffffffff), -nan(0xfffffffffffff)},
v16_int8 = {-1, -1, 0, 0, -1 <repeats 12 times>},
v8_int16 = {-1, 0, -1, -1, -1, -1, -1, -1},
v4_int32 = {-65536, -1, -1, -1},
v2_int64 = {-281470681743361, -1},
uint128 = 0xffff0000ffffffffffffffffffffffff

} (raw 0xffffffffffffffffffffffff0000ffff)
xmm15 {

v4_float = {-nan(0x7fffff), 9.18340949e-41, -nan(0x7fffff), -nan(0x7fffff)},
v2_double = {-nan(0xfffff0000ffff), -nan(0xfffffffffffff)},
v16_int8 = {-1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
v8_int16 = {-1, -1, 0, -1, -1, -1, -1, -1},
v4_int32 = {-1, 65535, -1, -1},
v2_int64 = {-4294901761, -1},
uint128 = 0xffffffff0000ffffffffffffffffffff

} (raw 0xffffffffffffffffffff0000ffffffff)
mxcsr 0x1fa0 8096
(gdb)

Compiled on a
2,4 GHz Intel Core 2 Duo
4gb RAM
MacOS 10.6.7
i686-apple-darwin10-gcc-4.2.1

Hope that helps.

Version 0, edited 13 years ago by Michi (next)

comment:3 by Carl Eugen Hoyos, 13 years ago

Component: FFmpegundetermined
Status: newopen
Version: unspecifiedgit-master

To produce a useful back-trace, please use ffmpeg_g instead of ffmpeg, as explained on http://ffmpeg.org/bugreports.html

comment:5 by Carl Eugen Hoyos, 13 years ago

Component: undeterminedFFmpeg
Priority: normalminor
Reproduced by developer: set
Summary: Bus error while converting images into a movieffmpeg.c crashes for more than 100 output streams

The correct syntax for your use-case is

ffmpeg -i img%03d.jpg a.mp4

comment:6 by Michael Niedermayer, 13 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.