Opened 4 years ago

Last modified 3 years ago

#3675 new defect

Crash while trying to feed to ffserver

Reported by: Zmey_ Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: crash SIGSEGV
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I am trying to use ffserver + ffmpeg to stream video from my webcam. When i am trying to feed from ffmpeg to ffserver i am getting a segmentation fault.
Run with report:

➜ cat ffmpeg-20140526-174953.log 
ffmpeg started on 2014-05-26 at 17:49:53
Report written to "ffmpeg-20140526-174953.log"
Command line:
ffmpeg -report -v debug -f video4linux2 -i /dev/video0 http://localhost:3516/feed1.ffm
ffmpeg version N-63439-g96470ca Copyright (c) 2000-2014 the FFmpeg developers
  built on May 26 2014 15:02:57 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-lto --enable-gpl --enable-libx264 --enable-libmp3lame --enable-gnutls --enable-libvpx --enable-openssl --enable-nonfree
  libavutil      52. 86.100 / 52. 86.100
  libavcodec     55. 65.100 / 55. 65.100
  libavformat    55. 41.100 / 55. 41.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  5.100 /  4.  5.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'video4linux2'.
Reading option '-i' ... matched as input file with argument '/dev/video0'.
Reading option 'http://localhost:3516/feed1.ffm' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file /dev/video0.
Applying option f (force format) with argument video4linux2.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[video4linux2,v4l2 @ 0xb4385a0] fd:5 capabilities:84000001
[video4linux2,v4l2 @ 0xb4385a0] Current input_channel: 0, input_name: Camera 1, input_std: 0
[video4linux2,v4l2 @ 0xb4385a0] Querying the device for the current frame size
[video4linux2,v4l2 @ 0xb4385a0] Setting frame size to 864x480
[video4linux2,v4l2 @ 0xb4385a0] The V4L2 driver changed the pixel format from 0x32315559 to 0x47504A4D
[video4linux2,v4l2 @ 0xb4385a0] Trying to set codec:rawvideo pix_fmt:yuv420p
[video4linux2,v4l2 @ 0xb4385a0] The V4L2 driver changed the pixel format from 0x32315559 to 0x47504A4D
[video4linux2,v4l2 @ 0xb4385a0] Trying to set codec:rawvideo pix_fmt:yuv420p
[video4linux2,v4l2 @ 0xb4385a0] The V4L2 driver changed the pixel format from 0x32315659 to 0x47504A4D
[video4linux2,v4l2 @ 0xb4385a0] Trying to set codec:rawvideo pix_fmt:yuv422p
[video4linux2,v4l2 @ 0xb4385a0] The V4L2 driver changed the pixel format from 0x50323234 to 0x47504A4D
[video4linux2,v4l2 @ 0xb4385a0] Trying to set codec:rawvideo pix_fmt:yuyv422
[video4linux2,v4l2 @ 0xb4385a0] All info found
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 74336.659163, bitrate: 132710 kb/s
    Stream #0:0, 1, 1/1000000: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 864x480, 1/1000000, 132710 kb/s, 20 fps, 20 tbr, 1000k tbn, 1000k tbc
Successfully opened the file.
Parsing a group of options: output file http://localhost:3516/feed1.ffm.
Successfully parsed a group of options.
Opening an output file: http://localhost:3516/feed1.ffm.
[tcp @ 0xb439380] Connection to tcp://localhost:3516 failed (Connection refused), trying next address
[http @ 0xb437cc0] request: GET /feed1.ffm HTTP/1.1
User-Agent: Lavf/55.41.100
Accept: */*
Range: bytes=0-
Connection: close
Host: localhost:3516


[http @ 0xb437cc0] header='HTTP/1.0 200 OK'
[http @ 0xb437cc0] http_code=200
[http @ 0xb437cc0] header='Pragma: no-cache'
[http @ 0xb437cc0] header='Content-Type: application/x-octet-stream'
[http @ 0xb437cc0] header=''
[ffm @ 0xb447320] Format ffm probed with size=2048 and score=101
[AVIOContext @ 0xb439b20] Statistics: 4096 bytes read, 0 seeks
[tcp @ 0xb439380] Connection to tcp://localhost:3516 failed (Connection refused), trying next address
[http @ 0xb437cc0] request: POST /feed1.ffm HTTP/1.1
Transfer-Encoding: chunked
User-Agent: Lavf/55.41.100
Accept: */*
Connection: close
Host: localhost:3516


Successfully opened the file.
detected 2 logical cores
[graph 0 input from stream 0:0 @ 0xb4370e0] Setting 'video_size' to value '864x480'
[graph 0 input from stream 0:0 @ 0xb4370e0] Setting 'pix_fmt' to value '1'
[graph 0 input from stream 0:0 @ 0xb4370e0] Setting 'time_base' to value '1/1000000'
[graph 0 input from stream 0:0 @ 0xb4370e0] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 0xb4370e0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0xb4370e0] Setting 'frame_rate' to value '20/1'
[graph 0 input from stream 0:0 @ 0xb4370e0] w:864 h:480 pixfmt:yuyv422 tb:1/1000000 fr:20/1 sar:0/1 sws_param:flags=2
[scaler for output stream 0:0 @ 0xb4376a0] Setting 'w' to value '864'
[scaler for output stream 0:0 @ 0xb4376a0] Setting 'h' to value '480'
[scaler for output stream 0:0 @ 0xb4376a0] Setting 'flags' to value '0x4'
[scaler for output stream 0:0 @ 0xb4376a0] w:864 h:480 flags:'0x4' interl:0
[format @ 0xb4305c0] compat: called with args=[yuv420p]
[format @ 0xb4305c0] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0xb4379e0] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
[scaler for output stream 0:0 @ 0xb4376a0] w:864 h:480 fmt:yuyv422 sar:0/1 -> w:864 h:480 fmt:yuv420p sar:0/1 flags:0x4
[graph 1 input from stream 0:0 @ 0xb4368e0] Setting 'video_size' to value '864x480'
[graph 1 input from stream 0:0 @ 0xb4368e0] Setting 'pix_fmt' to value '1'
[graph 1 input from stream 0:0 @ 0xb4368e0] Setting 'time_base' to value '1/1000000'
[graph 1 input from stream 0:0 @ 0xb4368e0] Setting 'pixel_aspect' to value '0/1'
[graph 1 input from stream 0:0 @ 0xb4368e0] Setting 'sws_param' to value 'flags=2'
[graph 1 input from stream 0:0 @ 0xb4368e0] Setting 'frame_rate' to value '20/1'
[graph 1 input from stream 0:0 @ 0xb4368e0] w:864 h:480 pixfmt:yuyv422 tb:1/1000000 fr:20/1 sar:0/1 sws_param:flags=2
[scaler for output stream 0:1 @ 0xb4401a0] Setting 'w' to value '864'
[scaler for output stream 0:1 @ 0xb4401a0] Setting 'h' to value '480'
[scaler for output stream 0:1 @ 0xb4401a0] Setting 'flags' to value '0x4'
[scaler for output stream 0:1 @ 0xb4401a0] w:864 h:480 flags:'0x4' interl:0
[format @ 0xb440460] compat: called with args=[yuv420p]
[format @ 0xb440460] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0xb438500] query_formats: 5 queried, 4 merged, 0 already done, 0 delayed
[scaler for output stream 0:1 @ 0xb4401a0] w:864 h:480 fmt:yuyv422 sar:0/1 -> w:864 h:480 fmt:yuv420p sar:0/1 flags:0x4
<crahes here>

Info from gdb:

➜ gdb ffmpeg_g
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /root/sources/FFmpeg/ffmpeg_g...done.
(gdb) r -f video4linux2 -i /dev/video0  http://localhost:3516/feed1.ffm
Starting program: /root/sources/FFmpeg/ffmpeg_g -f video4linux2 -i /dev/video0  http://localhost:3516/feed1.ffm
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
ffmpeg version N-63439-g96470ca Copyright (c) 2000-2014 the FFmpeg developers
  built on May 26 2014 15:02:57 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-lto --enable-gpl --enable-libx264 --enable-libmp3lame --enable-gnutls --enable-libvpx --enable-openssl --enable-nonfree
  libavutil      52. 86.100 / 52. 86.100
  libavcodec     55. 65.100 / 55. 65.100
  libavformat    55. 41.100 / 55. 41.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  5.100 /  4.  5.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 74811.511508, bitrate: 132710 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 864x480, 132710 kb/s, 20 fps, 20 tbr, 1000k tbn, 1000k tbc
[tcp @ 0x94a3560] Connection to tcp://localhost:3516 failed (Connection refused), trying next address
[New Thread 0xb54a1b40 (LWP 6203)]
[New Thread 0xb4ca0b40 (LWP 6204)]
[New Thread 0xb449fb40 (LWP 6205)]
[New Thread 0xb3c9eb40 (LWP 6206)]
[New Thread 0xb349db40 (LWP 6207)]
[New Thread 0xb2c9cb40 (LWP 6208)]

Program received signal SIGSEGV, Segmentation fault.
0x0845bb23 in av_opt_find2 ()
(gdb) bt
#0  0x0845bb23 in av_opt_find2 ()
#1  0x083832f1 in av_opt_set ()
#2  0x0838707a in av_opt_set_dict2 ()
#3  0x083873b9 in avcodec_open2 ()
#4  0x086d54e1 in transcode_init.8550 ()
#5  0x080bc612 in main ()
(gdb) disass $pc-32,$pc+32
Dump of assembler code from 0x845bb03 to 0x845bb43:
   0x0845bb03 <av_opt_find2+227>:	add    %cl,-0x7effd98c(%ebp)
   0x0845bb09 <av_opt_find2+233>:	jnp    0x845bb17 <av_opt_find2+247>
   0x0845bb0b <av_opt_find2+235>:	addb   $0x0,(%eax)
   0x0845bb0e <av_opt_find2+238>:	add    %dh,-0x32(%ebp)
   0x0845bb11 <av_opt_find2+241>:	lea    0x0(%esi,%eiz,1),%esi
   0x0845bb18 <av_opt_find2+248>:	test   %ebx,%ebx
   0x0845bb1a <av_opt_find2+250>:	jne    0x845bb50 <av_opt_find2+304>
   0x0845bb1c <av_opt_find2+252>:	cmpb   $0x0,0x17(%esp)
   0x0845bb21 <av_opt_find2+257>:	je     0x845bb50 <av_opt_find2+304>
=> 0x0845bb23 <av_opt_find2+259>:	mov    0x8(%ebp),%ecx
   0x0845bb26 <av_opt_find2+262>:	test   %ecx,%ecx
   0x0845bb28 <av_opt_find2+264>:	je     0x845bb50 <av_opt_find2+304>
   0x0845bb2a <av_opt_find2+266>:	mov    (%ecx),%eax
   0x0845bb2c <av_opt_find2+268>:	test   %eax,%eax
   0x0845bb2e <av_opt_find2+270>:	je     0x845bb50 <av_opt_find2+304>
   0x0845bb30 <av_opt_find2+272>:	mov    %ecx,%ebx
   0x0845bb32 <av_opt_find2+274>:	mov    %esi,0x4(%esp)
   0x0845bb36 <av_opt_find2+278>:	mov    %eax,(%esp)
   0x0845bb39 <av_opt_find2+281>:	call   0x804d2d0 <strcmp@plt>
   0x0845bb3e <av_opt_find2+286>:	test   %eax,%eax
   0x0845bb40 <av_opt_find2+288>:	jne    0x845bb18 <av_opt_find2+248>
   0x0845bb42 <av_opt_find2+290>:	mov    0x28(%ebx),%eax
End of assembler dump.
(gdb) info all-registers
eax            0x0	0
ecx            0x94b5401	155931649
edx            0x0	0
ebx            0x0	0
esp            0xbfffaad0	0xbfffaad0
ebp            0x1	0x1
esi            0x94b4a70	155929200
edi            0x0	0
eip            0x845bb23	0x845bb23 <av_opt_find2+259>
eflags         0x210202	[ IF RF ID ]
cs             0x73	115
ss             0x7b	123
ds             0x7b	123
es             0x7b	123
fs             0x0	0
gs             0x33	51
st0            -1	(raw 0xbfff8000000000000000)
st1            -1	(raw 0xbfff8000000000000000)
st2            -1	(raw 0xbfff8000000000000000)
st3            -1	(raw 0xbfff8000000000000000)
st4            -1	(raw 0xbfff8000000000000000)
st5            1519964783640576	(raw 0x4031accccc2000000000)
st6            0.00099999999999999999995849538558453928	(raw 0x3ff583126e978d4fdf3b)
st7            0.050000000000000002775557561562891351	(raw 0x3ffaccccccccccccd000)
fctrl          0x37f	895
fstat          0x20	32
ftag           0xffff	65535
fiseg          0x73	115
fioff          0x86d4a9d	141380253
foseg          0x7b	123
fooff          0x0	0
fop            0x5d8	1496
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x8000000000000000}, v16_int8 = {0x0, 0x0, 0x0, 0x0, 
    0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff, 0xff}, v8_int16 = {0x0, 0x0, 0xff, 0x0, 0xff00, 0xffff, 
    0xff00, 0xffff}, v4_int32 = {0x0, 0xff, 0xffffff00, 0xffffff00}, v2_int64 = {0xff00000000, 0xffffff00ffffff00}, 
  uint128 = 0xffffff00ffffff00000000ff00000000}
xmm1           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x61, 0x75, 0x74, 0x6f, 0x0, 0x4a, 
    0x4b, 0x9, 0x10, 0x0, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0}, v8_int16 = {0x7561, 0x6f74, 0x4a00, 0x94b, 0x10, 0x0, 0x41, 0x0}, 
  v4_int32 = {0x6f747561, 0x94b4a00, 0x10, 0x41}, v2_int64 = {0x94b4a006f747561, 0x4100000010}, 
  uint128 = 0x0000004100000010094b4a006f747561}
xmm2           {v4_float = {0x0, 0x0, 0x0, 0xe0000000}, v2_double = {0x8000000000000000, 0x8000000000000000}, v16_int8 = {
    0x6e, 0x6b, 0x0, 0x38, 0x73, 0x76, 0x78, 0x5f, 0x66, 0x69, 0x62, 0x0, 0x38, 0x53, 0x56, 0x58}, v8_int16 = {0x6b6e, 
    0x3800, 0x7673, 0x5f78, 0x6966, 0x62, 0x5338, 0x5856}, v4_int32 = {0x38006b6e, 0x5f787673, 0x626966, 0x58565338}, 
  v2_int64 = {0x5f78767338006b6e, 0x5856533800626966}, uint128 = 0x58565338006269665f78767338006b6e}
xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x36, 0x1, 0x0, 0x0, 0x37, 0x1, 0x0, 
    0x0, 0x38, 0x1, 0x0, 0x0, 0x39, 0x1, 0x0, 0x0}, v8_int16 = {0x136, 0x0, 0x137, 0x0, 0x138, 0x0, 0x139, 0x0}, v4_int32 = {
    0x136, 0x137, 0x138, 0x139}, v2_int64 = {0x13700000136, 0x13900000138}, uint128 = 0x00000139000001380000013700000136}
---Type <return> to continue, or q <return> to quit---
xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x30, 0x1, 0x0, 0x0, 0x31, 0x1, 0x0, 
    0x0, 0x32, 0x1, 0x0, 0x0, 0x33, 0x1, 0x0, 0x0}, v8_int16 = {0x130, 0x0, 0x131, 0x0, 0x132, 0x0, 0x133, 0x0}, v4_int32 = {
    0x130, 0x131, 0x132, 0x133}, v2_int64 = {0x13100000130, 0x13300000132}, uint128 = 0x00000133000001320000013100000130}
xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x3d, 0x1, 0x0, 0x0, 0x3e, 0x1, 0x0, 
    0x0, 0x3f, 0x1, 0x0, 0x0, 0x40, 0x1, 0x0, 0x0}, v8_int16 = {0x13d, 0x0, 0x13e, 0x0, 0x13f, 0x0, 0x140, 0x0}, v4_int32 = {
    0x13d, 0x13e, 0x13f, 0x140}, v2_int64 = {0x13e0000013d, 0x1400000013f}, uint128 = 0x000001400000013f0000013e0000013d}
xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x41, 0x1, 0x0, 0x0, 0x42, 0x1, 0x0, 
    0x0, 0x43, 0x1, 0x0, 0x0, 0x44, 0x1, 0x0, 0x0}, v8_int16 = {0x141, 0x0, 0x142, 0x0, 0x143, 0x0, 0x144, 0x0}, v4_int32 = {
    0x141, 0x142, 0x143, 0x144}, v2_int64 = {0x14200000141, 0x14400000143}, uint128 = 0x00000144000001430000014200000141}
xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x45, 0x1, 0x0, 0x0, 0x46, 0x1, 0x0, 
    0x0, 0x47, 0x1, 0x0, 0x0, 0x48, 0x1, 0x0, 0x0}, v8_int16 = {0x145, 0x0, 0x146, 0x0, 0x147, 0x0, 0x148, 0x0}, v4_int32 = {
    0x145, 0x146, 0x147, 0x148}, v2_int64 = {0x14600000145, 0x14800000147}, uint128 = 0x00000148000001470000014600000145}
mxcsr          0x1f80	[ IM DM ZM OM UM PM ]
mm0            {uint64 = 0x8000000000000000, v2_int32 = {0x0, 0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80}}
mm1            {uint64 = 0x8000000000000000, v2_int32 = {0x0, 0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80}}
mm2            {uint64 = 0x8000000000000000, v2_int32 = {0x0, 0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80}}
mm3            {uint64 = 0x8000000000000000, v2_int32 = {0x0, 0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80}}
mm4            {uint64 = 0x8000000000000000, v2_int32 = {0x0, 0x80000000}, v4_int16 = {0x0, 0x0, 0x0, 0x8000}, v8_int8 = {
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80}}
mm5            {uint64 = 0xaccccc2000000000, v2_int32 = {0x0, 0xaccccc20}, v4_int16 = {0x0, 0x0, 0xcc20, 0xaccc}, v8_int8 = {
    0x0, 0x0, 0x0, 0x0, 0x20, 0xcc, 0xcc, 0xac}}
mm6            {uint64 = 0x83126e978d4fdf3b, v2_int32 = {0x8d4fdf3b, 0x83126e97}, v4_int16 = {0xdf3b, 0x8d4f, 0x6e97, 
    0x8312}, v8_int8 = {0x3b, 0xdf, 0x4f, 0x8d, 0x97, 0x6e, 0x12, 0x83}}
mm7            {uint64 = 0xccccccccccccd000, v2_int32 = {0xccccd000, 0xcccccccc}, v4_int16 = {0xd000, 0xcccc, 0xcccc, 
    0xcccc}, v8_int8 = {0x0, 0xd0, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc}}

Valgrind (did not crashed, killed by Ctrl+C o_O) log is huge (13865 lines), attached as file

Attachments (1)

valgrind.log (953.1 KB) - added by Zmey_ 4 years ago.
Valgrind log

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by Zmey_

Valgrind log

comment:1 Changed 4 years ago by cehoyos

  • Keywords SIGSEGV added; Segmentation fault segfault removed
  • Priority changed from normal to important

comment:2 Changed 3 years ago by michael

Please provide complete information to reproduce the issue, ffserver.conf file, webcam type, ...
also the gdb output is missing line numbers so its not very usefull
is this a regression ?
and a random suggestion would be to try without --enable-lto

Note: See TracTickets for help on using tickets.