go: runtime: problem with preemption on windows arm32
Go version
go version 1.17 github repo
Output of go env in your module/workspace:
set GOARCH=arm
set GOBIN=
set GOCACHE=C:\Users\User\AppData\Local\go-build
set GOENV=C:\Users\User\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=arm
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\User\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\User\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_arm
set GOVCS=
set GOVERSION=go1.17.13
set GCCGO=gccgo
set GOARM=7
set AR=ar
set CC=C:\llvm-mingw-20240619-ucrt-armv7\bin\armv7-w64-mingw32-gcc.exe
set CXX=C:\llvm-mingw-20240619-ucrt-armv7\bin\armv7-w64-mingw32-g++.exe
set CGO_ENABLED=0
set GOMOD=c:\source\go1.18\src\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-marm -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\User\AppData\Local\Temp\go-build1006532952=/tmp/go-build -gno-record-gcc-switches
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.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (10 by maintainers)
Commits related to this issue
- cmd/dist, internal/platform: mark windows/arm (32-bit ARM) broken The port is reportedly broken, and there isn't a builder testing it. For #68552. For #67308. Change-Id: Iababa17cdf855b675aaf85642a... — committed to golang/go by dmitshur 2 years ago
- internal/releasetargets: drop 1.21 targets, add 1.24 targets 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/a... — committed to golang/build by dmitshur 2 years ago
- [GITHUB] Fix MSVC ARM build The latest GitHub Actions runner image 20241113.3.0 uses WDK 10.0.26100.0, which dropped support for 32-bit ARM platform: - https://github.com/golang/go/issues/68552#issue... — committed to binarymaster/reactos by binarymaster 2 years ago
- [GITHUB] Fix MSVC ARM build The latest GitHub Actions runner image 20241113.3.0 uses WDK 10.0.26100.0, which dropped support for 32-bit ARM platform: - https://github.com/golang/go/issues/68552#issue... — committed to reactos/reactos by binarymaster 2 years ago
- runtime: deduplicate context call injection on Windows Injecting a call to a thread context is complex enough to warrant a dedicated function so that we don't repeat the same code in multiple places.... — committed to httpsgithu/go by qmuntal 2 years ago
a bit more investigating has revealed that if the line https://github.com/golang/go/blob/b5ee80a85ad1a0c5f3e87b95e516d4c6ca42fa4b/src/runtime/os_windows.go#L1328 is changed from c.set_lr(newpc - 1) to c.set_lr(newpc)
the bootstrap compiles and loads correctly also.
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
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.