runtime: sigaction is calling getg before TLS is set up on Android #31476
Labels
Milestone
Comments
I assume that the problem is the call to var g *g
if mainStarted {
g = getg()
} |
Change https://golang.org/cl/172158 mentions this issue: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following crash has started to appear when running Android apps with Go tip:
I believe the crash is caused by an invalid g returned from
getg
, called fromsigaction
. At the timelibpreinit
is called, TLS hasn't been set up yet (it is set up later inrt0_go
).This started to appear after my fixes for #29674 but I believe it's been a latent bug for a long time. We've just been lucky that the static TLS slot previously used for accessing g on android/amd64 and android/386 always contained 0.
The cause is clear but the fix isn't obvious to me. Please advice, @cherrymui @ianlancetaylor .
The text was updated successfully, but these errors were encountered: