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

memory detection fails on OpenBSD #226

Closed
gperciva opened this issue Jan 10, 2020 · 2 comments
Closed

memory detection fails on OpenBSD #226

gperciva opened this issue Jan 10, 2020 · 2 comments

Comments

@gperciva
Copy link
Member

We currently ignore RLIMIT_DATA if we HAVE_MMAP:
2b478e7

This breaks the memory-detection on OpenBSD. I added some zzz lines, and compiled with -DDEBUG, and we see:

openbsd-64$ ulimit -d 123456
openbsd-64$ ./scrypt dec -v foo.enc foo                                        
Please enter passphrase: 
zzz             RLIMIT_DATA:    126418944
zzz                     (the above line is for debugging only
zzz             RLIMIT_RSS:     2055184384
Memory limits are:
        usermem:        18446744073709551615
        memsize:        18446744073709551615
        sysinfo:        18446744073709551615
        rlimit:         2055184384
        sysconf:        2130640896
zzz smallest:           2055184384
zzz after frac:         1027592192
zzz after specified:    1027592192
Allowing up to 1027592192 memory to be used
Clock resolution is 0.01
17408 salsa20/8 cores performed in 0.010059 seconds
Parameters used: N = 131072; r = 8; p = 4;
    This requires at least 134 MB bytes of memory (1.0 GB available),
    and will take approximately 1.2 seconds (limit: 300.0 seconds).
scrypt: ../main.c, 252
scrypt: Error computing derived key: Cannot allocate memory
openbsd-64$ 

TL;DR: scrypt thinks it has enough memory available, but it doesn't.

@gperciva
Copy link
Member Author

Original report from Ted Unangst here: http://mail.tarsnap.com/scrypt/msg00263.html

@gperciva
Copy link
Member Author

Resolved by #238.

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

1 participant