Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

malloc error with --hash_mask_bits #4

Open
GoogleCodeExporter opened this issue Feb 6, 2016 · 1 comment
Open

malloc error with --hash_mask_bits #4

GoogleCodeExporter opened this issue Feb 6, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Download & build, run the demo commands adding --hash_mask_bits to the 
arguments.  Training proceeds fine, but testing of the model gives the malloc 
error:

$ ./sofia-ml --learner_type pegasos --loop_type stochastic --lambda 0.1 
--iterations 100000 --dimensionality 150000 --training_file demo/demo.train 
--model_out demo/model --hash_mask_bits 8
hash_mask_ 255
Reading training data from: demo/demo.train
Time to read training data: 0.061278
Time to complete training: 52.3639
Writing model to: demo/model
   Done.


$ ./sofia-ml --model_in demo/model --test_file demo/demo.train --results_file 
demo/results.txt --hash_mask_bits 8
hash_mask_ 255
sofia-ml(6235) malloc: *** error for object 0x800000: pointer being freed was 
not allocated
*** set a breakpoint in malloc_error_break to debug
Reading model from: demo/model
   Done.
Reading test data from: demo/demo.train
Time to read test data: 0.06114
Time to make test prediction results: 0.008274
Writing test results to: demo/results.txt
   Done.


========

$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)





Original issue reported on code.google.com by [email protected] on 18 Jun 2010 at 6:43

@GoogleCodeExporter
Copy link
Author

I hit this as well.  I guess the hash_mask_bits code in general isn't so highly 
treaded, I found two bugs in the code, which I fixed.

There is a double delete crash in the SfHashWeightVector destructor (which 
double deletes _weights, which are logically owned/managed by the parent 
class).  Further, the model loading code throws away type information when 
loading the model.

Patch attached.

rrenaud@kingscourt:~/sofia-ml-read-only/sofia-ml$ patch -p0 < 
load_hash_model.patch 
patching file src/sofia-ml.cc
patching file src/sf-hash-weight-vector.cc

Original comment by [email protected] on 2 Aug 2011 at 7:39

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant