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/compile: incorrect abstract origin assigned to param of inlined subroutine #23020

Closed
thanm opened this issue Dec 6, 2017 · 4 comments
Closed

Comments

@thanm
Copy link
Contributor

thanm commented Dec 6, 2017

Please answer these questions before submitting your issue. Thanks!

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

tip
go version devel +70f441bc49 Wed Dec 6 19:27:26 2017 +0000 linux/amd64

Does this issue reproduce with the latest release?

yes

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

GOHOSTARCH="amd64"
GOHOSTOS="linux"

What did you do?

Compile this program:

Examine the generated DWARF for the inlined routine "cand". Both parameters share the same abstract origin, which should never happen.

 <3><3232c>: Abbrev Number: 17 (DW_TAG_formal_parameter)
    <3232d>   DW_AT_abstract_origin: <0x3229b>
    <32331>   DW_AT_location    : 2 byte block: 91 60 	(DW_OP_fbreg: -32)
 <3><32334>: Abbrev Number: 17 (DW_TAG_formal_parameter)
    <32335>   DW_AT_abstract_origin: <0x3229b>
    <32339>   DW_AT_location    : 2 byte block: 91 68 	(DW_OP_fbreg: -24)

A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

Different abstract origins.

What did you see instead?

Both params have abstract originl 0x3229b. The code that assigns it is buggy.

@thanm thanm self-assigned this Dec 6, 2017
@thanm thanm added the Debugging label Dec 6, 2017
@thanm
Copy link
Contributor Author

thanm commented Dec 6, 2017

FYI, this bug will impact user experience in GDB, but will not cause any crashes or other unpleasant runtime behavior, just to be clear.

@gopherbot
Copy link

Change https://golang.org/cl/82396 mentions this issue: cmd/compile: fix bug in logic for computing var abstract origins

@cherrymui
Copy link
Member

Compile this program:

The program seems missing...

@thanm
Copy link
Contributor Author

thanm commented Dec 7, 2017

Apologies-- "paste" apparently didn't go through. Here is the playground link:

https://play.golang.org/p/BIf78rGlOI

@golang golang locked and limited conversation to collaborators Dec 7, 2018
@rsc rsc unassigned thanm Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants