I am debugging a recurring segmentation fault from nvcompositor on a Jetson Orin NX.
Environment
-
Device: NVIDIA Jetson Orin NX 16GB
-
Pipeline uses NVMM / VIC /
nvv4l2h264enc
Problem
The pipeline works correctly during the first iteration.
After:
-
EOS
-
PLAYING → NULL
-
PLAYING again
I eventually get:
Thread 71 "pp_vic:src" received signal SIGSEGV
0x0000ffffd4474ee8 in ??
from /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so
The crash consistently occurs from:
pp_vic:src
which appears to be the nvcompositor streaming thread.
Pipeline structure
Video branch
filesrc
-> decodebin
-> nvvideoconvert
-> capsfilter(memory:NVMM)
-> queue
-> nvcompositor sink_0
Overlay branch
videotestsrc
-> capsfilter
-> videoconvert
-> cairooverlay
-> nvvideoconvert
-> capsfilter(memory:NVMM)
-> queue
-> nvcompositor sink_1
The overlay is stitched below the main video.
Main processing branch
nvcompositor
-> nvvideoconvert
-> capsfilter
-> nvvideoconvert
-> capsfilter(NV12)
-> nvv4l2h264enc
-> queue
-> h264parse
-> mp4mux
-> filesink
Main loop
The pipeline is initialized only once.
Each iteration does:
gst_element_set_state(pipeline, GST_STATE_READY);
gst_element_set_state(pipeline, GST_STATE_PAUSED);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
wait_for_eos();
gst_element_set_state(pipeline, GST_STATE_NULL);
Then the next iteration starts again.
Important details
-
Uses request pads on
nvcompositor -
Request pads are released during destroy
-
flush-on-eos=TRUEon queues -
NVMM caps everywhere before compositor
-
videotestsrcis configured with:-
is-live=FALSE -
num-buffers=N
-
Suspected issue
I suspect one of:
-
VIC thread still active during NULL transition
-
nvcompositorinternal race -
EOS synchronization issue between overlay/video branches
I also noticed:
NvVideo: bBlitMode is set to TRUE
before the crash.
Questions
-
Is
nvcompositorknown to have teardown races across repeated PLAYING->NULL cycles on Jetson? -
Is
videotestsrcproblematic inside an Aggregator pipeline? -
Is there a recommended teardown order for:
-
nvcompositor -
nvv4l2h264enc -
mp4mux
-
-
Should the pipeline instead be fully recreated each iteration rather than reused?
GDB debug output :
Post processing has been started ....
Starting iteration 0
Opening in BLOCKING MODE
[New Thread 0xffffed0aee60 (LWP 26712)]
[New Thread 0xffffec863e60 (LWP 26713)]
[New Thread 0xffffdfffee60 (LWP 26714)]
[New Thread 0xffffdf7eee60 (LWP 26715)]
[New Thread 0xffffdefdee60 (LWP 26716)]
[New Thread 0xffffde7cee60 (LWP 26717)]
[New Thread 0xffffddfbee60 (LWP 26718)]
[New Thread 0xffffdd47ee60 (LWP 26719)]
[New Thread 0xffffdcc3fe60 (LWP 26720)]
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
[New Thread 0xffffb99f5e60 (LWP 26721)]
[New Thread 0xffffb91e5e60 (LWP 26722)]
[New Thread 0xffffb89d5e60 (LWP 26723)]
NvMMLiteBlockCreate : Block : BlockType = 261
[New Thread 0xffffb81c5e60 (LWP 26724)]
[New Thread 0xffffb61bfe60 (LWP 26725)]
Linked lOvCamPPDecodebin pad to capsPad
[New Thread 0xffffb5149e60 (LWP 26726)]
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
[New Thread 0xffff89a1ee60 (LWP 26727)]
[New Thread 0xffff8920ee60 (LWP 26728)]
H264: Profile = 66 Level = 0
[New Thread 0xffff81608e60 (LWP 26729)]
[New Thread 0xffff80df8e60 (LWP 26730)]
NVMEDIA: Need to set EMC bandwidth : 2872000
NvVideo: bBlitMode is set to TRUE
[Thread 0xffffb81c5e60 (LWP 26724) exited]
[Thread 0xffff8920ee60 (LWP 26728) exited]
EOS for: /app/VideoSamples/mk/GstreamerPipelineTest/OV_sampleviDeo_0.mp4
Elapsed time: 70.1156 seconds
Post Processing completed for iteration 0
[Thread 0xffff89a1ee60 (LWP 26727) exited]
Resetting pipeline for next iteration 0
[Thread 0xffffb89d5e60 (LWP 26723) exited]
[Thread 0xffffb91e5e60 (LWP 26722) exited]
[Thread 0xffffb99f5e60 (LWP 26721) exited]
[Thread 0xffff80df8e60 (LWP 26730) exited]
[Thread 0xffff81608e60 (LWP 26729) exited]
[Thread 0xffffed0aee60 (LWP 26712) exited]
[Thread 0xffffec863e60 (LWP 26713) exited]
[Thread 0xffffdf7eee60 (LWP 26715) exited]
[Thread 0xffffdefdee60 (LWP 26716) exited]
[Thread 0xffffdfffee60 (LWP 26714) exited]
[Thread 0xffffdcc3fe60 (LWP 26720) exited]
[Thread 0xffffdd47ee60 (LWP 26719) exited]
[Thread 0xffffddfbee60 (LWP 26718) exited]
[Thread 0xffffde7cee60 (LWP 26717) exited]
Re-initializing pipeline for next iteration 0
Starting iteration 1
Opening in BLOCKING MODE
[New Thread 0xffffde7cee60 (LWP 26731)]
[New Thread 0xffffddfbee60 (LWP 26732)]
[New Thread 0xffffdd47ee60 (LWP 26733)]
[New Thread 0xffffdcc3fe60 (LWP 26734)]
[New Thread 0xffffed0aee60 (LWP 26735)]
[New Thread 0xffffec89ee60 (LWP 26736)]
[New Thread 0xffffdfffee60 (LWP 26737)]
[New Thread 0xffffdf7eee60 (LWP 26738)]
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
[New Thread 0xffffb9ffee60 (LWP 26739)]
[New Thread 0xffffb97eee60 (LWP 26740)]
[New Thread 0xffffb8fdee60 (LWP 26741)]
NvMMLiteBlockCreate : Block : BlockType = 261
[New Thread 0xffffb87cee60 (LWP 26742)]
Linked lOvCamPPDecodebin pad to capsPad
[New Thread 0xffffa7ffee60 (LWP 26743)]
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Thread 24 "pp_vic:src" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xffffddfbee60 (LWP 26732)]
0x0000ffffee194ee8 in ?? () from /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so
(gdb) bt
#0 0x0000ffffee194ee8 in () at /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so
#1 0x0000fffff593ee5c [PAC] in () at /usr/lib/aarch64-linux-gnu/libgstvideo-1.0.so.0
#2 0x0000fffff5b29038 in () at /usr/lib/aarch64-linux-gnu/libgstbase-1.0.so.0
#3 0x0000fffff7d2180c in () at /usr/lib/aarch64-linux-gnu/libgstreamer-1.0.so.0
#4 0x0000fffff7b08ab8 in g_thread_pool_thread_proxy (data=<optimized out>) at ../glib/gthreadpool.c:350
#5 0x0000fffff7b08064 in g_thread_proxy (data=0xffffe8000e40) at ../glib/gthread.c:831
#6 0x0000fffff75bd5c8 in () at /usr/lib/aarch64-linux-gnu/libc.so.6
#7 0x0000fffff7625edc in () at /usr/lib/aarch64-linux-gnu/libc.so.6
(gdb)
Any debugging suggestions would help a lot — I’ve been stuck on this for weeks.
for full code : VICpipeline