cjlin1 / libsvm

LIBSVM -- A Library for Support Vector Machines
https://www.csie.ntu.edu.tw/~cjlin/libsvm/
BSD 3-Clause "New" or "Revised" License
4.55k stars 1.64k forks source link

Update svm.cpp #40

Closed CFAndy closed 9 years ago

CFAndy commented 9 years ago

out_j will return -1 in Solver::select_working_set. which will trigger memory fault. add Gmin_idx == -1 into the failure check

cjlin1 commented 9 years ago

I think if

if(Gmax+Gmax2 < eps)
    return 1;

does not hold, Gmin_idx is guaraneteed not to be -1. In other words, if Gmin_idx is -1, then

if(Gmax+Gmax2 < eps)
    return 1;

must hold. So I don't think we need the change.

Chen Feng writes:

out_j will return -1 in Solver::select_working_set. which will trigger memory fault. add Gmin_idx == -1 into the failure check


You can view, comment on, or merge this pull request online at:

https://github.com/cjlin1/libsvm/pull/40

Commit Summary

  • Update svm.cpp

File Changes

  • M svm.cpp (2)

Patch Links:

— Reply to this email directly or view it on GitHub.*

CFAndy commented 9 years ago

But in our CNN+SVM case, -1 will return which caused segment fault. image

cjlin1 commented 9 years ago

Please show us details so we can check what happened Chen Feng writes:

But in our CNN+SVM case, -1 will return which caused segment fault. image

— Reply to this email directly or view it on GitHub.*

cjlin1 commented 9 years ago

we now see that this problem occurs if some extreme parameters are used and then the resulting G is not a valid floating-point number. Changes on c and java code will appear in the next release

CFAndy commented 9 years ago

Okay, thanks!