Open GoogleCodeExporter opened 8 years ago
problem related to Fann library
Original comment by bluekid70@gmail.com
on 21 Aug 2009 at 8:30
I believe FANNTool may be able to trap this error and alert the user rather
than crashing. The issue arises because create_from_file is called, but fails
due to the selected file being invalid. Unfortunately the FANN library doesn't
return a specific error in this case due to how it does it's error handling,
but it does return NULL. I believe if you check the return to verify that it is
not NULL before using it then you could handle the error rather than crashing.
I looked at implementing this change, but I oddly kept getting a runtime error
that looked like a memory access violation. My 'fix' was simply to check the
return of create_from_file and just do nothing if it is NULL rather than
attempting to use the returned ANN. I suspect there is something trying to
access the returned ANN once the callback completes, but so far I don't see
what it is. Perhaps bluekid can shed some light on why this fix isn't working.
An alternate fix that I haven't tried yet would be to just loop and ask the
user to pick a different file. That might work, but you risk a deep set of
function calls if the user keeps picking invalid files.
Original comment by stevenco...@gmail.com
on 9 Apr 2013 at 12:06
Original issue reported on code.google.com by
officecy...@gmail.com
on 18 Jun 2009 at 8:12