Segmentation fault in sample App



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 @

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.




Can you share the stack trace?


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.




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


Yes, please see the README at Are you currently following those directions? Note the details about opencv and LD_PRELOAD.


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: setting property #5 is not supported
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/] 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/] 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)



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.




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


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