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

x/mobile: Memory crash in iOS devices #28274

C-ollins opened this issue Oct 18, 2018 · 2 comments

x/mobile: Memory crash in iOS devices #28274

C-ollins opened this issue Oct 18, 2018 · 2 comments
mobile NeedsInvestigation


Copy link

@C-ollins C-ollins commented Oct 18, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.10.3 darwin/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?


What did you do?

key, err := scrypt.Key(password, salt, 262144, 8, 1, keyLen)
if err != nil {


What did you expect to see?

A successful run

What did you see instead?

A crash
Same code runs fine on android but happens to crash on iOS.

@gopherbot gopherbot added this to the Unreleased milestone Oct 18, 2018
@gopherbot gopherbot added the mobile label Oct 18, 2018
Copy link

@timcooijmans timcooijmans commented Oct 19, 2018

The specified scrypt parameters require at least +/- 256 MiB of memory (See the excellent article of @FiloSottile) , probably more due to overhead in the implementation and garbage-collection.

The iOS device you are using doesn't have this available and runs out of memory.

runtime: out of memory: cannot allocate 268435456-byte block (271581184 in use)
fatal error: out of memory

Copy link

@C-ollins C-ollins commented Oct 19, 2018

Why is this failing for iOS? I've tried it in an Android device with 1gb memory and it ran without errors. I tested with an iPhone 7 with 2gb ram and it fails every time.

@ALTree ALTree added the NeedsInvestigation label Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
mobile NeedsInvestigation
None yet

No branches or pull requests

4 participants