Segfault In stop start playing gstreamer included nvarguscamerasrc

Hi all
I read this link https://forums.developer.nvidia.com/t/bug-nvarguscamerasrc-segmentation-fault/111007
I faced to same problem, when a pipe line in gstreamer that include nvarguscamerasrc stop and play Continuously, segfault occurred, Does any patch realesed to solve this problem?

Did you use the same r32.1? If not I don’t think you can apply those patch.

Thanks for your attention we use l4t version r32.4.4 and our JetPack version 4.4.1, but segfault occurred when gstreamer pipeline stop and start Continuously, what should be done to solve problem?

What’s the gstreamer pipeline?
It’s could be the sensor driver capture failed cause the problem.
What’s sensor configure?

As said by @ShaneCCC, it would help to know the gstreamer pipeline and context where it is launched, and how you start and stop it. I think starting and stopping should be ok, but some issue may happen when destroying the pipeline.

You may try this simple example that will launch a pipeline from CSI camera through Argus to xvimagesink (tested on XavierNX R32.4.4, not on TX2). You should be able to start and stop many times without problems:

#!/usr/bin/env python

import sys, os
import gi
gi.require_version('Gst', '1.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gst, GObject, Gtk


def verbose_deep_notify_cb(object, orig, pspec, component):
    """
    A quick attempt to mimic gst-launch verbose mode.
    """
    if pspec.value_type == Gst.Caps.__gtype__:
    	caps = orig.get_current_caps()
	if caps != None:
	   print("%s/%s/%s: caps = \"%s\"" % (object.get_name(), orig.parent.get_name(), orig.get_name(), caps.to_string()))



class GTK_Main:
    def __init__(self):
        window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
        window.set_title("CamRecorder")
        window.set_default_size(100, 100)
        window.connect("destroy", Gtk.main_quit, "WM destroy")
        vbox = Gtk.VBox()
        window.add(vbox)
        hbox = Gtk.HBox()
        vbox.pack_start(hbox, False, False, 0)
        hbox.set_border_width(10)
        hbox.pack_start(Gtk.Label(), False, False, 0)
        self.button = Gtk.Button("Start")
        self.button.connect("clicked", self.start_stop)
        hbox.pack_start(self.button, False, False, 0)
        self.button2 = Gtk.Button("Quit")
        self.button2.connect("clicked", self.exit)
        hbox.pack_start(self.button2, False, False, 0)
        hbox.add(Gtk.Label())
        window.show_all()

        # Set up the gstreamer pipeline
        gst_str = "nvarguscamerasrc ! video/x-raw(memory:NVMM),format=(string)NV12,width=(int)640,height=(int)480 ! nvvidconv ! xvimagesink"
        self.player = Gst.parse_launch (gst_str)
        self.player.connect('deep-notify', verbose_deep_notify_cb, self)
        bus = self.player.get_bus()
        bus.add_signal_watch()
        bus.enable_sync_message_emission()
        bus.connect("message", self.on_message)

    def start_stop(self, w, data=None):
        if self.button.get_label() == "Start":
            print("Setting pipeline to READY ...")
            self.player.set_state(Gst.State.READY)
            print("Setting pipeline to PAUSED ...")
            self.player.set_state(Gst.State.PAUSED)
            print("Setting pipeline PLAYING...")
            self.player.set_state(Gst.State.PLAYING)
            self.button.set_label("Stop")
        else:
            print("Setting pipeline to NULL ...")
            self.player.set_state(Gst.State.NULL)
            self.button.set_label("Start")

    def exit(self, w):
        self.player.set_state(Gst.State.NULL)
        Gtk.main_quit()

    def on_message(self, bus, message):
        t = message.type
        if t == Gst.MessageType.EOS:
            print('Received message type EOS')
            self.player.set_state(Gst.State.NULL)
            self.button.set_label("Start")
        elif t == Gst.MessageType.ERROR:
            err, debug = message.parse_error()
            print "Error: %s" % err, debug
            self.player.set_state(Gst.State.NULL)
            self.button.set_label("Start")
	

Gst.debug_set_active(True)
Gst.debug_set_default_threshold(0)
GObject.threads_init()
Gst.init(None)
GTK_Main()
Gtk.main()

In case you are experiencing that from opencv, but sure to properly release the videoCapture.
In case of signal termination, you may also install a signal handler such as in this post (second part in C++).