Opened 12 years ago

Last modified 12 years ago

#1706 new defect

(win64) avformat/FFMPEG crashed after connection loss to stream server

Reported by: Vladimir Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: When I stream using ffmpeg libraries or ffmpeg.exe itself and my connection is lost I get crash.

I tried it in Linux as well and it "crashed" with unhandled SIGPIPE.

How to reproduce:

  • everything running on windows 7 Professional 64 bit with SP1
  • for the test I used Adobe flash server, dacast, wowza, ustream, livestream, showcaster
  • start streaming with ffmpeg (or use software which utilize the ffmpeg's set of libraries).
  • unplugg the ethernet cable (e.g. simulate connection drop).
  • in few moments I have crash (no special info is given except : unhandled exception at <address> (avformat-54.dll) : Access violation writting location ...)

callstack has only 1 entry (rest is just some addresses) :
avformat-54.dll!avformat_get_riff_audio_tags()

what I think it's going on is, that part of the ffmpeg is trying to send data (RTMP Send) but it does not handled WSAECONNABORTED WinSock Error properly (10053), so it keeps writing to something that is not a valid socket anymore.

Versions:
windows 7 :

Windows Nightly Builds/64 bit windows build taken from http://libav.org/download.html

build flags :

--enable-runtime-cpudetect --enable-cross-compile --enable-w32threads
--prefix=/usr --cross-prefix=x86_64-w64-mingw32- --arch=x86_64
--target-os=mingw32 --sysroot=/usr/x86_64-w64-mingw32 --enable-gpl
--enable-librtmp --enable-libx264 --enable-libmp3lame --enable-libvorbis
--enable-memalign-hack --enable-shared --enable-libvpx --enable-libvo-aacenc
--enable-version3

Linux Debian testing 64bit :

ffmpeg version 0.11.1
built on Jul 31 2012 16:16:27 with gcc 4.7.1
configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --disable-decoder=libdirac --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-libvpx --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libdc1394 --disable-altivec --disable-armv5te --disable-armv6 --disable-vis --shlibdir=/usr/lib/x86_64-linux-gnu
libavutil 51. 54.100 / 51. 54.100
libavcodec 54. 23.100 / 54. 23.100
libavformat 54. 6.100 / 54. 6.100
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 77.100 / 2. 77.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100

Attachments (1)

ffmpeg_crash_linux.txt (3.3 KB ) - added by Vladimir 12 years ago.
GDB Output from linux

Download all attachments as: .zip

Change History (3)

by Vladimir, 12 years ago

Attachment: ffmpeg_crash_linux.txt added

GDB Output from linux

comment:1 by Carl Eugen Hoyos, 12 years ago

Is this also reproducible with current git head?

Sorry if I misunderstand but is the only Windows-specific thing about this ticket that you originally found it using Windows?

Windows Nightly Builds/64 bit windows build taken from libav.org/download.html

Note that the binaries from this page contain several hundred known regressions, some of them security relevant, please understand that we therefore cannot support this (intentionally) broken version of FFmpeg.

in reply to:  1 comment:2 by Vladimir, 12 years ago

Replying to cehoyos:

Is this also reproducible with current git head?


I'll try.

Sorry if I misunderstand but is the only Windows-specific thing about this ticket that you originally found it using Windows?


Yes, you understand it correctly. I'm using ffmpeg's dll files and observing crashes on windows 7 in the way I described in the ticket. First I thought that I wrote wrong code, so I wanted to see how ffmpeg.exe (as etalon) behave and ffmpeg under Linux (so the Linux test was just to prove myself correct/wrong). When I noticed the behavior is similar to mine I realized that perhaps, there is something wrong with dlls.

Windows Nightly Builds/64 bit windows build taken from libav.org/download.html

Note that the binaries from this page contain several hundred known regressions, some of them security relevant, please understand that we therefore cannot support this (intentionally) broken version of FFmpeg.


I understand that. I'll try the head from git and we will see.

Plus I don't want to call it "platform independent" (at least not now), because the consequences of crash are not so severe under Linux as are under Windows.

Note: See TracTickets for help on using tickets.