Sigsegv with nvgstcapture-1.0

I am running nvgstcapture for test purposes and getting a segmentation fault consistently. The process is 100% repeatable. R24.2.1 with fresh install.

nvgstcapture-1.0
1 // Start recording
2 // take snapshot - works
2 // take another snapshot - always crashes with sigsegv

Any ideas?

Have you read http://developer.download.nvidia.com/embedded/L4T/r24_Release_v2.1/Docs/Accelerated_GStreamer_User_Guide_Release_24.2.1.pdf ?

[EDIT: @sperok I suppose from your previous posts that you know this. Could you just post the errors you are seeing ?]

I read through the docs and the nvgstcapture source code. I added some debugging g_prints to the nvgstcapture code to try to pin down the source of the error, but still pretty much stuck with a non-descriptive seg fault:

ubuntu@mvp1:~/nvgstapps_src/nvgst_sample_apps/nvgstcapture-1.0$ ./nvgstcapture-1.0
Preview resolution: 3840x2160
Image Capture resolution: 3840x2160
Video Capture resolution: 3840x2160
Encoder null, cannot set bitrate!
Profile only supported for H.264 encoder
bitrate = 20000000
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and Mjstreaming
Available Sensor modes : 
3840 x 2160 FR=60.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1920 x 1080 FR=60.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10

NvCameraSrc: Trying To Set Default Camera Resolution. Selected 3840x2160 FrameRate = 30.000000 ...

Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 8 
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 

KPI launch time in mS: 443
1
Video Capture Started

Recording Started, Enter (0) to stop OR (2) to take snapshot 
===== NVENC blits (mode: 1) into block linear surfaces =====
2
Taking snapshot 
Waiting for snapshot mutex
Got snapshot mutex
Wait for signal
Writing snapshot
got snapshot and signal
Unlocked snapshot mutex
Video Snapshot Captured 
2
Taking snapshot 
Waiting for snapshot mutex
Got snapshot mutex
Wait for signal
Segmentation fault
ubuntu@mvp1:~/nvgstapps_src/nvgst_sample_apps/nvgstcapture-1.0$

and running inside gdb:

ubuntu@mvp1:~/nvgstapps_src/nvgst_sample_apps/nvgstcapture-1.0$ gdb ./nvgstcapture-1.0
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./nvgstcapture-1.0...done.
(gdb) run
Starting program: /home/ubuntu/nvgstapps_src/nvgst_sample_apps/nvgstcapture-1.0/nvgstcapture-1.0 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Preview resolution: 3840x2160
Image Capture resolution: 3840x2160
Video Capture resolution: 3840x2160
Encoder null, cannot set bitrate!
Profile only supported for H.264 encoder
bitrate = 20000000
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and Mjstreaming[New Thread 0x7fb6a89200 (LWP 19400)]
[New Thread 0x7fb6289200 (LWP 19401)]
[New Thread 0x7fb5a89200 (LWP 19402)]
[New Thread 0x7fb5224200 (LWP 19423)]
[New Thread 0x7fb4a24200 (LWP 19424)]
[New Thread 0x7fa7fff200 (LWP 19425)]
[New Thread 0x7fa77ff200 (LWP 19426)]
[New Thread 0x7fa6fff200 (LWP 19427)]

Available Sensor modes : 
3840 x 2160 FR=60.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
1920 x 1080 FR=60.000000 CF=0xf09208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
[New Thread 0x7fa67ff200 (LWP 19457)]

NvCameraSrc: Trying To Set Default Camera Resolution. Selected 3840x2160 FrameRate = 30.000000 ...

[New Thread 0x7fa501e200 (LWP 19460)]
Framerate set to : 30 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 8 
[New Thread 0x7f87421200 (LWP 19462)]
===== MSENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 

KPI launch time in mS: 712
1
Video Capture Started

Recording Started, Enter (0) to stop OR (2) to take snapshot 
===== NVENC blits (mode: 1) into block linear surfaces =====
2
Taking snapshot 
Waiting for snapshot mutex
Got snapshot mutex
Wait for signal
[New Thread 0x7f76aa6200 (LWP 19929)]
Writing snapshot
got snapshot and signal
Unlocked snapshot mutex
Video Snapshot Captured 
2
Taking snapshot 
Waiting for snapshot mutex
Got snapshot mutex
Wait for signal

Thread 5 "queue3:src" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fb5224200 (LWP 19423)]
0x0000007fb6eebae4 in ?? () from /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so
(gdb) bt
#0  0x0000007fb6eebae4 in ?? () from /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so
#1  0x0000007fb6eec720 in jpegTegraEncoderCompress () from /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so
#2  0x0000007fb6eb4924 in jpeg_write_raw_data () from /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so
#3  0x0000007fb7728ad0 in ?? () from /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libnvgstjpeg.so
#4  0x0000007fb7e2ae50 in ?? () from /usr/lib/aarch64-linux-gnu/libgstvideo-1.0.so.0
#5  0x0000000000649db0 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)
  1. Could you verify only the 3840x2160 have this problem?
  2. Could you try the mutimedia sample code 09_camera_jpeg_capture have the sample problem or not.

This failure does not occur with the stock NVidia dev kit and camera. I have not root caused it yet. The failure does occur with an IMX 274 sensor mounted on a Leopard Imaging carrier card, so will be debugged in that context.