Deepstream runtime_source_add_delete.py application segmentation fault(core dumped)

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
Jetson Xavier Nx
• DeepStream Version
Deepstream 6.1.1
• JetPack Version (valid for Jetson only)
5.0.1 [rev. 1]
• TensorRT Version
8.4
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
bugs
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
The issue is that runtime_source_add_delete.py python application throws the segmentation fault(core dumped) error. So in order to reproduce this issue simply comment out loop.quit() at line number 222. Reason behind this is that application should keep on running after all sources are removed, so that we can add stream again later without closing the application. This sample was previously working with Deepstream 6.0, But after update to Deepstream 6.1.1. Its not working anymore and one more thing you can perform same thing on Ubuntu (x86_64) with Deepstream 6.1.1 there will no issue application will keep on running without any error or issue.

1.Could you attach your log here?
2.Deepstream 6.2 GA is available. Could you try it with DS6.2. https://developer.nvidia.com/deepstream-getting-started

LOGS:

python3 deepstream_rt_src_add_del.py file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4
Creating Pipeline

Creating streammux

Creating source_bin 0

Creating uridecodebin for [file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4]
source-bin-00
Creating Pgie

Creating nvtracker

Creating tiler

Creating nvvidconv

Creating nvosd

Creating nv3dsink

Adding elements to Pipeline

Linking elements in the Pipeline

gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so
gstnvtracker: Batch processing is ON
gstnvtracker: Past frame output is OFF
[NvMultiObjectTracker] Initialized
0:00:00.593460196 8330 0x38dab300 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1170> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5
WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine open error

0:00:04.252584330 8330 0x38dab300 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1897> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed
0:00:04.303537718 8330 0x38dab300 WARN nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger: NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2002> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine failed, try rebuild

0:00:04.303633239 8330 0x38dab300 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1923> [UID = 1]: Trying to create engine from model files
WARNING: [TRT]: The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag whenever possible.
0:01:31.203268785 8330 0x38dab300 INFO nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger: NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1955> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b4_gpu0_int8.engine successfully
INFO: [Implicit Engine Info]: layers num: 3
0 INPUT kFLOAT input_1 3x368x640
1 OUTPUT kFLOAT conv2d_bbox 16x23x40
2 OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40

0:01:31.290661373 8330 0x38dab300 INFO nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus: [UID 1]: Load new model:dstest_pgie_config.txt sucessfully
Decodebin child added: source

Decodebin child added: decodebin0

Now playing…
1 : file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4
Starting pipeline

Decodebin child added: qtdemux0

Decodebin child added: multiqueue0

Decodebin child added: h264parse0

Decodebin child added: capsfilter0

Decodebin child added: aacparse0

Decodebin child added: avdec_aac0

Decodebin child added: nvv4l2decoder0

Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
In cb_newpad

gstname= video/x-raw
sink_0
Decodebin linked to pipeline
In cb_newpad

gstname= audio/x-raw
Calling Start 2
Creating uridecodebin for [file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4]
source-bin-02
Decodebin child added: source

Decodebin child added: decodebin1

Decodebin child added: qtdemux1

Decodebin child added: multiqueue1

Decodebin child added: h264parse1

Decodebin child added: capsfilter1

Decodebin child added: aacparse1

Decodebin child added: avdec_aac1

Decodebin child added: nvv4l2decoder1

Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
In cb_newpad

gstname= video/x-raw
sink_2
Decodebin linked to pipeline
In cb_newpad

gstname= audio/x-raw
Calling Start 3
Creating uridecodebin for [file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4]
source-bin-03
Decodebin child added: source

Decodebin child added: decodebin2

Decodebin child added: qtdemux2

Decodebin child added: multiqueue2

Decodebin child added: h264parse2

Decodebin child added: capsfilter2

Decodebin child added: aacparse2

Decodebin child added: avdec_aac2

Decodebin child added: nvv4l2decoder2

Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
In cb_newpad

gstname= video/x-raw
sink_3
Decodebin linked to pipeline
In cb_newpad

gstname= audio/x-raw
Calling Start 1
Creating uridecodebin for [file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4]
source-bin-01
Decodebin child added: source

Decodebin child added: decodebin3

Decodebin child added: qtdemux3

Decodebin child added: multiqueue3

Decodebin child added: h264parse3

Decodebin child added: capsfilter3

Decodebin child added: aacparse3

Decodebin child added: avdec_aac3

Decodebin child added: nvv4l2decoder3

Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
In cb_newpad

gstname= video/x-raw
sink_1
Decodebin linked to pipeline
In cb_newpad

gstname= audio/x-raw
Calling Stop 1
STATE CHANGE SUCCESS

sink_1
STATE CHANGE SUCCESS

Calling Stop 2
STATE CHANGE SUCCESS

sink_2
STATE CHANGE SUCCESS

Calling Stop 3
STATE CHANGE SUCCESS

sink_3
STATE CHANGE SUCCESS

Calling Stop 0
STATE CHANGE SUCCESS

sink_0
Segmentation fault (core dumped)

Segmentation fault (core dumped) is happening at
streammux.release_request_pad(sinkpad) [line number 169 ]

I also tested this on Deepstream 6.2. It still causes the same error. [segmentation fault(core dumped)]

OK, we can repro this problem in our env. We’ll check it.

Is there any solution for this yet?

Yes. Please pay attention to our next version, it will be updated soon.

DeepStream 6.3 is released: DeepStream 6.3 is now available for download!