bygreencn / fanntool

Automatically exported from code.google.com/p/fanntool
0 stars 0 forks source link

core dump in FannTool #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. load a file with completely wrong format into FannTool
2. a core dump will show up. some error checkbox with some hint would be
nice :)

What is the expected output? What do you see instead?
core dump => message box with some lovely hint

What version of the product are you using? On what operating system?
it happened on linux

Original issue reported on code.google.com by officecy...@gmail.com on 18 Jun 2009 at 8:12

GoogleCodeExporter commented 9 years ago
problem related to Fann library

Original comment by bluekid70@gmail.com on 21 Aug 2009 at 8:30

GoogleCodeExporter commented 9 years ago
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