After running for several days one of our OAK cameras threw this error:
Stack trace (most recent call last) in thread 8936:
#6 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#5 Object "/lib/aarch64-linux-gnu/libc.so.6", at 0x7f92638c1b, in
#4 Object "/lib/aarch64-linux-gnu/libpthread.so.0", at 0x7f92817647, in
#3 Object "/usr/local/lib/python3.9/dist-packages/depthai.cpython-39-aarch64-linux-gnu.so", at 0x7f887e104b, in
#2 Object "/usr/local/lib/python3.9/dist-packages/depthai.cpython-39-aarch64-linux-gnu.so", at 0x7f886c587b, in
#1 Object "/usr/local/lib/python3.9/dist-packages/depthai.cpython-39-aarch64-linux-gnu.so", at 0x7f887282c7, in dai::StreamMessageParser::parseMessageToADatatype(streamPacketDesc_t*)
#0 Object "/lib/aarch64-linux-gnu/libc.so.6", at 0x7f925eb64c, in
Segmentation fault (Invalid permissions for mapped object [0x7f7489e000])
Segmentation fault
hviz@hvizpi18:~/HVision $ sudo screendump 1 > term001.log
I don't see any exceptions logged prior to this event and I'm not sure if it would've occurred in my run() loop or where the StreamMessageParser works at? This program is expected to run 24/7 and we've had it run for up to a week before with no issue. We've had cameras throw an exception and we've seen them reload as designed. This wouldn't be such an issue except that it killed the entire script and its currently unreproducible.
The run() loop the camera uses:
while not self.stopped:
singletimecall = time.perf_counter()
if((singletimecall - checkforvaluechange) > 14):
if self.rm.getmyneedtoreload(self.camindex):
checkforvaluechange = singletimecall
self.reloadcam()
###################################################
self.trackletsData = None
try:
while self.needtoreinitialize:
self.reloadcam()
###################################################
imgFrame = self.preview.get()
inDet = self.qDet.get()
if imgFrame is not None:
frame = imgFrame.getCvFrame()
if(len(frametimestamps) > 1):
dasfps = round((len(frametimestamps)/(frametimestamps[-1]-frametimestamps[0])),1)
if (self.icountitems == 2) and (track is not None):
self.trackletsData = track.tracklets
if inDet is not None:
detections = inDet.detections
self.crop_queue.append((detections, frame, self.trackletsData, dasfps))
frametimestamps.append(time.perf_counter())
###################################################
self.recoveryattempts = 0
self.myhealth[self.camindex-1] = True
self.myhealth[self.camindex-1] = self.healthychild[0]
except Exception as exception:
self.myhealth[self.camindex-1] = False
exc_type, exc_obj, exc_tb = sys.exc_info()
self.oaklogging.error("<b>"+self.camlogident+"An error has occurred around the Oak Device while active: "+str(exc_type)+" "+str(exc_tb.tb_lineno)+"</b>")
self.oaklogging.error("<b>"+self.camlogident+"Exception: {}".format(type(exception).__name__)+"</b>")
self.oaklogging.error("<b>"+self.camlogident+"Exception message: {}".format(exception)+"</b>")
self.device.close()
self.recoveryattempts += 1
self.needtoreinitialize = True
Is there someplace else I need to try to catch this exception?
Thanks!