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

cmd/compile: deadlock in sync.Mutex.Lock #70256

Closed
karalabe opened this issue Nov 8, 2024 · 5 comments
Closed

cmd/compile: deadlock in sync.Mutex.Lock #70256

karalabe opened this issue Nov 8, 2024 · 5 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@karalabe
Copy link
Contributor

karalabe commented Nov 8, 2024

Go version

go1.23-alpine

Output of go env in your module/workspace:

-

What did you do?

I've tried to cross build our project to riscv64, via docker alpine:latest.

What did you see happen?

Build failed with a compiler bug (IMO):

------                                                                                                                                                                                                      
 > [builder 7/7] RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth:                                                                                                                      
21.80 # vendor/golang.org/x/crypto/internal/poly1305                                                                                                                                                        
21.80 fatal error: all goroutines are asleep - deadlock!                                                                                                                                                    
21.80                                                                                                                                                                                                       
21.80 goroutine 1 [semacquire]:                                                                                                                                                                             
21.80 sync.runtime_Semacquire(0xc0008a0740?)
21.80 	runtime/sema.go:71 +0x38
21.80 sync.(*WaitGroup).Wait(0xc0008a0740)
21.80 	sync/waitgroup.go:118 +0x64
21.80 cmd/compile/internal/gc.compileFunctions(0x0)
21.80 	cmd/compile/internal/gc/compile.go:200 +0x258
21.80 cmd/compile/internal/gc.Main(0x9ce378)
21.80 	cmd/compile/internal/gc/main.go:306 +0x10fc
21.80 main.main()
21.80 	cmd/compile/main.go:57 +0x118
21.80 
21.80 goroutine 7 [select]:
21.80 cmd/compile/internal/gc.compileFunctions.func3()
21.80 	cmd/compile/internal/gc/compile.go:158 +0xf8
21.80 created by cmd/compile/internal/gc.compileFunctions in goroutine 1
21.80 	cmd/compile/internal/gc/compile.go:151 +0x104
21.80 
21.80 goroutine 51 [sync.Mutex.Lock]:
21.80 sync.runtime_SemacquireMutex(0x1e6200?, 0x7c?, 0xc0000af050?)
21.80 	runtime/sema.go:95 +0x44
21.80 sync.(*Mutex).lockSlow(0xc0004a4078)
21.80 	sync/mutex.go:173 +0x180
21.80 sync.(*Mutex).Lock(...)
21.80 	sync/mutex.go:92
21.80 cmd/internal/obj.(*Link).LookupInit(0xc0004a4008, {0xc000b0a450, 0x12}, 0x0)
21.80 	cmd/internal/obj/sym.go:127 +0x8c
21.80 cmd/internal/obj.(*Link).Lookup(...)
21.80 	cmd/internal/obj/sym.go:120
21.80 cmd/compile/internal/dwarfgen.createComplexVar(0xc000865b80, 0xc000b72390?, 0x6c1340?, 0x0)
21.80 	cmd/compile/internal/dwarfgen/dwarf.go:528 +0x324
21.80 cmd/compile/internal/dwarfgen.createComplexVars(...)
21.80 	cmd/compile/internal/dwarfgen/dwarf.go:485
21.80 cmd/compile/internal/dwarfgen.createDwarfVars(0xc000865b80, 0x60?, 0xc00067f540, {0xc0000a2ba0, 0x3, 0x4}, 0x0)
21.80 	cmd/compile/internal/dwarfgen/dwarf.go:167 +0xe1c
21.80 cmd/compile/internal/dwarfgen.Info(0xc000865b80, 0xc0008bc100, {0xb07738?, 0xc00067f540})
21.80 	cmd/compile/internal/dwarfgen/dwarf.go:123 +0x238
21.80 cmd/internal/obj.(*Link).populateDWARF(...)
21.80 	cmd/internal/obj/dwarf.go:346
21.80 cmd/internal/obj.Flushplist(0xc0004a4008, 0xc000b6ff38, 0xc0000c52e0)
21.80 	cmd/internal/obj/plist.go:173 +0xf24
21.80 cmd/compile/internal/objw.(*Progs).Flush(...)
21.80 	cmd/compile/internal/objw/prog.go:112
21.80 cmd/compile/internal/ssagen.Compile(0xc00067f540, 0x1, 0x0?)
21.80 	cmd/compile/internal/ssagen/pgen.go:327 +0x6c0
21.80 cmd/compile/internal/gc.compileFunctions.func5.1(0x0?)
21.80 	cmd/compile/internal/gc/compile.go:188 +0x4c
21.80 cmd/compile/internal/gc.compileFunctions.func3.1()
21.80 	cmd/compile/internal/gc/compile.go:170 +0x40
21.80 created by cmd/compile/internal/gc.compileFunctions.func3 in goroutine 7
21.80 	cmd/compile/internal/gc/compile.go:169 +0x208

What did you expect to see?

Restarting the build finished without issues.

@mvdan
Copy link
Member

mvdan commented Nov 8, 2024

Did you mean to add an issue title?

@seankhliao
Copy link
Member

seankhliao commented Nov 8, 2024

what's the actual go command that fails?
also please complete the issue template

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 8, 2024
@adonovan adonovan changed the title import/path: issue title cmd/compile: deadlock in sync.Mutex.Lock Nov 8, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 8, 2024
@karalabe
Copy link
Contributor Author

karalabe commented Nov 9, 2024

@mvdan Oh sorry, I missed the title. Was editing this at 2AM and must have had a brain fart.

@seankhliao It's was pretty standard go build

/usr/local/go/bin/go build -ldflags "--buildid=none -X github.com/ethereum/go-ethereum/internal/version.gitCommit=ce433f7000987e8b0497a8287239d2a30b6d7b96 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20241108 -extldflags '-Wl,-z,stack-size=0x800000,--build-id=none,--strip-all -static'" -tags urfave_cli_no_docs,ckzg,osusergo,netgo -trimpath -v -o /go-ethereum/build/bin/geth ./cmd/geth

@seankhliao seankhliao added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Nov 9, 2024
@gopherbot
Copy link
Contributor

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
Development

No branches or pull requests

5 participants