Fixed integer overflow issue with LMDB on 32bit systems.#4021
Closed
nickfraser wants to merge 4 commits intoBVLC:masterfrom
Closed
Fixed integer overflow issue with LMDB on 32bit systems.#4021nickfraser wants to merge 4 commits intoBVLC:masterfrom
nickfraser wants to merge 4 commits intoBVLC:masterfrom
Conversation
|
Please see #3731, which is a more general solution to this problem. |
Author
|
Apologies, I didn't see that pull request. I agree it's a better solution. However, the simplicity of this solution is less likely to create insidious bugs - if it were used temporarily until #3731 is merged. |
Contributor
|
Closing as #3731 has been merged... comment if there's an outstanding issue that I've missed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I tried compiling Caffe on the Xilinx ZC706 evaluation board and noticed it wouldn't pass all of the tests. I then noticed that I have the same error when compiling Caffe on a 32bit Ubuntu 14.04 system (x86). It occurs with and without debugging enabled. It's likely this bug occurs in any system which uses an address size less than 41bits. I traced back the 1TB LMDB map size allocation in a few files. This 1TB allocation assumes that the underlying size_t parameter needed by LMDB is at least 41bits - this is not true on 32bit systems.
In order to address (if you'll excuse the pun) this, I did the following:
The code should be self-explanatory, but let me know if you want any more information.
Also, if you have any suggestions on how I can improve my code - please let me know. Even if it's just a style preference - I'd like to hear about it.
Cheers,
Nick