# Pipeline Crashes with Memory Allocation Error

**URL:** <https://discourse.gstreamer.org/t/pipeline-crashes-with-memory-allocation-error/3610>\
**Category:** General Discussion\
**Created:** [November 20, 2024, 12:35pm UTC](https://discourse.gstreamer.org/t/pipeline-crashes-with-memory-allocation-error/3610 "2024-11-20T12:35:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikita](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/n/a8b319/32.png) [@Nikita](https://discourse.gstreamer.org/u/Nikita)\
**Post date:** [November 20, 2024, 12:35pm UTC](https://discourse.gstreamer.org/t/pipeline-crashes-with-memory-allocation-error/3610/1 "2024-11-20T12:35:31Z")

</div>

hi,  
I’m encountering a critical issue while running a GStreamer pipeline that results in a crash with a core dump. Here’s my pipeline command:

> `GST_DEBUG_NO_COLOR=1 GST_DEBUG_FILE=/root/ts.log GST_DEBUG=6 gst-launch-1.0 udpsrc address=239.202.111.99 port=6310 do-timestamp=true timeout=60000000000 buffer-size=0 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33" ! rtpbin name=recv_rtp ! watchdog timeout=300000 ! rtpmp2tdepay ! tsparse set-timestamps=true ! tee name=raw_stream raw_stream. ! tsdemux name=d splitmuxsink location=stream_%d.ts max-size-time=60000000000 muxer=mpegtsmux name=mpegtsmux d. ! queue ! h264parse ! queue ! mpegtsmux.`

Crashes with the following error -

 ![image](https://discourse.gstreamer.org/uploads/default/original/1X/1bffbc3c82fc7d7f69911cd182d63cc27aaaeb90.png)

Build gstreamer with following command -

> `meson setup . ../gstreamer --buildtype debug --unity off --prefix={INSTALLATION_PREFIX} --libdir={LIBRARY_DIR} --default-library shared --wrap-mode=nofallback -Dorc-source=system -Dexamples=disabled -Dtests=enabled -Dgtk_doc=disabled -Dpackage-origin=https://github.com/GStreamer/gstreamer`

Run through gdb -

> (gdb) run  
> Starting program: /opt/scorer/bin/gst-launch-1.0 udpsrc address=239.202.111.99 port=6310 do-timestamp=true timeout=60000000000 buffer-size=0 caps=application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)33 ! rtpbin name=recv\_rtp ! watchdog timeout=300000 ! rtpmp2tdepay ! tsparse set-timestamps=true ! tee name=raw\_stream raw\_stream. ! tsdemux name=d splitmuxsink location=stream\_%d.ts max-size-time=60000000000 muxer=mpegtsmux name=mpegtsmux d. ! queue ! h264parse ! queue ! mpegtsmux.  
> warning: Error disabling address space randomization: Operation not permitted  
> [Thread debugging using libthread\_db enabled]  
> Using host libthread\_db library “/lib/x86\_64-linux-gnu/libthread\_db.so.1”.  
> Setting pipeline to PAUSED …  
> [New Thread 0x7fa31d200640 (LWP 6678)]  
> [New Thread 0x7fa317e00640 (LWP 6679)]  
> [New Thread 0x7fa317400640 (LWP 6680)]  
> [New Thread 0x7fa316a00640 (LWP 6681)]  
> [New Thread 0x7fa316000640 (LWP 6682)]  
> [New Thread 0x7fa315600640 (LWP 6683)]  
> Pipeline is live and does not need PREROLL …  
> [New Thread 0x7fa314c00640 (LWP 6684)]  
> Pipeline is PREROLLED …  
> Setting pipeline to PLAYING …  
> [New Thread 0x7fa30fe00640 (LWP 6685)]  
> New clock: GstSystemClock  
> [New Thread 0x7fa30f400640 (LWP 6686)]  
> [New Thread 0x7fa30ea00640 (LWP 6687)]  
> Thread 11 “rtpjitterbuffer” received signal SIGSEGV, Segmentation fault.  
> [Switching to Thread 0x7fa30ea00640 (LWP 6687)]  
> \_\_memmove\_evex\_unaligned\_erms () at …/sysdeps/x86\_64/multiarch/memmove-vec-unaligned-erms.S:874  
> 874 …/sysdeps/x86\_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.

> bt full  
> #0 \_\_memmove\_evex\_unaligned\_erms () at …/sysdeps/x86\_64/multiarch/memmove-vec-unaligned-erms.S:874  
> No locals.  
> #1 0x00007fa31e416f89 in gst\_buffer\_fill () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #2 0x00007fa31d4cab78 in ?? () from /opt/scorer/lib/gstreamer-1.0/libgstmpegtsdemux.so  
> No symbol table info available.  
> #3 0x00007fa31d4cb584 in ?? () from /opt/scorer/lib/gstreamer-1.0/libgstmpegtsdemux.so  
> No symbol table info available.  
> #4 0x00007fa31d4c7193 in ?? () from /opt/scorer/lib/gstreamer-1.0/libgstmpegtsdemux.so  
> No symbol table info available.  
> #5 0x00007fa31e474fa8 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #6 0x00007fa31e4761a3 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #7 0x00007fa31e476926 in gst\_pad\_push () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #8 0x00007fa31d9385e0 in ?? () from /opt/scorer/lib/libgstrtp-1.0.so.0  
> No symbol table info available.  
> #9 0x00007fa31d938a0a in ?? () from /opt/scorer/lib/libgstrtp-1.0.so.0  
> No symbol table info available.  
> #10 0x00007fa31d938a6f in gst\_rtp\_base\_depayload\_push () from /opt/scorer/lib/libgstrtp-1.0.so.0  
> No symbol table info available.  
> #11 0x00007fa31d9363a7 in ?? () from /opt/scorer/lib/libgstrtp-1.0.so.0  
> No symbol table info available.  
> #12 0x00007fa31d936968 in ?? () from /opt/scorer/lib/libgstrtp-1.0.so.0  
> No symbol table info available.  
> #13 0x00007fa31e474fa8 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #14 0x00007fa31e4761a3 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #15 0x00007fa31e476926 in gst\_pad\_push () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #16 0x00007fa31ddc3234 in ?? () from /opt/scorer/lib/libgstbase-1.0.so.0  
> No symbol table info available.  
> #17 0x00007fa31e474fa8 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #18 0x00007fa31e4761a3 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #19 0x00007fa31e476926 in gst\_pad\_push () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #20 0x00007fa31e44dc07 in gst\_proxy\_pad\_chain\_default () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #21 0x00007fa31e474fa8 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #22 0x00007fa31e4761a3 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #23 0x00007fa31e476926 in gst\_pad\_push () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #24 0x00007fa31d988d0f in ?? () from /opt/scorer/lib/gstreamer-1.0/libgstrtpmanager.so  
> No symbol table info available.  
> #25 0x00007fa31e474fa8 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> –Type for more, q to quit, c to continue without paging–c  
> #26 0x00007fa31e4761a3 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #27 0x00007fa31e476926 in gst\_pad\_push () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #28 0x00007fa31d975c48 in ?? () from /opt/scorer/lib/gstreamer-1.0/libgstrtpmanager.so  
> No symbol table info available.  
> #29 0x00007fa31d9762a2 in ?? () from /opt/scorer/lib/gstreamer-1.0/libgstrtpmanager.so  
> No symbol table info available.  
> #30 0x00007fa31d978c08 in ?? () from /opt/scorer/lib/gstreamer-1.0/libgstrtpmanager.so  
> No symbol table info available.  
> #31 0x00007fa31e4b7feb in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #32 0x00007fa31e4b9529 in ?? () from /opt/scorer/lib/libgstreamer-1.0.so.0  
> No symbol table info available.  
> #33 0x00007fa31e309714 in ?? () from /lib/x86\_64-linux-gnu/libglib-2.0.so.0  
> No symbol table info available.  
> #34 0x00007fa31e306ab1 in ?? () from /lib/x86\_64-linux-gnu/libglib-2.0.so.0  
> No symbol table info available.  
> #35 0x00007fa31e08dac3 in start\_thread (arg=) at ./nptl/pthread\_create.c:442  
> ret =   
> pd =   
> out =   
> unwind\_buf = {cancel\_jmp\_buf = {{jmp\_buf = {140338415000512, -15402161191568406, 140338301765184, 0, 140338560292816, 140338415000864, 40350904643697642, 40386991952837610}, mask\_was\_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}  
> not\_first\_call =   
> #36 0x00007fa31e11ea04 in clone () at …/sysdeps/unix/sysv/linux/x86\_64/clone.S:100
> 
> ```auto
> 
> ```

Log file link - [ts.log - Google Drive](https://drive.google.com/file/d/1fZF0lAGaTUYSxcEp-TNo-iNRVJfar55B/view?usp=sharing)

Any insights or recommendations on resolving this discrepancy would be highly appreciated.  
Thank you!

---

<div class="post-metadata">

**Author:** ![ystreet00](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/y/3d9bf3/32.png) [@ystreet00](https://discourse.gstreamer.org/u/ystreet00)\
**Post date:** [November 21, 2024, 1:25am UTC](https://discourse.gstreamer.org/t/pipeline-crashes-with-memory-allocation-error/3610/2 "2024-11-21T01:25:15Z")

</div>

The error is pretty self explanatory. Something (tsdemux?) tried to allocate an obscene amount of memory. You’ll have to debug why that happens and fix it.

If you can share a capture of the stream, this would be a good for an issue on [https://gitlab.freedesktop.org/gstreamer/gstreamer](https://gitlab.freedesktop.org/gstreamer/gstreamer).

---

<div class="post-metadata">

**Author:** ![Nikita](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/n/a8b319/32.png) [@Nikita](https://discourse.gstreamer.org/u/Nikita)\
**Post date:** [November 21, 2024, 5:34am UTC](https://discourse.gstreamer.org/t/pipeline-crashes-with-memory-allocation-error/3610/3 "2024-11-21T05:34:52Z")

</div>

hi,

Thank you for your response.

I tried running the pipeline even without `tsdemux`, but the issue still persists, so I’m not sure if `tsdemux` is the root cause. As a beginner, I’d appreciate any guidance on solving this issue.

I tried the pipeline without `tsdemux` to rule out its involvement as the suspect, but the issue persists.  
To debug further, I’ve used the following command to generate detailed logs:

 ![image](https://discourse.gstreamer.org/uploads/default/original/1X/2ff7afa05788111d4e38c032110ba838fec21c2c.png)

I suspect the issue could be related to `tsparse`. I’ve added logging statements within the `mpegts_packet_to_buffer` function to monitor the allocation process. The logs confirm that the buffer size is correctly calculated as 188 bytes, as shown below:

> tsparse mpegtsparse.c:630:mpegts\_packet\_to\_buffer: Allocating buffer with size: 188 bytes  
> tsparse mpegtsparse.c:631:mpegts\_packet\_to\_buffer: Buffer range: data\_start = 0x7ff380008534, data\_end = 0x7ff3800085f0  
> tsparse mpegtsparse.c:638:mpegts\_packet\_to\_buffer: Buffer successfully allocated and filled.

If there’s anything specific you’d like me to try.

Thanks for your support!
