This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Bug Report: Null pointer dereference in TIDL when processing multiple images through ONNX RT

Part Number: TDA4VM

Running my inference python script with multiple images to process results in TIDL segfaulting on the host.

Debugging shows that the custom layer function TIDL_customProcess allocates memory via TIDL_getMemoryChunkFromSystem and does not check if the return value was NULL.  It then does a memcpy into this result, which causes the segfault.

Further investigation shows that the reason NULL is returned is because TIDL_resetSysmem is only called during TIDL_init, but not during processing between layers (except for some reason conv2d_base calls it during processing, but if you don't have that layer that doesn't help you!)

Note, on one of the calls to TIDL_resetSysmem during init, there is a comment "System memories are expected to be reset for every layer", but that doesn't seem to be happening.

Thus with enough images supplied causing repeated calls to TIDL_customProcess, the memory is fully consumed and eventually it returns null, causing the problem.