Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• T4
• DeepStream Version
• 5.0
• TensorRT Version
• 7.0
• NVIDIA GPU Driver Version (valid for GPU only)
• 450.51.05
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)
• Plugin: libnvdsgst_tracker
Hello!
I’m attempting to create my own custom tracker and have ran into an issue when I populate the NvMOTTrackedObjBatch *pTrackedObjectsBatch
. I can populate the data just fine and have verified that the objects persist before I return an NvMOTStatus_OK
. However, the issue is when the function returns, I get a Segmentation Fault.
This is the stack trace from Valgrind:
==5103== Thread 13:
==5103== Use of uninitialised value of size 8
==5103== at 0x1C410932: NvTrackerProc::updateFrameMeta(_NvDsFrameMeta*, _NvMOTTrackedObjList const&, NvTrackerProc::ProcParams const&) (in /opt/nvidia/deepstream/deepstream-5.0/lib/gst-plugins/libnvdsgst_tracker.so)
...
==5103== Invalid write of size 8
==5103== at 0x1C410932: NvTrackerProc::updateFrameMeta(_NvDsFrameMeta*, _NvMOTTrackedObjList const&, NvTrackerProc::ProcParams const&) (in /opt/nvidia/deepstream/deepstream-5.0/lib/gst-plugins/libnvdsgst_tracker.so)
...
==5103== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==5103== Access not within mapped region at address 0x38
==5103== at 0x1C410932: NvTrackerProc::updateFrameMeta(_NvDsFrameMeta*, _NvMOTTrackedObjList const&, NvTrackerProc::ProcParams const&) (in /opt/nvidia/deepstream/deepstream-5.0/lib/gst-plugins/libnvdsgst_tracker.so)
The code below is roughly what I’m doing to populate the pTrackedObjectsBatch
.
NvMOTTrackedObjList* MOTobjList = &pTrackedObjectsBatch->list[0];
for(size_t i = 0; i < objects.size; ++i)
{
customTrackerObject trackerObject = objects.at(i);
MOTobjList->list[i] = NvMOTTrackedObj{};
MOTobjList->list[i].classId = trackerObject.classId;
MOTobjList->list[i].trackingId = trackerObject.trackingId;
MOTobjList->list[i].bbox = {trackerObject.bbox.x,
trackerObject.bbox.y,
trackerObject.bbox.width,
trackerObject.bbox.height};
MOTobjList->list[i].confidence = trackerObject.confidence;
MOTobjList->list[i].age = trackerObject.age;
MOTobjList->list[i].associatedObjectIn = new NvMOTObjToTrack;
MOTobjList->list[i].associatedObjectIn->classId = trackerObject.associatedObjectIn->classId;
MOTobjList->list[i].associatedObjectIn->bbox = {trackerObject.associatedObjectIn->bbox.x,
trackerObject.associatedObjectIn->bbox.y,
trackerObject.associatedObjectIn->bbox.width,
trackerObject.associatedObjectIn->bbox.height};
MOTobjList->list[i].associatedObjectIn->confidence = trackerObject.associatedObjectIn->confidence;
MOTobjList->list[i].associatedObjectIn->doTracking = true;
}
MOTobjList->numFilled = objects.size;
MOTobjList->valid = true;
I should note that I’m only testing a single stream and am not concerned with multiple streams (at least not yet.)
I’m unsure as to what the issue could be since I’m able to access the data before I return from the processing function. Although, the docstring states:
* @param [out] pTrackedObjectsBatch
* A pointer to a batch of lists of tracked object
* slots to be filled by the tracker. The batch is
* allocated by the client. Bounding boxes are
* scaled to the resolution of the first input
* image transform buffer.
Thtat the lists of tracked objects are to be filled by the tracker, but the Batch is to be allocated by the client (which I assume is me). However, when I access the variable everything is already allocated for me or unless I’m misinterpreting the docstring?