[FFmpeg-user] Segmentation fault with tee and fifo muxers
Moritz Barsnick
barsnick at gmx.net
Sun Nov 6 23:31:42 EET 2016
On Sun, Nov 06, 2016 at 23:20:28 +0300, Maxim Kozlov wrote:
> Native encoder?
An encoder implemented by ffmpeg, instead of a library such as libx264.
So something like mpeg4 or mpeg2video.
> Here is strace with testsrc in input and 2 rtmp outputs.
strace probably isn't that useful, a backtrace as generated by gdb
would be desired.
That said, I could reproduce this issue. I stripped down the command
line, dropping audio, dropping the video filter, using a different
codec:
$ ./ffmpeg_g -re -f lavfi -i testsrc -vcodec mpeg2video -map 0 -f tee "[f=fifo:onfail=ignore:fifo_format=flv]rtmp://host2/live/stream|[f=fifo:onfail=ignore:fifo_format=flv]rtmp://host1/live/strean"
Now, it works most of the time, sometimes it segfaults, sometimes I get
a "double free or corruption (fasttop)" or "double free or corruption
(!prev)", and with a longer command line, I also got "corrupted linked
list". None of this occurs - never! - with gdb attached. :-(
Here's the dump:
barsnick at sunshine:/usr/new/tools/video/ffmpeg/ffmpeg-build-2016-11-05 > ./ffmpeg_g -re -f lavfi -i testsrc -vcodec mpeg2video -map 0 -f tee "[f=fifo:onfail=ignore:fifo_format=flv]rtmp://host2/
live/stream|[f=fifo:onfail=ignore:fifo_format=flv]rtmp://host1/live/strean"
ffmpeg version N-82247-g7746103 Copyright (c) 2000-2016 the FFmpeg developers
built with icc (ICC) 14.0.3 20140422
configuration: --prefix=/usr/new/tools/video/install/ffmpeg/2016-11-05 --cc=icc --cxx=icpc --enable-gpl --enable-version3 --enable-nonfree --disable-shared --enable-gnutls --enable-libcdio -
-enable-libfreetype --enable-libx264 --enable-libvpx --enable-libmp3lame --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtwolame --enable-libopenjpeg --enable
-librtmp --enable-libass --enable-libv4l2 --enable-libvidstab --enable-libfdk-aac --enable-libsmbclient --enable-libzvbi --enable-libtesseract --enable-libzmq
libavutil 55. 35.100 / 55. 35.100
libavcodec 57. 66.101 / 57. 66.101
libavformat 57. 57.100 / 57. 57.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 66.100 / 6. 66.100
libswscale 4. 3.100 / 4. 3.100
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, lavfi, from 'testsrc':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
*** glibc detected *** ./ffmpeg_g: double free or corruption (!prev): 0x0b9c2a90 ***
======= Backtrace: =========
/lib/libc.so.6[0x3c03a4]
/lib/libc.so.6[0x3c3ded]
/lib/libc.so.6(realloc+0x106)[0x3c4c86]
/lib/libcrypto.so.7[0xb08a505]
/lib/libcrypto.so.7(CRYPTO_realloc+0xab)[0xb08ac4b]
/lib/libcrypto.so.7(lh_insert+0x10b)[0xb0e907b]
/lib/libcrypto.so.7[0xb0ebafe]
/lib/libcrypto.so.7[0xb0eb270]
/lib/libcrypto.so.7(ERR_load_crypto_strings+0x17)[0xb0eccd7]
/lib/libssl.so.7(SSL_load_error_strings+0x17)[0xcaddb7]
/usr/lib/librtmp.so.1(RTMP_TLS_Init+0x18)[0x81e5df]
/usr/lib/librtmp.so.1(RTMP_Init+0x91)[0x81e6c7]
./ffmpeg_g[0x83cb4ea]
======= Memory map: ========
00110000-00111000 r-xp 00000000 08:07 52594748 /usr/lib/libvdpau.so.1.0.0
00111000-00112000 rw-p 00000000 08:07 52594748 /usr/lib/libvdpau.so.1.0.0
00112000-00117000 r-xp 00000000 08:07 52595161 /usr/lib/libxcb-xfixes.so.0.0.0
00117000-00118000 rw-p 00004000 08:07 52595161 /usr/lib/libxcb-xfixes.so.0.0.0
00118000-00174000 r-xp 00000000 08:07 52598993 /usr/lib/libzmq.so.4.0.0
00174000-00177000 rw-p 0005c000 08:07 52598993 /usr/lib/libzmq.so.4.0.0
00177000-00189000 r-xp 00000000 08:01 33816 /lib/libz.so.1.2.3
00189000-0018a000 rw-p 00012000 08:01 33816 /lib/libz.so.1.2.3
0018a000-001a6000 r-xp 00000000 08:07 52592711 /usr/lib/libopenjpeg.so.2.1.3.0
001a6000-001a7000 rw-p 0001c000 08:07 52592711 /usr/lib/libopenjpeg.so.2.1.3.0
001a7000-001d0000 r-xp 00000000 08:07 52595869 /usr/lib/libopencore-amrnb.so.0.0.3
001d0000-001d1000 rw-p 00028000 08:07 52595869 /usr/lib/libopencore-amrnb.so.0.0.3
001d1000-00286000 r-xp 00000000 08:07 52598990 /usr/lib/libfdk-aac.so.1.0.0
00286000-00288000 rw-p 000b5000 08:07 52598990 /usr/lib/libfdk-aac.so.1.0.0
00288000-00289000 rw-p 00288000 00:00 0
00289000-00328000 r-xp 00000000 08:07 52608726 /usr/lib/libgnutls.so.26.4.6
00328000-0032e000 rw-p 0009e000 08:07 52608726 /usr/lib/libgnutls.so.26.4.6
0032e000-00350000 r-xp 00000000 08:07 52593510 /usr/lib/liblzma.so.0.0.0
00350000-00351000 rw-p 00021000 08:07 52593510 /usr/lib/liblzma.so.0.0.0
00351000-004bf000 r-xp 00000000 08:01 33044 /lib/libc-2.9.so
004bf000-004c1000 r--p 0016e000 08:01 33044 /lib/libc-2.9.so
004c1000-004c2000 rw-p 00170000 08:01 33044 /lib/libc-2.9.so
004c2000-004c5000 rw-p 004c2000 00:00 0
004c5000-004e2000 r-xp 00000000 08:07 52593853 /usr/lib/libcdio.so.7.1.1
004e2000-004e3000 rw-p 0001c000 08:07 52593853 /usr/lib/libcdio.so.7.1.1
004e3000-004e7000 rw-p 004e3000 00:00 0
004e7000-004f1000 r-xp 00000000 08:07 52594268 /usr/lib/libesd.so.0.2.39
004f1000-004f2000 rw-p 00009000 08:07 52594268 /usr/lib/libesd.so.0.2.39
004f2000-004ff000 r-xp 00000000 08:07 52595417 /usr/lib/libgomp.so.1.0.0
004ff000-00500000 rw-p 0000d000 08:07 52595417 /usr/lib/libgomp.so.1.0.0
00500000-0053b000 r-xp 00000000 08:07 52592948 /usr/lib/libopenal.so.0.0.0
0053b000-0053c000 rw-p 0003b000 08:07 52592948 /usr/lib/libopenal.so.0.0.0
0053c000-00540000 rw-p 0053c000 00:00 0
00540000-005b7000 r-xp 00000000 08:01 32734 /lib/libgcrypt.so.11.5.2
005b7000-005ba000 rw-p 00076000 08:01 32734 /lib/libgcrypt.so.11.5.2
005ba000-005e1000 r-xp 00000000 08:01 33067 /lib/libm-2.9.so
005e1000-005e2000 r--p 00026000 08:01 33067 /lib/libm-2.9.so
005e2000-005e3000 rw-p 00027000 08:01 33067 /lib/libm-2.9.so
005e3000-0062d000 r-xp 00000000 08:07 52595966 /usr/lib/libpgm-5.2.so.0.0.122
0062d000-0062e000 rw-p 00049000 08:07 52595966 /usr/lib/libpgm-5.2.so.0.0.122
0062e000-00632000 rw-p 0062e000 00:00 0
00632000-00639000 r-xp 00000000 08:07 52594395 /usr/lib/libtalloc.so.1
00639000-0063a000 r--p 00006000 08:07 52594395 /usr/lib/libtalloc.so.1
0063a000-0063b000 rw-p 00007000 08:07 52594395 /usr/lib/libtalloc.so.1
0063b000-00648000 r-xp 00000000 08:07 52608777 /usr/lib/libtdb.so.1
00648000-00649000 r--p 0000c000 08:07 52608777 /usr/lib/libtdb.so.1
00649000-0064a000 rw-p 0000d000 08:07 52608777 /usr/lib/libtdb.so.1
0064a000-0064e000 r-xp 00000000 08:01 33840 /lib/libcap.so.2.10
0064e000-0064f000 rw-p 00003000 08:01 33840 /lib/libcap.so.2.10
0064f000-00662000 r-xp 00000000 08:01 33823 /lib/libresolv-2.9.so
00662000-00663000 r--p 00012000 08:01 33823 /lib/libresolv-2.9.so
00663000-00664000 rw-p 00013000 08:01 33823 /lib/libresolv-2.9.so
00664000-00666000 rw-p 00664000 00:00 0
00666000-00668000 r-xp 00000000 08:01 33825 /lib/libcom_err.so.2.1
00668000-00669000 rw-p 00001000 08:01 33825 /lib/libcom_err.so.2.1
00669000-00671000 r-xp 00000000 08:07 52593872 /usr/lib/libgif.so.4.1.6
00671000-00672000 rw-p 00007000 08:07 52593872 /usr/lib/libgif.so.4.1.6
00672000-00674000 r-xp 00000000 08:01 33822 /lib/libkeyutils-1.2.so
00674000-00675000 rw-p 00001000 08:01 33822 /lib/libkeyutils-1.2.so
00675000-00678000 r-xp 00000000 08:01 33843 /lib/libuuid.so.1.2
00678000-00679000 rw-p 00003000 08:01 33843 /lib/libuuid.so.1.2
00679000-00699000 r-xp 00000000 08:01 32944 /lib/ld-2.9.so
0069a000-0069b000 r--p 00020000 08:01 32944 /lib/ld-2.9.so
0069b000-0069c000 rw-p 00021000 08:01 32944 /lib/ld-2.9.so
0069c000-006a6000 r-xp 00000000 08:01 33828 /lib/libcrypt-2.9.so
006a6000-006a7000 r--p 00009000 08:01 33828 /lib/libcrypt-2.9.so
006a7000-006a8000 rw-p 0000a000 08:01 33828 /lib/libcrypt-2.9.so
006a8000-006cf000 rw-p 006a8000 00:00 0
006cf000-006e5000 r-xp 00000000 08:01 33836 /lib/libnsl-2.9.so
006e5000-006e6000 r--p 00016000 08:01 33836 /lib/libnsl-2.9.so
006e6000-006e7000 rw-p 00017000 08:01 33836 /lib/libnsl-2.9.so
006e7000-006e9000 rw-p 006e7000 00:00 0
006e9000-00717000 r-xp 00000000 08:07 52608730 /usr/lib/libgssapi_krb5.so.2.2
00717000-00718000 rw-p 0002e000 08:07 52608730 /usr/lib/libgssapi_krb5.so.2.2
00718000-00721000 r-xp 00000000 08:07 52592871 /usr/lib/libkrb5support.so.0.1
00721000-00722000 rw-p 00008000 08:07 52592871 /usr/lib/libkrb5support.so.0.1
00722000-00729000 r-xp 00000000 08:07 52592942 /usr/lib/libSM.so.6.0.0
00729000-0072a000 rw-p 00006000 08:07 52592942 /usr/lib/libSM.so.6.0.0
0072a000-0073a000 r-xp 00000000 08:07 52598994 /usr/lib/libvidstab.so.1.1
0073a000-0073b000 rw-p 0000f000 08:07 52598994 /usr/lib/libvidstab.so.1.1
0073b000-007d7000 r-xp 00000000 08:07 52608729 /usr/lib/libkrb5.so.3.3
007d7000-007da000 rw-p 0009b000 08:07 52608729 /usr/lib/libkrb5.so.3.3
007da000-007fe000 r-xp 00000000 08:07 52608728 /usr/lib/libk5crypto.so.3.1
007fe000-007ff000 rw-p 00024000 08:07 52608728 /usr/lib/libk5crypto.so.3.1
00814000-0082e000 r-xp 00000000 08:07 52593435 /usr/lib/librtmp.so.1
0082e000-0082f000 rw-p 0001a000 08:07 52593435 /usr/lib/librtmp.so.1
0083f000-00842000 r-xp 00000000 08:Aborted
I'm not sure that helps anyone. I'm just trying to provide my observation.
Moritz
More information about the ffmpeg-user
mailing list