-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: problem with preemption on windows arm32 #68552
Comments
Thanks for reporting. It's possible this port might have broken, as we don't have a builder to test it (issue #67308). Are you able to test whether this issue reproduces at tip if you use a newer pre-built binary windows/arm archive, such as go1.22.5 (.zip or .msi) or go1.23rc2 (.zip or .msi), as the bootstrap? CC @golang/windows. |
any cross compiled binaries 1.18 > either built by myself or downloaded from the official https://go.dev/dl/go1.23rc2.windows-arm.zip etc, don't execute properly. they simply close without outputting anything to console. |
to add some details. i'm running these binaries on windows 10 arm32, on an arm a9 and a15 amv7 cpu. everything up to 1.17 runs flawlessly and go builds working binaries for the platform from go source. the 1.18 bootstrap will sometimes run without display a fault if executed alone without any additional commands. it displays the help, usually on the second run of the binary. where the first run always crashes. any parameters passed to bootstrap.exe crashes. |
runtime: g 1: unexpected return pc for runtime.main called from 0x17a3298 runtime stack: goroutine 1 [running, locked to thread]: goroutine 2 [force gc (idle)]: goroutine 3 [GC sweep wait]: goroutine 4 [GC scavenge wait]: |
Change https://go.dev/cl/601777 mentions this issue: |
I sent CL 601777 to mark this port broken per https://go.dev/wiki/PortingPolicy#broken-ports. CC @golang/windows. |
In #57960 I proposed to use the existing windows/arm64 builder to emulate a windows/arm builder. I still think it is possible, but don't have bandwidth myself to keep it up nor support the windows/arm port. |
The port is reportedly broken, and there isn't a builder testing it. For #68552. For #67308. Change-Id: Iababa17cdf855b675aaf85642a667e8081ef5dfe Reviewed-on: https://go-review.googlesource.com/c/go/+/601777 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
Yes it should be possible but just remember that Windows 11 24H2 (build 26100, including Server 2025) plus it's SDK removes ARM32 support a lower version of the SDK is needed to build ARM32 apps and an earlier version of Windows is required to run them. I recommend version 22621 of the Windows SDK since it natively works on ARM64 and also still supports ARM32 applications |
good news, i have discovered the issue and a temporary fix until something proper can be done. by removing the addition of the following code, the bootstrap now runs.
|
this builds successfully up to 1.21, there is another error in 1.22 that breaks windows arm32. |
@wmjb At face value your patch doesn't make much sense. That's ripping out some functionality for asynchronous preemption, but just ripping that out is probably not correct. You can try to use |
a bit more investigating has revealed that if the line Line 1328 in b5ee80a
is changed from c.set_lr(newpc - 1) to c.set_lr(newpc) the bootstrap compiles and loads correctly also. |
Hmm, that It says that we should be subtracting 1 from IP, not from LR. |
looking at the arm64 code just below it seems there is no need to subtract 1 from IP/LR , i'm wondering why would that be needed on arm32? so far i've tried
both results in crash does not result in crash and everything builds correctly and executes, the resulting go binary can then build go apps that work correctly |
Change https://go.dev/cl/612555 mentions this issue: |
The Go 1.21 entries are no longer needed now that go1.23.0 is out. The list for tip is the same as for Go 1.23, except that the windows/arm port is not included because it's currently marked broken (CL 601777). I considered renaming allReleases to something more appropriate since it tracks only first class ports now, but leaving that to a future CL. For golang/go#40561. For golang/go#68552. Change-Id: Ic61e797a125aef5b9cc2782b87ea558e7c88035c Reviewed-on: https://go-review.googlesource.com/c/build/+/612555 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Tim King <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
There is a fix for the ARM32 Windows port but it hasn't been merged in yet. I believe @wmjb is the one who discovered the fix. |
Good find. I agree that the -1 doesn't make any sense. It is not even an aligned address for PC. Interestingly, on CL 366734, when Austin, Patrik, and I reviewed it at PS 4, it was still just |
yes it absolutely works without -1, been using go 1.23 on arm32 for some time now. |
Thanks, @wmjb ! Mind sending a CL? |
Go version
go version 1.17 github repo
Output of
go env
in your module/workspace:What did you do?
trying to build any version after 1.17 fails. go_bootstrap.exe faults.
started with version 1.4.3 on amd64 and cross compiled. then on arm32 device built from 1.4 up to 1.17. versions later than 1.17 eg 1.18,1.19,1.20,1.21 all exhibit same/similar failure.
What did you see happen?
Building Go cmd/dist using c:\go
Building Go toolchain1 using c:\go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
fatal error: fault
[signal 0xc000001d code=0x0 addr=0x0 pc=0x14c5687]
goroutine 1 [running]:
runtime.throw({0x1642fc8, 0x5})
c:/source/go1.18/src/runtime/panic.go:992 +0x5c fp=0x1285d910 sp=0x1285d8fc pc=0x127a28c
runtime.sigpanic()
c:/source/go1.18/src/runtime/signal_windows.go:273 +0x1bc fp=0x1285d934 sp=0x1285d910 pc=0x128fe8c
cmd/go/internal/search.NewMatch(...)
c:/source/go1.18/src/cmd/go/internal/search/search.go:37
cmd/go/internal/modload.LoadPackages({0xf40088, 0x20}, {{0x128066d8, 0x0}, 0x128043cf, 0x8, {0x8, 0x4a}, 0x0, 0x0, ...}, ...)
c:/source/go1.18/src/cmd/go/internal/modload/load.go:250 +0x13f fp=0x1285daa4 sp=0x1285d938 pc=0x14c5687
runtime: unexpected return pc for cmd/go/internal/modload.LoadPackages called from 0x1c
stack: frame={sp:0x1285daa4, fp:0x1285dc10} stack=[0x12856000,0x1285e000)
0x1285da24: 0x1287a280 0x0000003e 0x0000003e 0x00000008
0x1285da34: 0x00000000 0x00000000 0x00000000 0x00555555
0x1285da44: 0x00000002 0x00000001 0x00000002 0x00000001
0x1285da54: 0x00000001 0x00000001 0x00000002 0x00000008
0x1285da64: 0x0000005c 0x00000010 0x00000200 0x00000000
0x1285da74: 0x01240000 0x00000009 0x00000000 0x12823dc0
0x1285da84: 0x00000004 0x016ecc70 0x00000001 0x00000000
0x1285da94: 0x12844264 0x00082f08 0x01478b10 <cmd/go/internal/search.CleanPatterns+0x000003b0> 0x12823df8
0x1285daa4: <0x0000001c 0x00f40088 0x00000020 0x128066d8
0x1285dab4: 0x00000000 0x128043cf 0x00000008 0x00000008
0x1285dac4: 0x0000004a 0x00000000 0x00000002 0x1283e1e0
0x1285dad4: 0x1283e1e0 0x12806698 0x12804350 0x128066c0
0x1285dae4: 0x0000000c 0x0000004a 0x0000004a 0x12860200
0x1285daf4: 0x00000008 0x016ed3ec 0x00000000 0x00000000
0x1285db04: 0x00000008 0x1281c1f0 0x1283c680 0x0124d140 <runtime.newobject+0x0000002c>
0x1285db14: 0x128043c0 0x00000010 0x0000000c 0x0160ff38
0x1285db24: 0x00000008 0x0004000b 0x00000000 0x00f49fa0
0x1285db34: 0x0000000c 0x00f40088 0x00000010 0x018c36f8
0x1285db44: 0x128043c0 0x00000000 0x00000000 0x014c5874 <cmd/go/internal/modload.LoadPackages+0x0000032c>
0x1285db54: 0x0000000c 0x0160ff38 0x01643801 0x128043c0
0x1285db64: 0x01501bbc <cmd/go/internal/load.PackagesAndErrors+0x000002d8> 0x016efaec 0x1281c0d0 0x00000000
0x1285db74: 0x00000000 0x129368c0 0x00000000 0x00000000
0x1285db84: 0x00000000 0x00000100 0x00000000 0x01000000
0x1285db94: 0x00000000 0x00000000 0x00000000 0x00000000
0x1285dba4: 0x00000000 0x1283e1e0 0x00000000 0x128043c0
0x1285dbb4: 0x013529fc <path/filepath.Clean+0x00000884> 0x00928b42 0x00000035 0x01641fc6
0x1285dbc4: 0x00000008 0x00000000 0x0000003e 0x01641fc6
0x1285dbd4: 0x00000003 0x00000004 0x00000000 0x013480f4 <strings.Replace+0x00000098>
0x1285dbe4: 0x12924c00 0x00000026 0x013480f4 <strings.Replace+0x00000098> 0x12924c02
0x1285dbf4: 0x0000001d 0x0000002f 0x00000000 0x12924c00
0x1285dc04: 0x1281c1f0 0x01293ed8 <runtime.concatstrings+0x0000010c> 0x00000026 >0x013529fc <path/filepath.Clean+0x00000884>
0x1285dc14: 0x1283e1e0 0x0000001d 0x01293fb4 <runtime.concatstrings+0x000001e8> 0x00000001
0x1285dc24: 0x01294098 <runtime.concatstring2+0x0000005c> 0x01290484 <runtime.makeslice+0x000000ac> 0x016ed0ac 0x01472cc4 <cmd/go/internal/trace.StartSpan+0x0000003c>
0x1285dc34: 0x018e779c 0x1287a190 0x129368e0 0x12804260
0x1285dc44: 0x00000001 0x01501944 <cmd/go/internal/load.PackagesAndErrors+0x00000060> 0x016efaec 0x1281c0d0
0x1285dc54: 0x00000000 0x00000000 0x00000000 0x012a5700 <runtime.exitsyscall+0x000000b8>
0x1285dc64: 0x1282a048 0x00000003 0x00000002 0x00000001
0x1285dc74: 0x00000001 0x00000000 0x00000000 0x01501b54 <cmd/go/internal/load.PackagesAndErrors+0x00000270>
0x1285dc84: 0x00000003 0x012a5644 <runtime.entersyscall+0x00000018> 0x00000000
cmd/go/internal/modload.LoadPackages({0x1283e1e0, 0x1d}, {{0x1293fb4, 0x1}, 0x1294098, 0x84, {0x16ed0ac, 0x1472cc4}, 0x9c, 0x77, ...}, ...)
c:/source/go1.18/src/cmd/go/internal/modload/load.go:343 +0x398 fp=0x1285dc10 sp=0x1285daa4 pc=0x14c58e0
go tool dist: FAILED: c:\source\go1.18\pkg\tool\windows_arm\go_bootstrap install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 2
What did you expect to see?
go built from source.
The text was updated successfully, but these errors were encountered: