kzwkt / wnd-charm

Automatically exported from code.google.com/p/wnd-charm
0 stars 0 forks source link

crash when performing wndchrm test with default options #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

1. Perform a `wndchrm test anyfile.fit optional_html.html` and wndchrm will seg 
fault. Doesn't help if you specify experiment parameters like "-f0.1 -r0.9 -n5" 

2. When I recompiled wndchrm without using compiler optimization (removed all 
instances of -O2 from Makefile) and with additional gdb debug information ( 
replaced -g with -ggdb everywhere in makefile ), we see that the failure comes 
when wndchrm tries to interpret the fit file as a directory rather than a fit 
file. Here is the output from the debug run:

chris@s062055 ~/projects/contrived_progression_data
$ wndchrm test training_set.fit test_set.fit test.html
Processing training set 'training_set.fit'.
----------
Summary of 'training_set.fit' (500 samples total, 1 samples per image):
'Class label' number of samples.
'000'   50
'001'   50
'002'   50
'003'   50
'004'   50
'005'   50
'006'   50
'007'   50
'008'   50
'009'   50
----------
: Not a directoryErrors reading from 'training_set.fit'

Original issue reported on code.google.com by christop...@nih.gov on 15 Feb 2011 at 5:08

GoogleCodeExporter commented 9 years ago
The error is unrelated to directories.  The reported error is an errno that 
wasn't cleaned up after trying to open a file as a directory (which is trapped 
otherwise).
The real problem is in SetFisherScores, and the fault occurs between exiting 
SetFisherScores and re-entering wndchrm.cpp.  The final statement of 
SetFisherScores is executed.  The statement in wndchrm.cpp following the 
SetFisherScores is not.

Original comment by i...@cathilya.org on 15 Feb 2011 at 7:53

GoogleCodeExporter commented 9 years ago
Boy, that's fun.
The error was a buffer overrun using sprintf.
In the code below (TrainingSet::SetFisherScores):
            sprintf( feature_string, "%ld. %s: %f [%d]\n",
                        signature_count - sig_index,
                        FeatureGroupNames[ sig_index2 ],
                        FeatureGroupValues[ sig_index2 ],
                        FeatureGroupCount[ sig_index2 ] );

Substitute a %g for the %f.

Original comment by i...@cathilya.org on 15 Feb 2011 at 8:46

GoogleCodeExporter commented 9 years ago

Original comment by christop...@nih.gov on 17 Feb 2011 at 11:28