Segmentation Fault whenever capture starts


#1

I’m getting segfaults whenever I subscribe to any sensor topic (images, magnetometer, ultrasound, …). A couple days ago, I could still get camera data via ROS.

I’ve already updated/recovered with the newest image - the error still occurs.

Did anyone ever run into issues like this?

Here’s some example output

[ INFO] [1484311993.739367777]: clock_sync_period: 10.000000
[ INFO] [1484311993.746372193]: NODE Reconfigure Request:
crop: 640x480
[ INFO] [1484311993.746474527]: STREAMING Reconfigure Request:
[ INFO] [1484311993.746541860]: crop: 0x0, rescale 0x0, bitrate 200000
[ INFO] [1484311993.746607777]: Type: RTP, host: 192.168.45.255, ports: (5000, 5100)
[ INFO] [1484311993.746664027]: VIDEO_MODE Reconfigure Request
[ INFO] [1484311993.746726693]: VIDEO_SOURCE Reconfigure Request
[ INFO] [1484311993.796132193]: Initializing nodelet with 4 worker threads.
std::unique_ptr<kalamos::Context> kalamos::init(const kalamos::Callbacks&, const kalamos::Options&)
[ INFO] [1484311994.873106526]: Set video mode: 1280x960 30fps
[ INFO] [1484311994.873508360]: Set video source: live
[ INFO] [1484312003.308116024]: start capture
init capture
OpenCV Error: Null pointer (NULL or empty buffer) in cvOpenFileStorage, file /hdd/buildbot/slave_jetson_tk1_1/32-O4T-L4T/opencv/modules/core/src/persistence.cpp, line 2696
Error while reading config (imu bias): Null pointer
Sensor detection done.
Open sensor 0
kalamos
Machine: kalamos

Jetson-TK1: No
ISP Config file did not load from cache, quering deviceHandleConfigFileIntegrity: ######## CRC field not found in config file ########. Config "common.cfg"
HandleConfigFileIntegrity: ######## CRC field not found in config file ########. Config "isp2.cfg"
HandleConfigFileIntegrity: ######## CRC field not found in config file ########. Config "sensor.cfg"
-- NvIspAFinit -- min 0, max 0
NvIspSetStats: WARNING: FM can't be enabled because AP is not enabled!!
Requesting: 1280x960, Selected: 1280x960
Lane Config: 4
Created TVMR Mixer of size 1280x960
Open sensor 1
kalamos
Machine: kalamos

Jetson-TK1: No
ISP Config file did not load from cache, quering deviceHandleConfigFileIntegrity: ######## CRC field not found in config file ########. Config "common.cfg"
HandleConfigFileIntegrity: ######## CRC field not found in config file ########. Config "isp2.cfg"
HandleConfigFileIntegrity: ######## CRC field not found in config file ########. Config "sensor.cfg"
-- NvIspAFinit -- min 0, max 0
NvIspSetStats: WARNING: FM can't be enabled because AP is not enabled!!
Requesting: 1280x960, Selected: 1280x960
Created TVMR Mixer of size 1280x960
Lane Config: 4
NvCamScaler_OutputThread-- (error 0x0)
NvCamScaler_OutputThread-- (error 0x0)



 ###########################
  Camera Timeout: Sync Point ID: 11
  Camera Timeout: Threshold: 1
  Camera Timeout: Timeout time: 300 ms
  Camera Timeout: Num of Timeouts: 1
 ###########################


NvViCsiStatusType_HWErrorPixelParser: 0x0
NvViCsiStatusType_HWErro: 0x0
sensor: 0x0000 
Camera Timeout: Trying to recover
NvCameraBackEnd_Abort not implemented
Camera Timeout: After recovering, syncpt 11 is 0



 ###########################
  Camera Timeout: Sync Point ID: 9
  Camera Timeout: Threshold: 1
  Camera Timeout: Timeout time: 300 ms
  Camera Timeout: Num of Timeouts: 1
 ###########################


NvViCsiStatusType_HWErrorPixelParser: 0x0
NvViCsiStatusType_HWErro: 0x0
sensor: 0x0000 
Camera Timeout: Trying to recover
NvCameraBackEnd_Abort not implemented
Camera Timeout: After recovering, syncpt 9 is 0



 ###########################
  Camera Timeout: Sync Point ID: 9
  Camera Timeout: Threshold: 2
  Camera Timeout: Timeout time: 300 ms
  Camera Timeout: Num of Timeouts: 2
 ###########################


NvViCsiStatusType_HWErrorPixelParser: 0x0
NvViCsiStatusType_HWErro: 0x0
sensor: 0x0000 
Camera Timeout: Trying to recover
NvCameraBackEnd_Abort not implemented
Camera Timeout: After recovering, syncpt 9 is 0



 ###########################
  Camera Timeout: Sync Point ID: 11
  Camera Timeout: Threshold: 2
  Camera Timeout: Timeout time: 300 ms
  Camera Timeout: Num of Timeouts: 2
 ###########################


NvViCsiStatusType_HWErrorPixelParser: 0x0
NvViCsiStatusType_HWErro: 0x0
sensor: 0x0000 
Camera Timeout: Trying to recover
NvCameraBackEnd_Abort not implemented
Camera Timeout: After recovering, syncpt 11 is 0
fixing camMat #0
fixing camMat #1
waiting initialization of sensor : 0x357ec0
Segmentation fault

And diagnostics

01-linux-version     ok [system]         Linux version 
02-memory            ok [system]         Memory close to 2GB 
03-linux-thermal     ok [system]         Linux thermal zones availability 
04-cpu-governor      ok [system]         CPU governor 
05-linux-sanity      ko [system]         Linux sanity 
20-magnetometer      ok [sensors/i2c]    Dev ID of AK8963C magn on /dev/i2c-0 (Result: 0x0f) 
21-barometer         ok [sensors/i2c]    Ping MS5607 barometer on /dev/i2c-0 
22-codec             ok [sensors/i2c]    Ping ADAU1772 codec on /dev/i2c-0 
25-ultrasound        ok [ultrasound]     Ultrasound Result: OK Distances: "4.670 4.670 4.670 " 
30-camera            ok [camera]         Cameras acquisition 
31-camera-freq       ok [camera]         Frequency Result: 33.300 ms (33.33 ms) diff=0.09% 
32-camera-conn       ok [camera]         Camera connection: Left is OK and Right OK 
40-imu               ok [imu]            IMU Result: 15945 lines (16000) diff=0.34 %

#2

After running a debugging session, it looks like there’s an infinite recursion in

LibSensorsSensor::listenInterface() () from /usr/lib/libkalamos-sensors.so

Any help from Parrot devs? This thing happens in a thread that seems to be fully owned by the kalamos library whose source code is not available.


#3

Here’s a minimum example that creates the crash on my system

#include "kalamos_context.hpp"

bool init = false;
std::unique_ptr<kalamos::Context> kalamosContext;

void tick() {
  if(!init) {
    kalamosContext->startService(kalamos::ServiceType::CAPTURE);
    init = true;
  }
}

int main(int ac, char** av) {

  kalamos::Callbacks cbs;
  cbs.period = 30;
  cbs.periodicCallback = &tick;

  kalamosContext = kalamos::init(cbs);
  if (kalamosContext) {
    kalamosContext->run();
  }

  return 0;
}