GNOME Bugzilla – Bug 760266
avenc_mpeg4/mpeg2video: Segmentation fault when stopping the pipeline
Last modified: 2016-04-26 08:06:58 UTC
OS: Windows 10 Gstreamer 1.7.1 x64 follow steps will raise exception once there is an attempt to close gstreamer Steps: 1) Open cmd 2) launch "gst-launch-1.0 videotestsrc ! avenc_mpeg4 ! rtpmp4vpay ! fakesink" 3) Wait till encoding started 4) push Ctrl+C Expected result: Encoding interrupted Actual result - Gstreamer Exception Short video with the steps and the error : http://screencast.com/t/oOKSUilrJc There is the same problem is call "Pipeline.SetState(State.Null);" in C# bindings
Can you upload that to a website that does not require flash? Also ideally you could get a backtrace of the crash with gdb :) Thanks!
Created attachment 318421 [details] error picture
Ok, we would need a backtrace (of all threads) with gdb here
Ok, the dmp is here https://www.dropbox.com/s/56kk4wapqqacb95/gst-launch-1.0.exe_160108_101219.dmp?dl=0 I got it using "procdump.exe -mp -e -t -64 gst-launch-1.0"
That's not going to be useful as the binaries only have gdb compatible debug symbols. Please run your application in gdb and get a backtrace (of all threads) from there
I am not sure I understand what application you mean I run gst-launch-1.0.exe from windows command line console (cmd) with parameters "videotestsrc ! avenc_mpeg4 ! rtpmp4vpay ! fakesink" and then once I want to terminate gstreamer and push Ctrl+C (windows key combination to terminate the execution on command line console) I have the error on the screenshot attached above
I'm talking about gdb, the GNU debugger.
I installed mingw (gdb for windows) and wingdb (UI over gdb for Vidual Studio). But I cannot figure out how to get exception tree, since the exception happens not during execution, it happens on exit from programm. I am really willing to get this details for and have it fixed. So I am ready to follow some steps to get the trace you need or to provide you access to windows PC if you don't have one to try on your side.
I can reproduce the problem on Windows and it's not a normal crash that is caught by gdb apparently. Doesn't crash on Linux with the same pipeline. valgrind also doesn't report anything suspicious there.
Last thing seen in the logs is gst_ffmpegvidenc_flush_buffers(), and then an assertion in libavutil/mem.c:233: v > 0 && v <= (1 ? 32 : 16)
libavutil/mem.c is it a part of gstreamer or libav ? Can it be fixed by gstreamer team, or it should be reported to libav ? Also do you see there any workaround to prevent the exception? So far I found if I call in my C# application Pipeline.SetState(State.Paused); instead of Pipeline.SetState(State.Null); that not raises exception and stops encoding correctly, but that causes a memmory leak.
It's libav/ffmpeg code. But it's not clear yet if it's a bug on our side or theirs
Is there any chance the fix could be included in the upcoming 1.8 release ?
If a fix is found, sure. Someone would have to invest the time in that though and there are lots of other things to do too.
commit 2027188c34698842c38b38f87f5560b08d7861dd Author: Sebastian Dröge <sebastian@centricular.com> Date: Mon Apr 25 18:39:54 2016 +0300 avcfg: Use av_strdup() instead of g_strdup() for strings owned by ffmpeg It has its own allocator that depending on the configuration is incompatible with GLib's and just causes a segmentation fault. Like on Windows. https://bugzilla.gnome.org/show_bug.cgi?id=760266
https://cgit.freedesktop.org/gstreamer/gst-libav/commit/?id=2027188c34698842c38b38f87f5560b08d7861dd