CUFCTL / face-recognition

A GPU-accelerated real-time face recognition system based on classical machine learning algorithms
MIT License
23 stars 11 forks source link

Windows and Mac builds segfault during db_recognize #31

Closed bentsherman closed 7 years ago

bentsherman commented 7 years ago

This issue has been confirmed on both Windows (MSYS2) and Mac. In some cases, face-rec segfaults during db_recognize. On Windows, I have traced the cause to kNN, which returns an image_label_t * which cannot be dereferenced. The segfault occurs when db_recognize tries to read rec_labels[j]->name around line 351. I am currently investigating the mode function which returns this inaccessible pointer to kNN.

bentsherman commented 7 years ago

The root cause was in fact the mode function, which was not exiting a for loop under the right conditions. I suspect that this fix will solve the issue on Mac as well. I'm not really sure why this issue never occurred in Linux.