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

Corrected necessary call to lbfgs_malloc before lbfgs is called. #34

Merged
merged 1 commit into from
Jan 24, 2016
Merged

Corrected necessary call to lbfgs_malloc before lbfgs is called. #34

merged 1 commit into from
Jan 24, 2016

Conversation

timdawborn
Copy link
Contributor

Corrects the x pointer (2nd argument to liblbfgs lbfgs) to be allocated by liblbfgs instead of by the callee. The documentation for liblbfgs explicitly states that this pointer must be allocated by liblbfgs via lbfgs_malloc. This is due to its use of SSE optimised routes which may require longer arrays to be allocated than what is needed.

This bug has caused us many bus errors due to liblbfgs being compiled with SSE optimisations, and the calloc'd w pointer being read by a SSE instruction/intrinsic when it's not aligned to a 16-byte boundary.

allocated by liblbfgs instead of by the callee. The documentation for
liblbfgs explicitly states that this pointer must be allocated by
liblbfgs via `lbfgs_malloc`. This is due to its use of SSE optimised
routes which may require longer arrays to be allocated than what is
needed.

This bug has caused us many bus errors due to liblbfgs being compiled
with SSE optimisations.
@timdawborn timdawborn changed the title Corrects necessary call to lbfgs_malloc before calling lbfgs. Corrected necessary call to lbfgs_malloc before lbfgs is called. Feb 18, 2015
chokkan pushed a commit that referenced this pull request Jan 24, 2016
Corrected necessary call to lbfgs_malloc before lbfgs is called.
(@timdawborn is absolutely right!)
@chokkan chokkan merged commit 07a66ee into chokkan:master Jan 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants