Cpp-sdk-sample is crashing


I think that Data_Folder is correct.
Why classifier path is null?

//Initialize detectors
frameDetector->setClassifierPath(DATA_FOLDER); // <— crash here!!!

Hit ESCAPE key to exit app…
Initializing Affdex FrameDetector
Encountered an AffdexException Classifier path must be non-null*** Error in `./opencv-webcam-demo’: free(): invalid pointer: 0x000000000155aa48 ***


That error message is a little misleading, the actual check being done is string::empty(), so it’s not null, it’s empty. But that still doesn’t add up, because there is a

if (!boost::filesystem::exists(DATA_FOLDER))

check at line 89 of opencv-webcam-demo.cpp, which should have triggered if it was an empty string.

What is the value of DATA_FOLDER in your case? Are you passing a value on the command line or using the default (“data”).


Line 89 was not triggered because it’s not empty string.

DATA_FOLDER was “data” which is default.

I even put the value in the command line.

Dependency lib version is important?(Ubuntu 16.04)

boost 1.58
OpenCV 2.4.9
glibc 2.23


OK, if you’re using “data” (either by not specifying a value on the command line or passing that on the command line), that means your working directory (when you run opencv-webcam-demo) should be wherever the Affdex SDK was installed, or if not, some directory that has a copy of the SDK’s data folder below it. Is that the case?


yes. I copied the data folder in working directory from SDK folder.
It make error msgs just like data folder is empty.


I’m starting to lean in the direction of a mismatched compiler version issue that is causing our SDK to consider the data path string to be empty. Another clue is the invalid pointer error in the free() call (which is probably caused by the execution of the AffdexException destructor – that would be allocated in the SDK but freed in the sample code). According to the README at https://github.com/Affectiva/cpp-sdk-samples, it should be built with gcc 4.8. Are you using 4.8?


Closing this issue due to lack of activity. @hyunjung_nam if you are still running into this issue please create another issue post.