-
Notifications
You must be signed in to change notification settings - Fork 18k
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
x/website: unclear C compiler requirements for race detector on windows #66934
Comments
That's a windows loader error, I don't think there's anything to do from Go. Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
@seankhliao what do you mean by windows loader ? |
in simple words, -race should detect the race, it doesn't, seems like a bug for me (no matter the os) |
If you search for "exit status 0xc0000139", you'll find that it's a windows / c toolchain issue. |
@seankhliao And ? So should i change my OS if i want to use go1.22 ? or maybe use go until go1.21 on windows OS ? |
I'm going to reopen, but @seankhliao is right, this is likely a C toolchain issue. What windows version are you using? |
Thank you @randall77 Here is my go env and the output of the command --print-file-name libsynchronization.a PS C:\Users\kamal\Desktop\korm> go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\kamal\AppData\Local\go-build
set GOENV=C:\Users\kamal\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\kamal\go\pkg\mod
set GONOPROXY=github.com/kamalshkeir/kamal
set GONOSUMDB=github.com/kamalshkeir/kamal
set GOOS=windows
set GOPATH=C:\Users\kamal\go
set GOPRIVATE=github.com/kamalshkeir/kamal
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.22.0
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\kamal\Desktop\korm\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\kamal\AppData\Local\Temp\go-build3319990875=/tmp/go-build -gno-record-gcc-switches
PS C:\Users\kamal\Desktop\korm> gcc --print-file-name libsynchronization.a
D:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libsynchronization.a |
@randall77 , i try it with go1.20 , works fine, now i will try with mingw 11.2: PS C:\Users\kamal\Desktop\testwsStream> go mod tidy
PS C:\Users\kamal\Desktop\testwsStream> go test ./... -v -race
exit status 0xc0000139
FAIL testwsStream 0.299s
FAIL
PS C:\Users\kamal\Desktop\testwsStream> go1.20.exe mod tidy
PS C:\Users\kamal\Desktop\testwsStream> go1.20.exe test ./... -v -race
=== RUN TestFoo
0
==================
WARNING: DATA RACE
Write at 0x00c000121968 by goroutine 8:
testwsStream.makeRace.func1()
C:/Users/kamal/Desktop/testwsStream/main_test.go:12 +0x39
Previous read at 0x00c000121968 by goroutine 7:
testwsStream.makeRace()
C:/Users/kamal/Desktop/testwsStream/main_test.go:15 +0x114
testwsStream.TestFoo()
C:/Users/kamal/Desktop/testwsStream/main_test.go:20 +0x24
testing.tRunner()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:1576 +0x216
testing.(*T).Run.func1()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:1629 +0x47
Goroutine 8 (running) created at:
testwsStream.makeRace()
C:/Users/kamal/Desktop/testwsStream/main_test.go:11 +0x104
testwsStream.TestFoo()
C:/Users/kamal/Desktop/testwsStream/main_test.go:20 +0x24
testing.tRunner()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:1576 +0x216
testing.(*T).Run.func1()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:1629 +0x47
Goroutine 7 (running) created at:
testing.(*T).Run()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:1629 +0x805
testing.runTests.func1()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:2036 +0x8d
testing.tRunner()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:1576 +0x216
testing.runTests()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:2034 +0x87c
testing.(*M).Run()
C:/Users/kamal/sdk/go1.20/src/testing/testing.go:1906 +0xb44
main.main()
_testmain.go:47 +0x2e9
==================
testing.go:1446: race detected during execution of test
--- FAIL: TestFoo (0.00s)
=== NAME
testing.go:1446: race detected during execution of test
FAIL
FAIL testwsStream 0.323s
FAIL |
@randall77 after update gcc to 13.2.0 it worked with go1.22 PS C:\Users\kamal\Desktop\testwsStream> gcc --version
gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r7) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
PS C:\Users\kamal\Desktop\testwsStream> go test ./... -v -race
=== RUN TestFoo
0
==================
WARNING: DATA RACE
Write at 0x00c00000aea8 by goroutine 8:
testwsStream.makeRace.func1()
C:/Users/kamal/Desktop/testwsStream/main_test.go:12 +0x33
Previous read at 0x00c00000aea8 by goroutine 7:
testwsStream.makeRace()
C:/Users/kamal/Desktop/testwsStream/main_test.go:15 +0x10c
testwsStream.TestFoo()
C:/Users/kamal/Desktop/testwsStream/main_test.go:20 +0x1c
testing.tRunner()
C:/Program Files/Go/src/testing/testing.go:1689 +0x21e
testing.(*T).Run.gowrap1()
C:/Program Files/Go/src/testing/testing.go:1742 +0x44
Goroutine 8 (running) created at:
testwsStream.makeRace()
C:/Users/kamal/Desktop/testwsStream/main_test.go:11 +0xfc
testwsStream.TestFoo()
C:/Users/kamal/Desktop/testwsStream/main_test.go:20 +0x1c
testing.tRunner()
C:/Program Files/Go/src/testing/testing.go:1689 +0x21e
testing.(*T).Run.gowrap1()
C:/Program Files/Go/src/testing/testing.go:1742 +0x44
Goroutine 7 (running) created at:
testing.(*T).Run()
C:/Program Files/Go/src/testing/testing.go:1742 +0x825
testing.runTests.func1()
C:/Program Files/Go/src/testing/testing.go:2161 +0x85
testing.tRunner()
C:/Program Files/Go/src/testing/testing.go:1689 +0x21e
testing.runTests()
C:/Program Files/Go/src/testing/testing.go:2159 +0x8be
testing.(*M).Run()
C:/Program Files/Go/src/testing/testing.go:2027 +0xf17
main.main()
_testmain.go:47 +0x2bd
==================
testing.go:1398: race detected during execution of test
--- FAIL: TestFoo (0.00s)
FAIL
FAIL testwsStream 0.275s
FAIL |
Ok, we're officially way past my windows knowledge. Maybe a windows expert would know what this issue might be. |
I also agree. -race flag uses C toolchain to build your code. So if your C toolchain does not work with go1.22 you will have a problem.
Yes. #61916 looks similar. Unfortunately I do not know much about C compilers. Maybe others will help. Perhaps @thanm has some suggestions - he was fixing similar errors at some stage. If gcc 13.2.0 works for you, just use it. Alex |
Investigated this a bit. Looks like |
Duplicate of #61058 |
Go version
go version go1.22.0 windows/amd64
Output of
go env
in your module/workspace:What did you do?
when running
go test ./... -v -race
:What did you see happen?
also i notice that i have the same exit error even if there is no race at all, just adding the -race flag break everything
What did you expect to see?
since i use -v, i should see logs of where the race happened
The text was updated successfully, but these errors were encountered: