Please provide the following info (tick the boxes after creating this topic): Software Version
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other
Target Operating System
Linux
QNX
other
Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other
SDK Manager Version
1.9.3.10904
other
Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other
It seems the APIs to allow sharing NvSciBuf handles via NvSciIpc can cause a kernel panic. Say process A has an NvSciBuf that it needs to send to process B. The last stage in that sequence of sending the buffer is A reads the NvSciBufObjIpcExportDescriptor from the IPC handle and imports the buffer. If process B closes its handles to the NvSciBuf after A has imported the buffer, then everything operates as expected and A can still use the buffer. However, if process B closes its handle either before or while A is importing the NvSciBuf, then this causes a kernel panic.
Checking the journal from the failed boot shows this:
Feb 01 13:52:05 tegra-ubuntu kernel: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
Feb 01 13:52:05 tegra-ubuntu kernel: Mem abort info:
Feb 01 13:52:05 tegra-ubuntu kernel: ESR = 0x0000000096000006
Feb 01 13:52:05 tegra-ubuntu kernel: EC = 0x25: DABT (current EL), IL = 32 bits
Feb 01 13:52:05 tegra-ubuntu kernel: SET = 0, FnV = 0
Feb 01 13:52:05 tegra-ubuntu kernel: printk: console [ttyS2]: printing thread stopped
Feb 01 13:52:05 tegra-ubuntu kernel: EA = 0, S1PTW = 0
Feb 01 13:52:05 tegra-ubuntu kernel: FSC = 0x06: level 2 translation fault
Feb 01 13:52:05 tegra-ubuntu kernel: Data abort info:
Feb 01 13:52:05 tegra-ubuntu kernel: ISV = 0, ISS = 0x00000006
Feb 01 13:52:05 tegra-ubuntu kernel: CM = 0, WnR = 0
Feb 01 13:52:05 tegra-ubuntu kernel: user pgtable: 4k pages, 48-bit VAs, pgdp=0000000212091000
Feb 01 13:52:05 tegra-ubuntu kernel: [0000000000000008] pgd=0800000210fd8003, p4d=0800000210fd8003, pud=08000001040ea003, pmd=0000000000000000
Feb 01 13:52:05 tegra-ubuntu kernel: Internal error: Oops: 96000006 [#1] PREEMPT_RT SMP
I would expect the import in process A to simply fail at the API level if process B closes its handle too early and just return an NvSciError. Is this a known issue? Is there is a patch to address this?
In the described scenario, did the NvSciBufObjIpcImport() function still return NvSciError_Success even though the kernel panic occured? Do you expect the function to return an error?
The function NvSciBufObjIpcImport is what is causing the panic. So no it did not return at all. This is reproducible if process B closes its handle to the buffer before process A calls NvSciBufObjIpcImport. If that happens, then the panic occurs during the call to NvSciBufObjIpcImport which means it does not return any error code at all. This is unexpected. And yes for a failure case like this, NvScibufObjIpcImport should return an error code and not simply cause a kernel panic.
Could you please try reproducing the issue with the “rawstream” application? If the issue persists, please share any modifications you made and the commands you used. This will help us understand the problem better.
Please note that patches for issues are not provided in forum support. For information regarding the schedule of the next release, kindly contact your Nvidia representative.