AnsweredAssumed Answered

gst-launch-1.0 segmentation Fault

Question asked by Mohiuddin on May 24, 2017
Latest reply on May 24, 2017 by igorpadykov

Hi, 

We are using gst-launch in our application to stream the CSI over Display whenever it detects Signal and Stop the Streamer when there is no signal.. 

Thus, i was testing gst-launch functionality with the following simple code:

 

void MainLoop()
{
   char command[256];
   int ret = 0;
   int loopCount = 0;
   while(1)
   {
      memset(command, '\0', sizeof(command));
      sprintf(command, "/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &");
      ret = system(command);
      printf("StartStreamer: command=[%s], status:%d\n", command, ret);
      sleep(15);   
      memset(command, '\0', sizeof(command));
      sprintf(command, "killall gst-launch-1.0");
      ret = system(command);
      printf("StopStreamer: command=[%s], status = %d\n", command, ret);
      sleep(15);
      loopCount++;
      printf("Loop Count:%d\n", loopCount);
      fflush(stdout);
   }

}

 

After running a loop count of about 2400+ it failed with segmentation Fault, in the next restart of the utility, it crashed at 551 Loop Count and then at  1300+ Loop Count..

 

Following is the Log at the stdout before segmentation Fault:

 

Loop Count:551
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:0
StopStreamer: command=[killall gst-launch-1.0], status = 4
Loop Count:276828289
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828290
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828291
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828292
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828293
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828294
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828295
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828296
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828297
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828298
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828299
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828300
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
StopStreamer: command=[killall gst-launch-1.0], status = 32512
Loop Count:276828301
StartStreamer: command=[/usr/bin/gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink &], status:32512
[1]+ Segmentation fault ./startStop

 

I believe it is due to some memory corruption .. How can we resolve this issue...

Outcomes