Cpp-sdk-sample is crashing


#1

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

//Initialize detectors
frameDetector->setDetectAllEmotions(true);
frameDetector->setDetectAllExpressions(true);
frameDetector->setDetectAllEmojis(true);
frameDetector->setDetectAllAppearances(true);
frameDetector->setClassifierPath(DATA_FOLDER); // <— crash here!!!
frameDetector->setImageListener(listenPtr.get());
frameDetector->setFaceListener(faceListenPtr.get());
frameDetector->setProcessStatusListener(videoListenPtr.get());


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 ***


#2

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”).


#3

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


#4

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?


#5

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


#6

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?


#7

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


#8