Deepstream-app recreate pipleline with v42lsrc failed

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU) dGPU
**• DeepStream Version 5.1

Hi, I tried to switch the pipleline using a same v42l camera as the stream input in deepstream-app. The basic idea is to parse different configuration A and B into two appCtx. In my working process, firstly I create A pipeline, and then pause A, destory A. Next I create B pipeline.

The problem is when I used the file as the source element, it seems like no problem. When I used the v42l source element. The program will crash during creating B pipeline. it seems like the nvinfer cause this problem. How could I fix this issue? Looking forward to your reply

There is no useful information in your description.

Here is my deepsteam-app config:
[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5

[tiled-display]
enable=1
rows=1
columns=1
width=1920
height=1080
gpu-id=0
nvbuf-memory-type=0

[source0]
enable=0
type=3
#uri=file:///opt/nvidia/deepstream/deepstream-5.1/samples/streams/sample_1080p_h264.mp4
uri=file:///home/js/jc2.mp4
#if the type = 3, the num-source will indicate the number of URIs.
num-sources=1
#gpu-id=0
#cudadec-memtype=0

[source1]
enable=1
#Type - 1=CameraV4L2 2=URI 3=MultiURI 4=RTSP 5=CSI
type=1
camera-width=1920
camera-height=1080
camera-fps-n=60
camera-fps-d=1
camera-v4l2-dev-node=0
#gpu-id=0
#cudadec-memtype=0

[sink0]
enable=1
type=2
sync=0
source-id=0
gpu-id=0
nvbuf-memory-type=0

[sink1]
enable=0
type=3
#1=mp4 2=mkv
container=1
#1=h264 2=h265 3=mpeg4
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
bitrate=2000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0
output-file=out.mp4
source-id=0

[osd]
enable=1
gpu-id=0
border-width=1
text-size=0
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
live-source=0
batch-size=1
batched-push-timeout=40000
width=1920
height=1080
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary.txt

[tests]
file-loop=1

The pipeline B is the same one except the nvinfer config file.

The code comes from the functions in deepstream-app: parse_config_file, pause_pipeline, and destory pipeline.

I would like to provide a demo example to help you recover this bug. But it is a qt project. Any other thing are you needed?

Can pipeline B work separately with deepstream-app?

I tested the problem again and found it is not working for using file as stream input now. By the way, to avoid the name conflict, I used different source id but the same file for two different pipeline. Restarting A or restarting B pipeline has no problem. and pipeline B could also work using deepstream-app.

There is the crashed program tracker output:
1 ?? 0x7ffefec91463
2 nvinfer1::PluginRegistrar::PluginRegistrar() 0x7ffed044cfb2
3 _Z41__static_initialization_and_destruction_0ii 0x7ffed044c280
4 _GLOBAL__sub_I_yoloPlugins.cpp 0x7ffed044c2b3
5 call_init dl-init.c 72 0x7ffff7de38d3
6 _dl_init dl-init.c 119 0x7ffff7de38d3
7 dl_open_worker dl-open.c 522 0x7ffff7de839f
8 __GI__dl_catch_exception dl-error-skeleton.c 196 0x7fffee1471ef
9 _dl_open dl-open.c 605 0x7ffff7de796a
10 dlopen_doit dlopen.c 66 0x7fffe8e3bf96
11 __GI__dl_catch_exception dl-error-skeleton.c 196 0x7fffee1471ef
12 __GI__dl_catch_error dl-error-skeleton.c 215 0x7fffee14727f
13 _dlerror_run dlerror.c 162 0x7fffe8e3c745
14 __dlopen dlopen.c 87 0x7fffe8e3c051
15 nvdsinfer::DlLibHandle::DlLibHandle(std::string const&, int) 0x7ffee4d498fc
16 std::_MakeUniqnvdsinfer::DlLibHandle::__single_object std::make_unique<nvdsinfer::DlLibHandle, char (&) [4096], int>(char (&) [4096], int&&) 0x7ffee4d19c2a
17 nvdsinfer::NvDsInferContextImpl::initialize(_NvDsInferContextInitParams&, void *, void ( *)(INvDsInferContext *, unsigned int, NvDsInferLogLevel, const char *, void *)) 0x7ffee4d0ba2d
18 createNvDsInferContext(INvDsInferContext * *, _NvDsInferContextInitParams&, void *, void ( *)(INvDsInferContext *, unsigned int, NvDsInferLogLevel, const char *, void *)) 0x7ffee4d1198d
19 gst_nvinfer_start(_GstBaseTransform *) 0x7ffee53f14bb
20 ?? 0x7fffe55f6270
21 ?? 0x7fffe55f6505
22 ?? 0x7ffff295e6ab
23 gst_pad_set_active 0x7ffff295f126
24 ?? 0x7ffff293cf0d
25 gst_iterator_fold 0x7ffff294f884
26 ?? 0x7ffff293da16
27 ?? 0x7ffff293f95e
28 ?? 0x7ffff293fc8f
29 gst_element_change_state 0x7ffff2941d5e
30 ?? 0x7ffff2942499
31 ?? 0x7ffff291fa02
32 gst_element_change_state 0x7ffff2941d5e
33 ?? 0x7ffff2942499
34 ?? 0x7ffff291fa02
35 gst_element_change_state 0x7ffff2941d5e
36 gst_element_change_state 0x7ffff2942045
37 ?? 0x7ffff2942499
38 restart_c_pipeline dbthread.cpp 635 0x555555609375
39 DBThread::run dbthread.cpp 842 0x555555609a8a
40 ?? 0x7fffeefd997a
41 start_thread pthread_create.c 463 0x7fffeed176db
42 clone clone.S 95 0x7fffee10171f

Well, I will give you a qt demo to recover this problem . The only thing I changed is changing the screen sink to the QT Widget.

apptest5.zip (88.5 KB)

Can you write a simple reproducing app that we can run just with deepstream environment? If the problem is caused by deepstream, deepstream application is enough. We can not setup the whole environment as yours.

A pure deepstream thread will enter the main-loop and I need a main thread as a interrupt control, But I will try to recover this bug only use deepstream.

Hi, I have a reproducing app using only deepstream environment. The basic idea is when I am quitting the deepstream-app, restarting a new pipeline using the same configuration. And the program will be crashed with the same debugger tracing log.
deepstream_app_main.cpp (28.9 KB)

Using your given configuration yolov3, I got the same error: