Skip to content

cmd/compile: incorrect DWARF location for runtime.throw's in-param #46425

Closed
@thanm

Description

@thanm

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

$ go version
go version devel go1.17-15a374d5c1 Wed May 19 01:09:20 2021 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes. This is only on tip.

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

linux/amd64

What did you do?

Compile a small program like

https://play.golang.org/p/1wRyGFu3wca

then run it in the debugger. Set a breakpoint in runtime.throw, then run. print "s"

What did you expect to see?

(gdb) p s
$1 = 0x47bfb6 "all goroutines are asleep - deadlock!"

What did you see instead?

(gdb) p s
$2 = 0x0 <error: Cannot access memory at address 0x0>

This is a bug in the Go compiler's debug location analysis phase, being triggered by the register ABI. Things seem to work when the register ABI is disabled, but I think mainly because the incoming locations for "s" are never killed, e.g. the stack location is essentially always available. When "s" is passed in RAX/RAB, it correctly tracks this fact, but then doesn't record the correct entry location when those registers are overwritten. I am not entirely sure what is going wrong, more analysis needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions