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/asm: panic for duplicated TEXT #53994

Closed
WojciechMula opened this issue Jul 22, 2022 · 1 comment
Closed

cmd/asm: panic for duplicated TEXT #53994

WojciechMula opened this issue Jul 22, 2022 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@WojciechMula
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.18.1 linux/amd64

Does this issue reproduce with the latest release?

Don't know

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/wojtek/.cache/go-build"
GOENV="/home/wojtek/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/wojtek/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/wojtek/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.18"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.18/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1603123293=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Assemble a program with duplicated procedures.

TEXT foo(SB), 0, $0
    RET

TEXT foo(SB), 0, $0
    RET

What did you expect to see?

A descriptive error message.

What did you see instead?

Panic

~/tmp$ go build
# main
asm: InitTextSym double init for foo
panic: invalid use of LSym - NewFuncInfo with Extra of type *obj.FuncInfo

goroutine 1 [running]:
cmd/internal/obj.(*LSym).NewFuncInfo(0x5c1f6a?)
	/usr/lib/go-1.18/src/cmd/internal/obj/link.go:498 +0xf4
cmd/internal/obj.(*Link).InitTextSym(0xc000100200, 0xc0000e8100, 0x0)
	/usr/lib/go-1.18/src/cmd/internal/obj/plist.go:170 +0xf6
cmd/asm/internal/asm.(*Parser).asmText(0xc0000cbe78, {0xc0000cbd18, 0x3, 0x0?})
	/usr/lib/go-1.18/src/cmd/asm/internal/asm/asm.go:180 +0x4fd
cmd/asm/internal/asm.(*Parser).pseudo(0xc0000cbe78?, {0xc0000bc170?, 0xc0000bc167?}, {0xc0000cbd18?, 0x0?, 0x0?})
	/usr/lib/go-1.18/src/cmd/asm/internal/asm/parse.go:297 +0x54
cmd/asm/internal/asm.(*Parser).Parse(0xc0000cbe78)
	/usr/lib/go-1.18/src/cmd/asm/internal/asm/parse.go:105 +0xd6
main.main()
	/usr/lib/go-1.18/src/cmd/asm/main.go:92 +0x7b6
@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 22, 2022
@toothrot toothrot added this to the Backlog milestone Jul 22, 2022
@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 22, 2022
@rsc rsc modified the milestones: Backlog, Go1.20 Jul 22, 2022
@rsc rsc changed the title assembler: panics on duplicated procedures cmd/asm: panic for duplicated TEXT Jul 22, 2022
@gopherbot
Copy link

Change https://go.dev/cl/455276 mentions this issue: cmd/asm: improve assembler error messages

@golang golang locked and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants