cmd/link: panic on riscv64 with CGO enabled due to empty container symbol #72840
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go version go1.24.1 linux/riscv64
Output of
go env
in your module/workspace:What did you do?
Built Go (version 1.24.1) on a riscv64 system on Fedora 42 with CGO enabled. Ran the full Go check suite and also attempted a minimal reproduction by isolating tests in the
internal/poll
directory. In the minimal test setup, I removed others test files ininternal/poll
and only the test fileserror_linux_test.go
,error_stub_test.go
, anderror_test.go
remained. Furthermore, I experimented with a workaround by commenting out the following code inerror_test.go
:and trying to run
cd /builddir/build/BUILD/golang-1.24.1-build/go/src ./run.bash --no-rebuild -v -v -v -k internal/poll
What did you see happen?
The build fails during the linking phase with a panic. Key parts of the error log include:
This panic in the linker (
cmd/link/internal/loader.(*Loader).AddInteriorSym
) prevents the test suite from completing. The workaround of commenting out the code inerror_test.go
allowed the tests to pass, indicating that the issue might be related to the handling of certain symbols.And I also tried with CGO disabled(by set CGO_ENABLED=0), test complete successfully without panics.
full build log: http://openkoji.iscas.ac.cn/kojifiles/work/tasks/8787/7038787/build.log
golang spec file: https://src.fedoraproject.org/rpms/golang/blob/rawhide/f/golang.spec
What did you expect to see?
I expected the Go build and test suite to complete successfully without panics, even with CGO enabled on the riscv64 platform. The behavior should be consistent with other architectures where the build passes without the need to modify test files.
The text was updated successfully, but these errors were encountered: