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: async preemption breaks darwin/arm #35439

Closed
cherrymui opened this issue Nov 7, 2019 · 14 comments
Closed

runtime: async preemption breaks darwin/arm #35439

cherrymui opened this issue Nov 7, 2019 · 14 comments
Assignees
Milestone

Comments

@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Nov 7, 2019

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

tip (a930fed)

Does this issue reproduce with the latest release?

No

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

darwin/arm and darwin/arm64

What did you do?

After async preemption is enabled, the darwin/arm64 builder starts to fail, e.g.
https://build.golang.org/log/03f727b8f91b0c75bf54ff508d7d2f00b5cad4bf

I haven't been able to get access to the builders due to the limited resource. I'll look into the failure once I get the access.

@cherrymui cherrymui self-assigned this Nov 7, 2019
gopherbot pushed a commit that referenced this issue Nov 7, 2019
Enabling async preemption on darwin/arm and darwin/arm64 causes
the builder to fail, e.g.
https://build.golang.org/log/03f727b8f91b0c75bf54ff508d7d2f00b5cad4bf

Due to the limited resource, I haven't been able to get access on
those devices to debug. Disable async preemption for now.

Updates #35439.

Change-Id: I5a31ad6962c2bae8e6e9b8303c494610a8a4e50a
Reviewed-on: https://go-review.googlesource.com/c/go/+/205842
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 7, 2019

Change https://golang.org/cl/205842 mentions this issue: runtime: disable async preemption on darwin/arm(64) for now

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Nov 8, 2019

@eliasnaur
Copy link
Contributor

@eliasnaur eliasnaur commented Nov 8, 2019

Unfortunately, the Corellium builders have networks problem at the moment. If you have any debugging CLs you'd like me to test, please let me know. I can run the ios tests locally.

@eliasnaur
Copy link
Contributor

@eliasnaur eliasnaur commented Nov 8, 2019

The corellium builders are up again, so when they're through the backlog you should be able to gomote in. I've started another iOS device to speed things up.

@cherrymui
Copy link
Contributor Author

@cherrymui cherrymui commented Nov 11, 2019

Thanks @eliasnaur !

I was able to access the Corellium gomote and dig into what's going on. I'll send CLs shortly. It should work on darwin/arm64 now.

The problem for ARM64 doesn't seem to appear on ARM32. I couldn't access the ARM32 builder. So I still don't know if it works on ARM32.

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 11, 2019

Change https://golang.org/cl/206418 mentions this issue: cmd/internal/obj/arm64: save LR after decrementing SP on darwin

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 11, 2019

Change https://golang.org/cl/206419 mentions this issue: runtime: enable async preemption on darwin/arm64

@eliasnaur
Copy link
Contributor

@eliasnaur eliasnaur commented Nov 11, 2019

Very nice, thank you! Let's just submit this and see what happens. Corellium does not support arm32, so gomoting is diffcult.

gopherbot pushed a commit that referenced this issue Nov 12, 2019
iOS does not support SA_ONSTACK. The signal handler runs on the
G stack. Any writes below the SP may be clobbered by the signal
handler (even without call injection). So we save LR after
decrementing SP on iOS.

Updates #35439.

Change-Id: Ia6d7a0669e0bcf417b44c031d2e26675c1184165
Reviewed-on: https://go-review.googlesource.com/c/go/+/206418
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
gopherbot pushed a commit that referenced this issue Nov 12, 2019
The problem should be fixed by the previous CL. Reenable async
preemption on darwin/arm64.

Updates #35439.

Change-Id: I93e8c4702b4d8fe6abaa6fc9c27def5c8aed1b59
Reviewed-on: https://go-review.googlesource.com/c/go/+/206419
Reviewed-by: Keith Randall <khr@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 12, 2019

Change https://golang.org/cl/206957 mentions this issue: runtime: enable async preemption on darwin/arm

@cherrymui cherrymui changed the title runtime: async preemption breaks darwin/arm and darwin/arm64 runtime: async preemption breaks darwin/arm Nov 18, 2019
@reusee
Copy link

@reusee reusee commented Dec 31, 2019

Async preemption also causes linux/arm32 to segfault on current tip.
uname -a: Linux OpenWrt 4.19.88 #0 SMP Fri Dec 13 11:20:09 2019 armv7l GNU/Linux
cpu info:
processor : 0
model name : ARMv7 Processor rev 1 (v7l)
BogoMIPS : 1866.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x4
CPU part : 0xc09
CPU revision : 1

Segfaults disappear after async preemption is disabled (GODEBUG=asyncpreemptoff=1).

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 31, 2019

@reusee Can you provide more details? The linux-arm builder seems to be working. Thanks.

@reusee
Copy link

@reusee reusee commented Jan 1, 2020

@ianlancetaylor It's a proxy program for internal use. I'm trying to find a reproduce program.

Sometimes it crash with 'fatal: bad g in signal handler', most times just 'Segmentation fault'.

@reusee
Copy link

@reusee reusee commented Jan 1, 2020

I found a workaround for the segfault that is settings GOMAXPROCS to 1.

Still can't find a short reproduce. It's several thousand lines of tightly coupled codes.

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 3, 2020

Change https://golang.org/cl/227198 mentions this issue: all: remove scattered remnants of darwin/arm

@gopherbot gopherbot closed this in f7e6ab4 Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants