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: bad dwarf for sudog<elemtype> #21094

randall77 opened this issue Jul 20, 2017 · 1 comment

cmd/link: bad dwarf for sudog<elemtype> #21094

randall77 opened this issue Jul 20, 2017 · 1 comment


Copy link

@randall77 randall77 commented Jul 20, 2017

We generate DWARF types for channels containing various specific types.
For a make(chan bool), for example, we generate hchan, sudog, and waitq DWARF types so we could make these types specific in the output.

The sudog contains a field called elem which points to the element to be sent or received. It has a type of unsafe.Pointer. To make a specific sudog type, we overwrite the elem field's type with the type of the element. That's wrong, we should overwrite with the pointer to-the-element type.

The DWARF is most plainly wrong when the element type isn't the size of a pointer. Then not only is the elem field wrong, but all the subsequent fields in the sudog are at the wrong offsets. (That's how I noticed this.)

I have a fix, just thinking about a test.
Looks like it has been broken since at least go1.7, so not a regression. Marking 1.10.

@matloob @heschik @derekparker

@randall77 randall77 added the Debugging label Jul 20, 2017
@randall77 randall77 added this to the Go1.10 milestone Jul 20, 2017
@randall77 randall77 self-assigned this Jul 20, 2017
Copy link

@gopherbot gopherbot commented Jul 20, 2017

CL mentions this issue.

@gopherbot gopherbot closed this in e70fae8 Aug 16, 2017
@golang golang locked and limited conversation to collaborators Aug 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.