About the problem,
I am experiencing segmentation fault crashes while using GStreamer 1.24; the issue also occurs in 1.22 and likely affects other versions as well.
The crash happens when I repeatedly start and stop an RTSP stream within the same process.
The first runs work fine, but after several RTSP open/close cycles a segmentation fault occurs inside rtpjitterbuffer.
This is not a fork/exec case; multiple pipelines are created and torn down multiple times in a single application process.
Has anyone seen a segfault in rtpjitterbuffer related to repeated pipeline setup and teardown?
It is difficult to determine the exact condition that triggers the crash.
Are there any simple tools, debug options, or recommended places to add instrumentation or sanity checks to help track this down?
Any advice would be appreciated.
My Pipeline
rtspsrc do-rtsp-keep-alive=true location="rtsp://admin:password@172.16.30.1/stream" name="source" nat-method="none" protocols="udp" teardown-timeout="500000000" ! rtph265depay ! h265parse config-interval=1 ! tee name=t t. ! queue max-size-buffers=1 max-size-bytes=0 max-size-time=0 ! rtph265pay config-interval=1 ! application/x-rtp,media=video,encoding-name=H265,payload=96 ! queue max-size-buffers=1 max-size-bytes=0 max-size-time=0 ! webrtcbin bundle-policy=max-bundle name=webrtc t. ! appsink drop="true" emit_signals="true" max-buffers="1" name="sei_sink" sync="false"
Core Dump
---core dump
warning: Section `.reg-xstate/26995' in core file too small.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
--Type <RET> for more, q to quit, c to continue without paging--c
Core was generated by `/opt/Stream-App/Stream-App-Executable-Live --live'.
Program terminated with signal SIGSEGV, Segmentation fault.
warning: Section `.reg-xstate/26995' in core file too small.
#0 __strlen_evex () at ../sysdeps/x86_64/multiarch/strlen-evex.S:77
77 ../sysdeps/x86_64/multiarch/strlen-evex.S: No such file or directory.
[Current thread is 1 (Thread 0x71192cf49640 (LWP 26995))]
(gdb) bt full
#0 __strlen_evex () at ../sysdeps/x86_64/multiarch/strlen-evex.S:77
No locals.
#1 0x0000711e22d9309a in __gst_vasnprintf ()
from /opt/Stream-App/bundle_live/libs/libgstreamer-1.0.so.0
No symbol table info available.
#2 0x0000711e22d922ef in __gst_vasprintf ()
from /opt/Stream-App/bundle_live/libs/libgstreamer-1.0.so.0
No symbol table info available.
#3 0x0000711e22d0d18e in _gst_element_error_printf ()
from /opt/Stream-App/bundle_live/libs/libgstreamer-1.0.so.0
No symbol table info available.
#4 0x0000711e22cd4a7b in gst_parse_no_more_pads ()
from /opt/Stream-App/bundle_live/libs/libgstreamer-1.0.so.0
No symbol table info available.
#5 0x0000711e234fd700 in g_signal_emit_valist ()
from /opt/Stream-App/bundle_live/libs/libgobject-2.0.so.0
No symbol table info available.
#6 0x0000711e234fd863 in g_signal_emit ()
from /opt/Stream-App/bundle_live/libs/libgobject-2.0.so.0
No symbol table info available.
#7 0x0000711e1c3d73a0 in new_manager_pad ()
from /opt/Stream-App/bundle_live/gst/plugins/libgstrtsp.so
No symbol table info available.
--Type <RET> for more, q to quit, c to continue without paging--c
dmesg (kernel log)
[1566229.068046] rtpjitterbuffer[288335]: segfault at 7c36bf12d1a9 ip 00007c3218b9d7fd sp 00007c305a9fe438 error 4 in libc.so.6[7c3218a28000+195000] likely on CPU 15 (core 7, socket 0)
[1566229.068059] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1566616.088052] rtpjitterbuffer[315804]: segfault at 582511490 ip 00007bad7059d7fd sp 00007ba9c45fe438 error 4 in libc.so.6[7bad70428000+195000] likely on CPU 10 (core 2, socket 0)
[1566616.088065] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1566740.023253] rtpjitterbuffer[334493]: segfault at 70ae7663ac43 ip 000070ac37b9d7fd sp 000070a8a33fe438 error 4 in libc.so.6[70ac37a28000+195000] likely on CPU 13 (core 5, socket 0)
[1566740.023268] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1566914.297892] rtpjitterbuffer[358702]: segfault at 6103359ac ip 00007d1a0039d7fd sp 00007d176bdfe438 error 4 in libc.so.6[7d1a00228000+195000] likely on CPU 11 (core 3, socket 0)
[1566914.297918] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1566961.368739] rtpjitterbuffer[361794]: segfault at 557b404506a8 ip 000071586bf9d7fd sp 0000715600bfe438 error 4 in libc.so.6[71586be28000+195000] likely on CPU 10 (core 2, socket 0)
[1566961.368751] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1567345.747313] rtpjitterbuffer[402000]: segfault at 58646b1ee529 ip 00007c1808d9d7fd sp 00007c1739ffe438 error 4 in libc.so.6[7c1808c28000+195000] likely on CPU 5 (core 5, socket 0)
[1567345.747328] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1567504.033225] rtpjitterbuffer[426130]: segfault at 5debc585a ip 0000719fa7d9d7fd sp 0000719c76bfe438 error 4 in libc.so.6[719fa7c28000+195000] likely on CPU 12 (core 4, socket 0)
[1567504.033237] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1567665.477669] rtpjitterbuffer[428057]: segfault at 7dac2ff19208 ip 00007daa0439d7fd sp 00007da96d5fe438 error 4 in libc.so.6[7daa04228000+195000] likely on CPU 8 (core 0, socket 0)
[1567665.477684] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1568186.265199] traps: webrtc:pc[483149] trap int3 ip:7936ee697cef sp:79339c3ff8d0 error:0 in libglib-2.0.so.0[7936ee658000+8f000]
[1568805.909055] rtpjitterbuffer[514988]: segfault at 64315a0a1 ip 00007bf4acd9d7fd sp 00007bf0e73fe438 error 4 in libc.so.6[7bf4acc28000+195000] likely on CPU 14 (core 6, socket 0)
[1568805.909068] Code: f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
[1568934.907251] rtpjitterbuffer[532569]: segfault at 76bd6c13f26d ip 000076b9b299d7fd sp 000076b662ffe438 error 4 in libc.so.6[76b9b2828000+195000] likely on CPU 6 (core 6, socket 0)