Skip to content

cmd/link: panic on NetBSD 9/i386 #76815

@bsiegert

Description

@bsiegert

Go version

go version 1.25.5 netbsd/386

Output of go env in your module/workspace:

N/A (this is on a CI machine that I do not have direct access to)

What did you do?

In one of the latest NetBSD 386 bulk builds (https://releng.netbsd.org/bulktracker/pkg/74236393), I see multiple Go packages where the linker panics during the build.

What did you see happen?

For example in go-swagger:

github.com/go-swagger/go-swagger/cmd/swagger
# github.com/go-swagger/go-swagger/cmd/swagger
panic: runtime error: index out of range [-7]

goroutine 543 [running]:
cmd/link/internal/ld.(*Link).findfunctab.func1(0x8806ea8, 0x7efad)
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/pcln.go:915 +0x72c
cmd/link/internal/ld.writeBlock(0x8806ea8, 0x9880900, 0x897e008, {0xc8d82d0, 0x29a4, 0x29a4}, 0x8c7f148, 0x1cc898, {0x85c38e0, 0x200, ...})
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/data.go:1129 +0x58e
cmd/link/internal/ld.writeBlocks.func1(0x9880900, 0x897e008, {0xc8d82d0, 0x29a4, 0x29a4}, 0x8c7f148, 0x1cc898, {0x85c38e0, 0x200, 0x200})
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/data.go:1080 +0x8c
created by cmd/link/internal/ld.writeBlocks in goroutine 514
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/data.go:1079 +0x606
*** Error code 1

golangci-lint:

# github.com/golangci/golangci-lint/v2/cmd/golangci-lint
panic: runtime error: index out of range [-7]

goroutine 1352 [running]:
cmd/link/internal/ld.(*Link).findfunctab.func1(0x8882488, 0x106cd9)
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/pcln.go:915 +0x72c
cmd/link/internal/ld.writeBlock(0x8882488, 0x9833b00, 0x89fc008, {0x11660c8c, 0x4acb, 0x4acb}, 0x97bb84c, 0x2ba5f4, {0x85c38e0, 0x200, ...})
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/data.go:1129 +0x58e
cmd/link/internal/ld.writeBlocks.func1(0x9833b00, 0x89fc008, {0x11660c8c, 0x4acb, 0x4acb}, 0x97bb84c, 0x2ba5f4, {0x85c38e0, 0x200, 0x200})
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/data.go:1080 +0x8c
created by cmd/link/internal/ld.writeBlocks in goroutine 1283
	/pbulk/work/lang/go125/work/go/src/cmd/link/internal/ld/data.go:1079 +0x606
*** Error code 1

These are the same crash. Any ideas?

What did you expect to see?

I expect to see a successful build, of course. I have not seen these crashes on other architectures, so maybe it's 386-specific?

/cc @golang/netbsd

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.OS-NetBSDarch-386Issues solely affecting the 32-bit x86 architecturecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions