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

badger and 32bit CPU #514

Closed
zllak opened this issue Jun 12, 2018 · 4 comments
Closed

badger and 32bit CPU #514

zllak opened this issue Jun 12, 2018 · 4 comments

Comments

@zllak
Copy link

zllak commented Jun 12, 2018

Problem:

  • The default configuration for ValueLogFileSize is 1<<30.
  • Call to mmap is made doing 2 * ValueLogFileSize.
  • On a 32bit CPU, 2147483648 overflows an integer, because unix.Mmap takes an integer as parameter, making the call fail.

badger.Open returns:

Unable to mmap RDWR log file: invalid argument

There should be a difference for 32bits arch, because badger with a default configuration just can't work on 32bit.

@zllak zllak changed the title badger and 32bit arch badger and 32bit CPU Jun 12, 2018
@manishrjain
Copy link
Contributor

Happy to accept a PR to that extent.

@zllak
Copy link
Author

zllak commented Jun 14, 2018

A possible fix would be to substract 1 to the 2 * ValueLogFileSize to be sure it won't overflow, but not sure this is what should be done.
What do you think ? A fix like that would be acceptable to you ?

@manishrjain
Copy link
Contributor

That sounds like a one-line change. Sure, send it my way, I'll consider it.

@manishrjain
Copy link
Contributor

Submitted this 341a135, which should fix the issue.

Can you test?

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

No branches or pull requests

2 participants