Segfault at CameraProvider::create()

Hello,

When I try to link my camera app against nvargus directly I get a Segfault when the CameraProvider::create() is called.
It works fine when i link against the nvargus_socketclient lib.

I also tested another camera app witch works fine with both variants.

Argus error message:

(Argus) Error BadParameter: No EGLDisplay (in src/api/EGLImageBufferImpl.cpp, function initialize(), line 66)
(Argus) Error BadParameter:  (propagating from src/api/BufferOutputStreamImpl.cpp, function createEGLImageBuffer(), line 210)
(Argus) Error InvalidState: Buffer deleted while in use by a capture (in src/api/BufferOutputStreamImpl.cpp, function bufferDeleted(), line 322)
(Argus) Error BadParameter:  (propagating from src/api/BufferOutputStreamImpl.cpp, function createBuffer(), line 144)
Segmentation fault (core dumped)

Did you check any of sample code if able see the same issue?

I also get errors with the most of the argus samples when the DISABLE_MULTIPROCESS is enabled.

As example the bayerAverageMap sample works fine with DISABLE_MULTIPROCESS=0 and otherwise I get this errors:

Executing Argus Sample: argus_bayeraveragemap
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: No override file found. ----
(NvCamV4l2) Error ModuleNotPresent: V4L2Device not available (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findDevice(), line 256)
(NvCamV4l2) Error ModuleNotPresent:  (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function initialize(), line 60)
(NvOdmDevice) Error ModuleNotPresent:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 107)
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
NvPclStartPlatformDrivers: Failed to start module drivers
NvPclStateControllerOpen: Failed ImagerGUID 1. (error 0xA000E)
NvPclOpen: PCL Open Failed. Error: 0xf
SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 593)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 305)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 471)
Acquiring SCF Camera device source via index 0 has failed. ---- imager: No override file found. ----
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 460: Error: Bad parameter: "ae.CameraEfficiency=0.1508"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 473: Error: Bad parameter: "ae.MeanAlg.ConvergeSpeed=0.10"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 810: Error: Bad parameter: "awb.convergeSpeed=0.3"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3100: Error: Bad parameter: "af.alg.over_scan_percent=0.15"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3101: Error: Bad parameter: "af.alg.smooth_over_scan_percent=0.035"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3107: Error: Bad parameter: "af.alg.scene_change_t_guard_factor=0.30f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3108: Error: Bad parameter: "af.alg.scene_stable_sharpness=0.15f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3109: Error: Bad parameter: "af.alg.scene_change_sharpness=0.30f"
Motion points are not strictly ascending.NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 4524: Error: 11: "tnr.v1.consistencyPoints={0.00,0.25,0.50,0.75,1.00}"
Argus Version: 0.98.3 (single-process)
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 460: Error: Bad parameter: "ae.CameraEfficiency=0.1508"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 473: Error: Bad parameter: "ae.MeanAlg.ConvergeSpeed=0.10"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 810: Error: Bad parameter: "awb.convergeSpeed=0.3"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3100: Error: Bad parameter: "af.alg.over_scan_percent=0.15"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3101: Error: Bad parameter: "af.alg.smooth_over_scan_percent=0.035"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3107: Error: Bad parameter: "af.alg.scene_change_t_guard_factor=0.30f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3108: Error: Bad parameter: "af.alg.scene_stable_sharpness=0.15f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3109: Error: Bad parameter: "af.alg.scene_change_sharpness=0.30f"
Motion points are not strictly ascending.NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 4524: Error: 11: "tnr.v1.consistencyPoints={0.00,0.25,0.50,0.75,1.00}"
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
CONSUMER: Creating context.
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 10:81:
    <attribute name="repetitions" type="parameter" dataType="uint" default="1"/>

    <!-- Flow -->
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:53:
    <node name="lowpass" file="filters/box3x3.xml"/>
    <node name="ltmFilter" file="filters/ltm42
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:49:

    <!-- Parameters -->
    <export name="Quality" from="ltm" attribute="quality" default="3" min=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/HdfxStage.cpp, function doAsyncInitialize(), line 147)
SCF: Error InsufficientMemory: HdfxStage initialization failed (in src/components/stages/HdfxStage.cpp, function doAsyncInitialize(), line 252)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 10:81:
    <attribute name="repetitions" type="parameter" dataType="uint" default="1"/>

    <!-- Flow -->
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:53:
    <node name="lowpass" file="filters/box3x3.xml"/>
    <node name="ltmFilter" file="filters/ltm.x
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:46:

    <!-- Parameters -->
    <export name="Quality" from="ltm" attribute="quality" default="3" min=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/AoltmStage.cpp, function doAsyncInitialize(), line 100)
SCF: Error InsufficientMemory: AoltmStage initialization failed (in src/components/stages/AoltmStage.cpp, function doAsyncInitialize(), line 130)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 115
        Invalid default value of type 'vec4'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 13:96:

    <!-- Flow -->
    <flow operation="execute"/>
    <flow operation="detach" operand0="inputImag
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
SCF: Error InsufficientMemory:  (propagating from src/components/stages/SharpenStage.cpp, function doAsyncInitialize(), line 159)
SCF: Error InsufficientMemory: SharpenStage initialization failed (in src/components/stages/SharpenStage.cpp, function doAsyncInitialize(), line 182)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 24:81:

    <!-- Flow -->
    <flow operation='clone' operand0='inputImageY' operand1='outputImageY' opera
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 15:57:
    <node name='transmissionMap' file='networks/transmissionMapBlockYCbCr420.xml'/>
    <node name=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/DeFogStage.cpp, function doAsyncInitialize(), line 91)
SCF: Error InsufficientMemory: DeFogStage initialization failed (in src/components/stages/DeFogStage.cpp, function doAsyncInitialize(), line 151)
CONSUMER: Connecting to stream.
CONSUMER: Connected to stream.
CONSUMER: Waiting until producer is connected...
PRODUCER: Starting repeat capture requests.
CONSUMER: Producer is connected; continuing.
(Camera_ISP) Error BadParameter: Error: cct number being zero (in state_update/blocks/AP_RADTF.cpp, function NvCameraIspUpdateState_AP_RADTF_isp5(), line 107)
(Camera_ISP) Error BadParameter:  (propagating from state_update/nvcamera_isp_update_state.cpp, function NvCameraIspUpdateInputStateHw(), line 100)
SCF: Error BadParameter:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function generate(), line 1162)
SCF: Error BadParameter:  (propagating from src/components/ac_stages/AcMergeStage.cpp, function doHandleRequest(), line 84)
SCF: Error BadParameter:  (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 158)
SCF: Error BadParameter: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 997)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc

Did you make sure the MMAPI source version sync up with BSP version?

The MMAPI was installed using the Nividia SDK Manager so it should be synced

What’s your versioin?
cat /etc/nv_tegra_release

# R32 (release), REVISION: 7.2, GCID: 30192233, BOARD: t186ref, EABI: aarch64, DATE: Sun Apr 17 09:53:50 UTC 2022

Just try below without problem on my Xavier with r32.7.2
Please have a check these binary on your Xavier to clarify the problem.

argus_yuvjpeg (344.0 KB)
argus_oneshot (326.2 KB)
argus_userautoexposure (1009.2 KB)