Stopping RTP stream containing h265 results in 'double free or corruption (out)'
When I stop a RTP stream which contains h265 data, it will crash during the cleanup it seems. I found this in my own (Python) program, but I was able to reproduce it with gst-launch.
Using GStreamer 1.14.5 and FFmpeg 4.2.2 (Gentoo)
gst-launch-1.0 -e -m -v rtspsrc location=${URL} name=src latency=300 src. ! "application/x-rtp, media=(string)audio" ! decodebin ! audioconvert ! fakesink silent=false src. ! "application/x-rtp, media=(string)video" ! decodebin ! videoconvert ! autovideosink silent=false
Last lines of output (I have attached below an image of the pipeline)
Got message #811 from element "pipeline0" (application): GstLaunchInterrupt, message=(string)"Pipeline\ interrupted";
Interrupt: Stopping pipeline ...
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got message #815 from element "fakesink0" (property-notify): GstMessagePropertyNotify, property-name=(string)last-message, property-value=(string)"event\ \ \ \*\*\*\*\*\*\*\ \(fakesink0:sink\)\ E\ \(type:\ eos\ \(28174\)\,\ \)\ 0x555907d2ae40";
/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = event ******* (fakesink0:sink) E (type: eos (28174), ) 0x555907d2ae40
Got message #823 from element "rtpsession0" (property-notify): GstMessagePropertyNotify, property-name=(string)stats, property-value=(structure)"application/x-rtp-session-stats\,\ rtx-drop-count\=\(uint\)0\,\ sent-nack-count\=\(uint\)0\,\ recv-nack-count\=\(uint\)0\,\ source-stats\=\(GValueArray\)\<\ \"application/x-rtp-source-stats\\\,\\\ ssrc\\\=\\\(uint\\\)628694956\\\,\\\ internal\\\=\\\(boolean\\\)false\\\,\\\ validated\\\=\\\(boolean\\\)true\\\,\\\ received-bye\\\=\\\(boolean\\\)false\\\,\\\ is-csrc\\\=\\\(boolean\\\)false\\\,\\\ is-sender\\\=\\\(boolean\\\)true\\\,\\\ seqnum-base\\\=\\\(int\\\)-1\\\,\\\ clock-rate\\\=\\\(int\\\)90000\\\,\\\ rtp-from\\\=\\\(string\\\)192.168.178.53:34956\\\,\\\ rtcp-from\\\=\\\(string\\\)192.168.178.53:34957\\\,\\\ octets-sent\\\=\\\(guint64\\\)0\\\,\\\ packets-sent\\\=\\\(guint64\\\)0\\\,\\\ octets-received\\\=\\\(guint64\\\)849262\\\,\\\ packets-received\\\=\\\(guint64\\\)625\\\,\\\ bitrate\\\=\\\(guint64\\\)1937386\\\,\\\ packets-lost\\\=\\\(int\\\)0\\\,\\\ jitter\\\=\\\(uint\\\)78\\\,\\\ sent-pli-count\\\=\\\(uint\\\)0\\\,\\\ recv-pli-count\\\=\\\(uint\\\)0\\\,\\\ sent-fir-count\\\=\\\(uint\\\)0\\\,\\\ recv-fir-count\\\=\\\(uint\\\)0\\\,\\\ sent-nack-count\\\=\\\(uint\\\)0\\\,\\\ recv-nack-count\\\=\\\(uint\\\)0\\\,\\\ have-sr\\\=\\\(boolean\\\)true\\\,\\\ sr-ntptime\\\=\\\(guint64\\\)16309824298245404229\\\,\\\ sr-rtptime\\\=\\\(uint\\\)8108\\\,\\\ sr-octet-count\\\=\\\(uint\\\)0\\\,\\\ sr-packet-count\\\=\\\(uint\\\)0\\\,\\\ sent-rb\\\=\\\(boolean\\\)true\\\,\\\ sent-rb-fractionlost\\\=\\\(uint\\\)0\\\,\\\ sent-rb-packetslost\\\=\\\(int\\\)0\\\,\\\ sent-rb-exthighestseq\\\=\\\(uint\\\)8361\\\,\\\ sent-rb-jitter\\\=\\\(uint\\\)94\\\,\\\ sent-rb-lsr\\\=\\\(uint\\\)583613939\\\,\\\ sent-rb-dlsr\\\=\\\(uint\\\)88657\\\,\\\ have-rb\\\=\\\(boolean\\\)false\\\,\\\ rb-fractionlost\\\=\\\(uint\\\)0\\\,\\\ rb-packetslost\\\=\\\(int\\\)0\\\,\\\ rb-exthighestseq\\\=\\\(uint\\\)0\\\,\\\ rb-jitter\\\=\\\(uint\\\)0\\\,\\\ rb-lsr\\\=\\\(uint\\\)0\\\,\\\ rb-dlsr\\\=\\\(uint\\\)0\\\,\\\ rb-round-trip\\\=\\\(uint\\\)0\\\;\"\,\ \"application/x-rtp-source-stats\\\,\\\ ssrc\\\=\\\(uint\\\)991266563\\\,\\\ internal\\\=\\\(boolean\\\)true\\\,\\\ validated\\\=\\\(boolean\\\)true\\\,\\\ received-bye\\\=\\\(boolean\\\)false\\\,\\\ is-csrc\\\=\\\(boolean\\\)false\\\,\\\ is-sender\\\=\\\(boolean\\\)false\\\,\\\ seqnum-base\\\=\\\(int\\\)-1\\\,\\\ clock-rate\\\=\\\(int\\\)-1\\\,\\\ octets-sent\\\=\\\(guint64\\\)0\\\,\\\ packets-sent\\\=\\\(guint64\\\)0\\\,\\\ octets-received\\\=\\\(guint64\\\)0\\\,\\\ packets-received\\\=\\\(guint64\\\)0\\\,\\\ bitrate\\\=\\\(guint64\\\)0\\\,\\\ packets-lost\\\=\\\(int\\\)0\\\,\\\ jitter\\\=\\\(uint\\\)0\\\,\\\ sent-pli-count\\\=\\\(uint\\\)0\\\,\\\ recv-pli-count\\\=\\\(uint\\\)0\\\,\\\ sent-fir-count\\\=\\\(uint\\\)0\\\,\\\ recv-fir-count\\\=\\\(uint\\\)0\\\,\\\ sent-nack-count\\\=\\\(uint\\\)0\\\,\\\ recv-nack-count\\\=\\\(uint\\\)0\\\,\\\ have-sr\\\=\\\(boolean\\\)false\\\,\\\ sr-ntptime\\\=\\\(guint64\\\)0\\\,\\\ sr-rtptime\\\=\\\(uint\\\)0\\\,\\\ sr-octet-count\\\=\\\(uint\\\)0\\\,\\\ sr-packet-count\\\=\\\(uint\\\)0\\\;\"\ \>\,\ rtx-count\=\(uint\)0\;";
/GstPipeline:pipeline0/GstRTSPSrc:src/GstRtpBin:manager/GstRtpSession:rtpsession0: stats = application/x-rtp-session-stats, rtx-drop-count=(uint)0, sent-nack-count=(uint)0, recv-nack-count=(uint)0, source-stats=(GValueArray)< "application/x-rtp-source-stats\,\ ssrc\=\(uint\)628694956\,\ internal\=\(boolean\)false\,\ validated\=\(boolean\)true\,\ received-bye\=\(boolean\)false\,\ is-csrc\=\(boolean\)false\,\ is-sender\=\(boolean\)true\,\ seqnum-base\=\(int\)-1\,\ clock-rate\=\(int\)90000\,\ rtp-from\=\(string\)192.168.178.53:34956\,\ rtcp-from\=\(string\)192.168.178.53:34957\,\ octets-sent\=\(guint64\)0\,\ packets-sent\=\(guint64\)0\,\ octets-received\=\(guint64\)849262\,\ packets-received\=\(guint64\)625\,\ bitrate\=\(guint64\)1937386\,\ packets-lost\=\(int\)0\,\ jitter\=\(uint\)78\,\ sent-pli-count\=\(uint\)0\,\ recv-pli-count\=\(uint\)0\,\ sent-fir-count\=\(uint\)0\,\ recv-fir-count\=\(uint\)0\,\ sent-nack-count\=\(uint\)0\,\ recv-nack-count\=\(uint\)0\,\ have-sr\=\(boolean\)true\,\ sr-ntptime\=\(guint64\)16309824298245404229\,\ sr-rtptime\=\(uint\)8108\,\ sr-octet-count\=\(uint\)0\,\ sr-packet-count\=\(uint\)0\,\ sent-rb\=\(boolean\)true\,\ sent-rb-fractionlost\=\(uint\)0\,\ sent-rb-packetslost\=\(int\)0\,\ sent-rb-exthighestseq\=\(uint\)8361\,\ sent-rb-jitter\=\(uint\)94\,\ sent-rb-lsr\=\(uint\)583613939\,\ sent-rb-dlsr\=\(uint\)88657\,\ have-rb\=\(boolean\)false\,\ rb-fractionlost\=\(uint\)0\,\ rb-packetslost\=\(int\)0\,\ rb-exthighestseq\=\(uint\)0\,\ rb-jitter\=\(uint\)0\,\ rb-lsr\=\(uint\)0\,\ rb-dlsr\=\(uint\)0\,\ rb-round-trip\=\(uint\)0\;", "application/x-rtp-source-stats\,\ ssrc\=\(uint\)991266563\,\ internal\=\(boolean\)true\,\ validated\=\(boolean\)true\,\ received-bye\=\(boolean\)false\,\ is-csrc\=\(boolean\)false\,\ is-sender\=\(boolean\)false\,\ seqnum-base\=\(int\)-1\,\ clock-rate\=\(int\)-1\,\ octets-sent\=\(guint64\)0\,\ packets-sent\=\(guint64\)0\,\ octets-received\=\(guint64\)0\,\ packets-received\=\(guint64\)0\,\ bitrate\=\(guint64\)0\,\ packets-lost\=\(int\)0\,\ jitter\=\(uint\)0\,\ sent-pli-count\=\(uint\)0\,\ recv-pli-count\=\(uint\)0\,\ sent-fir-count\=\(uint\)0\,\ recv-fir-count\=\(uint\)0\,\ sent-nack-count\=\(uint\)0\,\ recv-nack-count\=\(uint\)0\,\ have-sr\=\(boolean\)false\,\ sr-ntptime\=\(guint64\)0\,\ sr-rtptime\=\(uint\)0\,\ sr-octet-count\=\(uint\)0\,\ sr-packet-count\=\(uint\)0\;" >, rtx-count=(uint)0;
Got message #812 from element "pipeline0" (eos): no message details
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:03.917827325
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
double free or corruption (out)
This is the GDB output
Got message #848 from element "pipeline0" (eos): no message details
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 0:00:05.669120418
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
[Thread 0x7fff9352e700 (LWP 22531) exited]
[Thread 0x7fff93d2f700 (LWP 22530) exited]
[Thread 0x7fff94530700 (LWP 22529) exited]
[Thread 0x7fff94d31700 (LWP 22528) exited]
[Thread 0x7fff95532700 (LWP 22527) exited]
[Thread 0x7fff95d33700 (LWP 22526) exited]
[Thread 0x7fff96534700 (LWP 22525) exited]
[Thread 0x7fff96d35700 (LWP 22524) exited]
[Thread 0x7fff97536700 (LWP 22523) exited]
[Thread 0x7fff97d37700 (LWP 22522) exited]
[Thread 0x7fff98538700 (LWP 22521) exited]
[Thread 0x7fff98d39700 (LWP 22520) exited]
[Thread 0x7fff9953a700 (LWP 22519) exited]
[Thread 0x7fff99d3b700 (LWP 22518) exited]
[Thread 0x7fff9a53c700 (LWP 22517) exited]
[Thread 0x7fff9ad3d700 (LWP 22516) exited]
[Thread 0x7fff9b53e700 (LWP 22515) exited]
[Thread 0x7fff9bd3f700 (LWP 22514) exited]
[Thread 0x7fff9c540700 (LWP 22513) exited]
[Thread 0x7fff9cd41700 (LWP 22512) exited]
[Thread 0x7fff9d542700 (LWP 22511) exited]
[Thread 0x7fff9dd43700 (LWP 22510) exited]
[Thread 0x7fff9e544700 (LWP 22509) exited]
[Thread 0x7fff9ed45700 (LWP 22508) exited]
[Thread 0x7fff9f546700 (LWP 22507) exited]
[Thread 0x7fff9fd47700 (LWP 22506) exited]
[Thread 0x7fffa0548700 (LWP 22505) exited]
[Thread 0x7fffa0d49700 (LWP 22504) exited]
[Thread 0x7fffa154a700 (LWP 22503) exited]
[Thread 0x7fffa1d4b700 (LWP 22502) exited]
[Thread 0x7fffa254c700 (LWP 22501) exited]
free(): invalid pointer
Thread 1 "gst-launch-1.0" received signal SIGABRT, Aborted.
0x00007ffff7ac5071 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff7ac5071 in raise () at /lib64/libc.so.6
#1 0x00007ffff7aae535 in abort () at /lib64/libc.so.6
#2 0x00007ffff7b0c237 in () at /lib64/libc.so.6
#3 0x00007ffff7b14158 in () at /lib64/libc.so.6
#4 0x00007ffff7b15d3c in () at /lib64/libc.so.6
#5 0x00007fffc45220c1 in () at /usr/lib64/libavcodec.so.58
#6 0x00007fffc454c5b5 in avcodec_close () at /usr/lib64/libavcodec.so.58
#7 0x00007ffff41b4168 in () at /usr/lib64/gstreamer-1.0/libgstlibav.so
#8 0x00007ffff41c4fe3 in () at /usr/lib64/gstreamer-1.0/libgstlibav.so
#9 0x00007ffff41c50ff in () at /usr/lib64/gstreamer-1.0/libgstlibav.so
#10 0x00007ffff6f53682 in () at /usr/lib64/libgstvideo-1.0.so.0
#11 0x00007ffff7e6c13e in gst_element_change_state () at /usr/lib64/libgstreamer-1.0.so.0
#12 0x00007ffff7e6c885 in () at /usr/lib64/libgstreamer-1.0.so.0
#13 0x00007ffff7e48e23 in () at /usr/lib64/libgstreamer-1.0.so.0
#14 0x00007ffff6d5ddd2 in () at /usr/lib64/gstreamer-1.0/libgstplayback.so
#15 0x00007ffff7e6c13e in gst_element_change_state () at /usr/lib64/libgstreamer-1.0.so.0
#16 0x00007ffff7e6c885 in () at /usr/lib64/libgstreamer-1.0.so.0
#17 0x00007ffff7e48e23 in () at /usr/lib64/libgstreamer-1.0.so.0
#18 0x00007ffff7e6c13e in gst_element_change_state () at /usr/lib64/libgstreamer-1.0.so.0
#19 0x00007ffff7e6c885 in () at /usr/lib64/libgstreamer-1.0.so.0
#20 0x0000555555557fc4 in ()
#21 0x00007ffff7aaff1b in __libc_start_main () at /lib64/libc.so.6
#22 0x000055555555851a in ()
Edited by Anton Tirol