Segmentation fault in sample App


#1

Hello,

I am trying to run sample app (opencv-webcam-demo) and it crashes at the beginning of program while creating face listener. I have followed steps mentioned @ https://github.com/Affectiva/cpp-sdk-samples

shared_ptr faceListenPtr(new AFaceListener());.

However, if I just do “new AFaceListener()” without shared_ptr initiation then no crash is observed.

Need help to debug this crash.

Regards,

Pritam


#2

Can you share the stack trace?


#3

Thank you Umang.

I only see following message “Segmentation fault (core dumped)” when a new is called on PlottingImageListener. Below is the line that cause crash. I tried to change PlottingImageListener constructor to do nothing but looks like crash is in base call as my constructor is never invoked.

shared_ptr listenPtr(new PlottingImageListener(csvFileStream, draw_display)); // Instanciate the ImageListener class

Let me know if any additional info is needed.

Regards,

Pritam


#4

I debugged this further and found issues in visualizer.cpp. After this, program is crashing when following line is executed “frameDetector->start();

I would like to know if there is any dependency with particular version of opencv.

Any pointers on this would be helpful


#5

Yes, please see the README at https://github.com/Affectiva/cpp-sdk-samples. Are you currently following those directions? Note the details about opencv and LD_PRELOAD.


#6

Yes, I followed exact same procedure as mentioned here.

I did export preload command before starting app as mentioned in the github. Here is entire output from execution:
///////////////////////////////////////////////////////////////////////////////////////////////////////
Initializing Affdex FrameDetector
DAT_FOLDER–> /home/pritam/affdex-sdk/data
HIGHGUI WARNING: V4L/V4L2: VIDIOC_S_CROP
HIGHGUI WARNING: V4L: setting property #5 is not supported
HIGHGUI WARNING: V4L/V4L2: VIDIOC_S_CROP
Setting the webcam frame rate to: 30
Max num of faces set to: 1
Face detector mode set to: LARGE_FACES
2018-05-31 18:44:00.913892: W /opt/jenkins/workspace/tensorflow-ubuntu/src/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-05-31 18:44:00.913918: W /opt/jenkins/workspace/tensorflow-ubuntu/src/tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’t compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Segmentation fault (core dumped)


#7

Hi,

One difference I noticed is that my ubuntu has OpenCV 3.x installed whereas documentation mentions 2.4.

Please confirm if this can cause issue assuming LD_PRELOAD is in place.

Thanks,

Pritam


#8

Our SDK is not compatible with OpenCV v3.x. You will need to downgrade to OpenCV v2.4.x and have LD_PRELOAD point to the libopencv_core.so.


#9

Thank you Umang for info. I was able to run it using OpenCV V2.4.x.


#10