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

Open
beansgum opened this issue Oct 18, 2018 · 2 comments
Open

x/mobile: Memory crash in iOS devices #28274

beansgum opened this issue Oct 18, 2018 · 2 comments
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@beansgum
Copy link

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?

Yes

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

GOARCH="amd64"
GOOS="darwin"

What did you do?

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

debug.FreeOSMemory()

What did you expect to see?

A successful run

What did you see instead?

A crash https://bpaste.net/show/308796b08e4c
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 Android, iOS, and x/mobile label Oct 18, 2018
@timcooijmans
Copy link
Contributor

timcooijmans commented Oct 19, 2018

The specified scrypt parameters require at least +/- 256 MiB of memory (See the excellent article of https://blog.filippo.io/the-scrypt-parameters/ @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

@beansgum
Copy link
Author

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 Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants