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

Open
WojciechMula opened this issue Jul 22, 2022 · 0 comments
Open

cmd/asm: panic for duplicated TEXT #53994

WojciechMula opened this issue Jul 22, 2022 · 0 comments
Labels
NeedsFix
Milestone

Comments

@WojciechMula
Copy link

@WojciechMula WojciechMula commented Jul 22, 2022

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 label Jul 22, 2022
@toothrot toothrot added this to the Backlog milestone Jul 22, 2022
@rsc rsc added NeedsFix and removed NeedsInvestigation 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

3 participants