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

runtime: madvise() failure during scavenging causing crash on darwin arm64 #16850

bytex64 opened this issue Aug 23, 2016 · 2 comments


None yet
4 participants
Copy link

commented Aug 23, 2016

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

go version go1.7 darwin/amd64

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

iOS 9.3.4 arm64 (though I believe this applies to armv7 as well)

  1. What did you do?

Create a gomobile library with gomobile bind -target ios and link the framework into an iOS app. Run the app, then switch away for five minutes or more. Switch back to the app.

  1. What did you expect to see?

Normal operation.

  1. What did you see instead?

Upon returning to the app, one thread will have crashed via notok as a result of a failed madvise syscall during scavenging. GODEBUG=scavenge=1 accelerates things significantly, and it will crash almost immediately.

It seems this was fixed for 386 and amd64 a while ago, but the same treatment never got applied to arm/arm64. I tested a similar fix and it solved my problem, but I'm not that confident in my ability to edit ARM assembly correctly.

Frustratingly, I couldn't replicate the problem with any of the gomobile example apps. I suspect that they are too simple to sufficiently provoke the GC.


This comment has been minimized.

Copy link

commented Aug 23, 2016


This comment has been minimized.

Copy link

commented Aug 23, 2016

@minux minux closed this Aug 23, 2016

@golang golang locked and limited conversation to collaborators Aug 23, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.