Hi everyone,
I'm using the mv library on the Snapdragon 845. I wrote a small application that calls the mvVISLAM_Initialize(...) function, followed by a call to mvVISLAM_AddAccel() mvVISLAM_AddGyro() and mvVISLAM_AddImage().
About 50% of the calls to mvVISLAM_AddImage() result in a segmentation fault.
I've noticed a pattern though. The calls to mvVISLAM_Initialize(...) yield some debug output on the console like
MachineVision is licensed as community user
LNX_8074 supported? 1LNX_8096 supported? 1LNX_IA64 supported? 1WINDOWS supported? 1AR ERROR: arFileOpen(): Failed to open file: /usr/bin/vislam/Configuration.SF.xmlFASTCV: fcvAvailableHardware Linuxmempool cur block size 307200, new block size -496943104
/usr/bin # ./vio[VIOManager] Starting...[tracker] _vio pointer should be NULL: 0[tracker] Calling initialize functionMachineVision is licensed as community userLNX_8074 supported? 1LNX_8096 supported? 1LNX_IA64 supported? 1WINDOWS supported? 1AR ERROR: arFileOpen(): Failed to open file: /usr/bin/vislam/Configuration.SF.xmlFASTCV: fcvAvailableHardware Linuxmempool cur block size 307200, new block size -496943104[tracker] Now _vio pointer is: 0xb0ce20f8[VIOManager] VISLAM tracker is not null, so you must've done something right![VIOManager] Setting callbacks for IMU and Camera...[IMUDriver] Setting accel callback[IMUDriver] Setting gyro callback[CameraDriver] Setting image callback[VIOManager] All callbacks set![VIOManager] Starting IMU...[IMUDriver] Sending fake accel data to VIO[tracker] Calling mvVISLAM_AddAccel[IMUDriver] Sending fake gyro data to VIO[tracker] Calling mvVISLAM_AddGyro[VIOManager] IMU started[VIOManager] Starting camera...[CameraDriver] Sending fake image to VIO[tracker] Calling mvVISLAM_AddImage[VIOManager] Camera started
/usr/bin # ./vio[VIOManager] Starting...[tracker] _vio pointer should be NULL: 0[tracker] Calling initialize functionMachineVision is licensed as community userLNX_8074 supported? 1LNX_8096 supported? 1LNX_IA64 supported? 1WINDOWS supported? 1AR ERROR: arFileOpen(): Failed to open file: /usr/bin/vislam/Configuration.SF.xmlFASTCV: fcvAvailableHardware Linuxmempool cur block size 307200, new block size 1885421568[tracker] Now _vio pointer is: 0xaf413108[VIOManager] VISLAM tracker is not null, so you must've done something right![VIOManager] Setting callbacks for IMU and Camera...[IMUDriver] Setting accel callback[IMUDriver] Setting gyro callback[CameraDriver] Setting image callback[VIOManager] All callbacks set![VIOManager] Starting IMU...[IMUDriver] Sending fake accel data to VIO[tracker] Calling mvVISLAM_AddAccel[IMUDriver] Sending fake gyro data to VIO[tracker] Calling mvVISLAM_AddGyro[VIOManager] IMU started[VIOManager] Starting camera...[CameraDriver] Sending fake image to VIO[tracker] Calling mvVISLAM_AddImageSegmentation fault (core dumped)
The negative sign is probably just a symptom. If one looks in the mvMemoryPool.h code that your application must be using, the requested memory size comes as a size_t and the printf just uses a %d character instead of %zu to printf it. So, the requested memory is large enough to hit the negative space. It seems then that your application is feeding it a bad memory size request. So, maybe your actual image size is different than the code has everywhere or maybe pool.releaseBlock() is not getting called in the right spot?