You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: