Opened 5 years ago

Closed 5 years ago

#7164 closed defect (fixed)

segfaults when muxing opus / vorbis into a dash stream

Reported by: James Cowgill Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: dash crash SIGSEGV regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Starting program: /usr/bin/ffmpeg -f lavfi -i sine=d=0.1 -c:a libopus -f dash -
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
ffmpeg version 4.0-2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Debian 7.3.0-16)
  configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[New Thread 0x7fffd4a5d700 (LWP 6964)]
[New Thread 0x7fffd425c700 (LWP 6965)]
[New Thread 0x7fffd3a5b700 (LWP 6966)]
[New Thread 0x7fffd325a700 (LWP 6967)]
[New Thread 0x7fffd2a59700 (LWP 6968)]
[New Thread 0x7fffd2258700 (LWP 6969)]
[New Thread 0x7fffd1a57700 (LWP 6970)]
[New Thread 0x7fffd1256700 (LWP 6971)]
Input #0, lavfi, from 'sine=d=0.1':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> opus (libopus))
Press [q] to stop, [?] for help
[New Thread 0x7fffd0a55700 (LWP 6972)]
[New Thread 0x7fffd0254700 (LWP 6973)]
[New Thread 0x7fffcfa53700 (LWP 6974)]
[New Thread 0x7fffcf252700 (LWP 6975)]
[New Thread 0x7fffcea51700 (LWP 6976)]
[New Thread 0x7fffce250700 (LWP 6977)]
[New Thread 0x7fffcda4f700 (LWP 6978)]
[New Thread 0x7fffcd24e700 (LWP 6979)]
[libopus @ 0x5555558556c0] No bit rate set. Defaulting to 64000 bps.
[dash @ 0x555555853a00] Opening 'init-stream0.m4s' for writing

Thread 1 "ffmpeg" received signal SIGSEGV, Segmentation fault.
av_crc (ctx=0x7ffff524e2a0 <av_crc_table+16384>, crc=crc@entry=4294967295, buffer=buffer@entry=0x6 <error: Cannot access memory at address 0x6>, length=length@entry=18446744073709551610)
    at src/libavutil/crc.c:403
warning: Source file is more recent than executable.
403	            crc ^= av_le2ne32(*(const uint32_t *) buffer); buffer += 4;
(gdb) bt
#0  0x00007ffff4fec2b8 in av_crc (ctx=0x7ffff524e2a0 <av_crc_table+16384>, crc=crc@entry=4294967295, buffer=buffer@entry=0x6 <error: Cannot access memory at address 0x6>, length=length@entry=18446744073709551610) at src/libavutil/crc.c:403
#1  0x00007ffff733a21e in end_ebml_master_crc32 (pb=0x5555558862c0, dyn_cp=dyn_cp@entry=0x555555886950, mkv=<optimized out>, mkv=<optimized out>, master=...) at src/libavformat/matroskaenc.c:358
#2  0x00007ffff733f13b in mkv_write_flush_packet (s=0x5555558848c0, pkt=<optimized out>) at src/libavformat/matroskaenc.c:2496
#3  0x00007ffff73889f6 in av_write_frame (s=0x5555558848c0, pkt=pkt@entry=0x0) at src/libavformat/mux.c:888
#4  0x00007ffff72d6c86 in flush_dynbuf (range_length=<synthetic pointer>, os=0x555555883740) at src/libavformat/dashenc.c:251
#5  0x00007ffff72d6c86 in flush_init_segment (os=0x555555883740, s=0x555555853a00) at src/libavformat/dashenc.c:290
#6  0x00007ffff72d6c86 in dash_init (s=0x555555853a00) at src/libavformat/dashenc.c:995
#7  0x00007ffff7387d99 in init_muxer (options=0x555555852fc8, s=0x555555853a00) at src/libavformat/mux.c:418
#8  0x00007ffff7387d99 in avformat_init_output (s=0x555555853a00, options=0x555555852fc8) at src/libavformat/mux.c:492
#9  0x00007ffff73886f5 in avformat_write_header (s=0x555555853a00, options=<optimized out>) at src/libavformat/mux.c:515
#10 0x000055555557c070 in check_init_output_file (of=0x555555852fc0, file_index=0) at src/fftools/ffmpeg.c:2964
#11 0x0000555555580234 in init_output_stream (ost=<optimized out>, error=<optimized out>, error_len=1024) at src/fftools/ffmpeg.c:3593
#12 0x0000555555582249 in reap_filters (flush=0) at src/fftools/ffmpeg.c:1432
#13 0x0000555555560d26 in transcode_step () at src/fftools/ffmpeg.c:4571
#14 0x0000555555560d26 in transcode () at src/fftools/ffmpeg.c:4615
#15 0x0000555555560d26 in main (argc=<optimized out>, argv=<optimized out>) at src/fftools/ffmpeg.c:4815

Also fails with -c:a vorbis.

Change History (4)

comment:1 by Carl Eugen Hoyos, 5 years ago

Keywords: dash crash SIGSEGV regression added
Priority: normalimportant
Reproduced by developer: set
Version: git-master

For stereo input, this is a regression since d6d605eb05c3ca32f591016c345eb2ad9e81c554

comment:2 by Karthick Jeyapal, 5 years ago

I was able to fix the segfault. But still I couldn't get it playing in any dash.js or shaka player.
If you are aware of an older ffmpeg version's commit where opus is working with dash.js or shaka player in either firefox or chrome I can relook into it.

comment:3 by Karthick Jeyapal, 5 years ago

It has been now fixed. Could you please test it with the latest ffmpeg.

comment:4 by James Cowgill, 5 years ago

Resolution: fixed
Status: newclosed

Thanks. I've tested the master and release/4.0 branches and the bug is fixed in both.

Note: See TracTickets for help on using tickets.