Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
GPU
Ubuntu (WSL)
• DeepStream Version
7.1
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
Driver Version: 566.36
• Issue Type( questions, new requirements, bugs)
I’ve identified a critical issue in DeepStream that causes a coredump when removing a source using hls source in gst-nvmultiurisrcbin (uridecodebin).
The crash occurs during the cleanup phase, specifically in the CUDA memory deallocation process. Importantly, this issue is not consistently reproducible - it happens sporadically during source removal operations.
Stack Trace Analysis: The crash originates from the nvv4l2decoder component attempting to clean up resources. The sequence flows through:
gst_element_change_state()
gst_v4l2_object_stop()
gst_buffer_pool_set_active()
gst_v4l2_allocator_stop()
v4l2_ioctl()
CuvidV4L2_Ioctl()
cuvidv4l2_dec_release_output_buffers()
NvBufSurfaceDestroyImpl()
ReleaseCudaBufferBatch()
cudaFreeHost()
[crash]
Steps to Reproduce:
- Set up a DeepStream pipeline using nvmultiurisrcbin
- Add multiples video source
- Remove the source through the API
- Observe coredump during cleanup
Expected Behavior: Clean removal of source without memory deallocation issues.
Current Behavior: Pipeline crashes during CUDA memory cleanup with a coredump.
(gdb) bt full
#0 0x00007fff83fc48b6 in () at /usr/lib/wsl/drivers/nv_dispi.inf_amd64_9425e4c3b1ac1c47/libcuda.so.1.1
#1 0x00007fff8402c3b5 in () at /usr/lib/wsl/drivers/nv_dispi.inf_amd64_9425e4c3b1ac1c47/libcuda.so.1.1
#2 0x00007fff846aae3a in () at /usr/lib/wsl/drivers/nv_dispi.inf_amd64_9425e4c3b1ac1c47/libcuda.so.1.1
#3 0x00007fff84127b8c in () at /usr/lib/wsl/drivers/nv_dispi.inf_amd64_9425e4c3b1ac1c47/libcuda.so.1.1
#4 0x00007fff83e65871 in () at /usr/lib/wsl/drivers/nv_dispi.inf_amd64_9425e4c3b1ac1c47/libcuda.so.1.1
#5 0x00007ffff444865d in () at /usr/local/cuda-12/lib64/libcudart.so.12
#6 0x00007ffff441730f in () at /usr/local/cuda-12/lib64/libcudart.so.12
#7 0x00007ffff4457db8 in cudaFreeHost () at /usr/local/cuda-12/lib64/libcudart.so.12
#8 0x00007ffff4aef37a in ReleaseCudaBufferBatch () at /opt/nvidia/deepstream/deepstream/lib/libnvbufsurface.so
#9 0x00007ffff4aeda85 in NvBufSurfaceDestroyImpl () at /opt/nvidia/deepstream/deepstream/lib/libnvbufsurface.so
#10 0x00007fffcae11810 in cuvidv4l2_dec_release_output_buffers(v4l2_decoder_context_rec*) () at ///opt/nvidia/deepstream/deepstream-7.1/lib/libcuvidv4l2.so
#11 0x00007fffcae097de in vidioc_dec_ioctl(int, unsigned long, void*) () at ///opt/nvidia/deepstream/deepstream-7.1/lib/libcuvidv4l2.so
#12 0x00007fffcae039dd in CuvidV4L2_Ioctl () at ///opt/nvidia/deepstream/deepstream-7.1/lib/libcuvidv4l2.so
#13 0x00007fffcaebf07c in v4l2_ioctl () at /lib/x86_64-linux-gnu/libv4l2.so.0
#14 0x00007fffcafd74d8 in gst_v4l2_allocator_stop () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideo4linux2.so
#15 0x00007fffcafdd688 in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideo4linux2.so
#16 0x00007ffff62ab5e2 in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#17 0x00007ffff62b3c78 in gst_buffer_pool_set_active () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#18 0x00007fffcafea959 in gst_v4l2_object_stop () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideo4linux2.so
#19 0x00007fffcaff17dc in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libgstnvvideo4linux2.so
#20 0x00007fff9c66287a in () at /lib/x86_64-linux-gnu/libgstvideo-1.0.so.0
#21 0x00007ffff62cf7c9 in gst_element_change_state () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#22 0x00007ffff62cfed5 in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#23 0x00007ffff62a888c in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#24 0x00007fff740c7d72 in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#25 0x00007ffff62cf7c9 in gst_element_change_state () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#26 0x00007ffff62cfed5 in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#27 0x00007ffff62a888c in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#28 0x00007fff740df389 in () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#29 0x00007ffff62cf7c9 in gst_element_change_state () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#30 0x00007ffff62cfed5 in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#31 0x00007ffff62a888c in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#32 0x00007fff80027346 in gst_ds_nvurisrc_bin_change_state(_GstElement*, GstStateChange) () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_nvurisrcbin.so
#33 0x00007ffff62cf7c9 in gst_element_change_state () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#34 0x00007ffff62cf80f in gst_element_change_state () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#35 0x00007ffff62cfed5 in () at /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
#36 0x00007ffff4adb967 in s_nvmultiurisrcbincreator_remove_source_impl(void*, unsigned int, int) () at /opt/nvidia/deepstream/deepstream/lib/libnvdsgst_customhelper.so
#37 0x00007ffff4adaf1e in gst_nvmultiurisrcbincreator_remove_source () at /opt/nvidia/deepstream/deepstream/lib/libnvdsgst_customhelper.so
#38 0x00007fffec04cc6d in s_stream_api_impl(NvDsServerStreamInfo*, void*) () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_nvmultiurisrcbin.so
#39 0x00007fffec04f880 in rest_api_server_start(_GstDsNvMultiUriBin*)::{lambda(NvDsServerStreamInfo*, void*)#1}::operator()(NvDsServerStreamInfo*, void*) const ()
at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_nvmultiurisrcbin.so
#40 0x00007fffec052d0c in void std::__invoke_impl<void, rest_api_server_start(_GstDsNvMultiUriBin*)::{lambda(NvDsServerStreamInfo*, void*)#1}&, NvDsServerStreamInfo*, void*>(std::__invoke_other, rest_api_server_start(_GstDsNvMultiUriBin*)::{lambda(NvDsServerStreamInfo*, void*)#1}&, NvDsServerStreamInfo*&&, void*&&) () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_nvmultiurisrcbin.so
#41 0x00007fffec051acb in std::enable_if<is_invocable_r_v<void, rest_api_server_start(_GstDsNvMultiUriBin*)::{lambda(NvDsServerStreamInfo*, void*)#1}&, NvDsServerStreamInfo*, void*>, void>::type std::__invoke_r<void, rest_api_server_start(_GstDsNvMultiUriBin*)::{lambda(NvDsServerStreamInfo*, void*)#1}&, NvDsServerStreamInfo*, void*>(rest_api_server_start(_GstDsNvMultiUriBin*)::{lambda(NvDsServerStreamInfo*, void*)#1}&, NvDsServerStreamInfo*&&, void*&&) () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_nvmultiurisrcbin.so
#42 0x00007fffec050d4f in std::_Function_handler<void (NvDsServerStreamInfo*, void*), rest_api_server_start(_GstDsNvMultiUriBin*)::{lambda(NvDsServerStreamInfo*, void*)#1}>::_M_invoke(std::_Any_data const&, NvDsServerStreamInfo*&&, void*&&) () at /usr/lib/x86_64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_nvmultiurisrcbin.so
#43 0x00007fffbea9c645 in std::function<void (NvDsServerStreamInfo*, void*)>::operator()(NvDsServerStreamInfo*, void*) const () at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#44 0x00007fffbea8a277 in handleRemoveStream(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*, std::function<void (NvDsServerStreamInfo*, void*)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#45 0x00007fffbea8b453 in nvds_rest_server_start(NvDsServerConfig*, NvDsServerCallbacks*)::{lambda(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*)#3}::operator()(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*) const () at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#46 0x00007fffbea95fb5 in NvDsServerStatusCode std::__invoke_impl<NvDsServerStatusCode, nvds_rest_server_start(NvDsServerConfig*, NvDsServerCallbacks*)::{lambda(Json::Value const&, Json::Value const&, Json::Value&--Type <RET> for more, q to quit, c to continue without paging--
, mg_connection*)#3}&, Json::Value const&, Json::Value const&, Json::Value&, mg_connection*>(std::__invoke_other, nvds_rest_server_start(NvDsServerConfig*, NvDsServerCallbacks*)::{lambda(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*)#3}&, Json::Value const&, Json::Value const&, Json::Value&, mg_connection*&&) () at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#47 0x00007fffbea93256 in std::enable_if<is_invocable_r_v<NvDsServerStatusCode, nvds_rest_server_start(NvDsServerConfig*, NvDsServerCallbacks*)::{lambda(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*)#3}&, Json::Value const&, Json::Value const&, Json::Value&, mg_connection*>, NvDsServerStatusCode>::type std::__invoke_r<NvDsServerStatusCode, nvds_rest_server_start(NvDsServerConfig*, NvDsServerCallbacks*)::{lambda(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*)#3}&, Json::Value const&, Json::Value const&, Json::Value&, mg_connection*>(nvds_rest_server_start(NvDsServerConfig*, NvDsServerCallbacks*)::{lambda(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*)#3}&, Json::Value const&, Json::Value const&, Json::Value&, mg_connection*&&) ()
at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#48 0x00007fffbea91165 in std::_Function_handler<NvDsServerStatusCode (Json::Value const&, Json::Value const&, Json::Value&, mg_connection*), nvds_rest_server_start(NvDsServerConfig*, NvDsServerCallbacks*)::{lambda(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*)#3}>::_M_invoke(std::_Any_data const&, Json::Value const&, Json::Value const&, Json::Value&, mg_connection*&&) ()
at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#49 0x00007fffbea9bc84 in std::function<NvDsServerStatusCode (Json::Value const&, Json::Value const&, Json::Value&, mg_connection*)>::operator()(Json::Value const&, Json::Value const&, Json::Value&, mg_connection*) const () at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#50 0x00007fffbea99683 in RequestHandler::handle(CivetServer*, mg_connection*) () at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#51 0x00007fffbea99e2b in RequestHandler::handlePost(CivetServer*, mg_connection*) () at /opt/nvidia/deepstream/deepstream/lib/libnvds_rest_server.so
#52 0x00007fff9f88a88b in CivetServer::requestHandler(mg_connection*, void*) () at /opt/nvidia/deepstream/deepstream-7.1/lib/libcivetweb.so.1
#53 0x00007fff9f87ef5a in handle_request () at /opt/nvidia/deepstream/deepstream-7.1/lib/libcivetweb.so.1
#54 0x00007fff9f881027 in handle_request_stat_log () at /opt/nvidia/deepstream/deepstream-7.1/lib/libcivetweb.so.1
#55 0x00007fff9f8816a1 in process_new_connection () at /opt/nvidia/deepstream/deepstream-7.1/lib/libcivetweb.so.1
#56 0x00007fff9f882267 in worker_thread () at /opt/nvidia/deepstream/deepstream-7.1/lib/libcivetweb.so.1
#57 0x00007ffff7ce2ac3 in () at /lib/x86_64-linux-gnu/libc.so.6
#58 0x00007ffff7d74850 in () at /lib/x86_64-linux-gnu/libc.so.6