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/link: crash with -E <nonexisting symbol> #36103

Open
eliasnaur opened this issue Dec 12, 2019 · 2 comments
Open

cmd/link: crash with -E <nonexisting symbol> #36103

eliasnaur opened this issue Dec 12, 2019 · 2 comments
Labels
NeedsDecision
Milestone

Comments

@eliasnaur
Copy link
Contributor

@eliasnaur eliasnaur commented Dec 12, 2019

$ go version
go version devel +3a3093d5c7 Mon Dec 9 21:50:59 2019 +0000 linux/amd64
$ cat main.go
package main

func main() {
}
$ go build -ldflags="-E nonexistent" main.go 
# command-line-arguments
panic: runtime error: index out of range [-1]

goroutine 1 [running]:
cmd/link/internal/ld.(*Link).pclntab(0xc000082480)
	/home/elias/dev/go-tip/src/cmd/link/internal/ld/pcln.go:374 +0x1e40
cmd/link/internal/ld.Main(0x8912a0, 0x10, 0x20, 0x1, 0x7, 0x10, 0x6bddc3, 0x1b, 0x6b9e74, 0x14, ...)
	/home/elias/dev/go-tip/src/cmd/link/internal/ld/main.go:243 +0xc62
main.main()
	/home/elias/dev/go-tip/src/cmd/link/main.go:68 +0x1bc
@cherrymui
Copy link
Member

@cherrymui cherrymui commented Dec 12, 2019

Hmmm. -E nonexistent clearly won't work. What would you expect? A clean exit with an error?

@eliasnaur
Copy link
Contributor Author

@eliasnaur eliasnaur commented Dec 12, 2019

Sorry for not being clear. An error about the missing symbol would be nice, but since this is arguably a dusty corner of the linker, not panicing is fine.

@toothrot toothrot added the NeedsInvestigation label Dec 13, 2019
@toothrot toothrot added this to the Backlog milestone Dec 13, 2019
@toothrot toothrot added the NeedsDecision label Dec 13, 2019
@gopherbot gopherbot removed the NeedsInvestigation label Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDecision
Projects
None yet
Development

No branches or pull requests

4 participants