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: missing go_kind attr for some dwarf pointer types #52717

Open
zhouguangyuan0718 opened this issue May 5, 2022 · 1 comment
Open

cmd/link: missing go_kind attr for some dwarf pointer types #52717

zhouguangyuan0718 opened this issue May 5, 2022 · 1 comment
Labels
NeedsFix

Comments

@zhouguangyuan0718
Copy link
Contributor

@zhouguangyuan0718 zhouguangyuan0718 commented May 5, 2022

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

$ go version
go version go1.17.8 linux/amd64

Does this issue reproduce with the latest release?

Yes.

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

go env Output
$ go env
GO111MODULE="off"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/zgy/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/zgy/gopath"
GOPRIVATE=""
GOPROXY=""
GOROOT="/root/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/root/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.8"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build585319194=/tmp/go-build -gno-record-gcc-switches"

What did you do?

package main

// To make sure there are pointers defined by function defptrto,
// define a chan variable.

var c chan string

func main() {
	c <- "foo"
}

go build , then use readelf -wi main | grep "Unknown AT value: 2900: 0" to print the dwarf types info.

Output
    <40146>   Unknown AT value: 2900: 0
    <40409>   Unknown AT value: 2900: 0
    <48414>   Unknown AT value: 2900: 0
    <49178>   Unknown AT value: 2900: 0
    <50a31>   Unknown AT value: 2900: 0
    <50a4e>   Unknown AT value: 2900: 0
    <50a6c>   Unknown AT value: 2900: 0
    <50a8d>   Unknown AT value: 2900: 0
    <50aad>   Unknown AT value: 2900: 0
    <50acc>   Unknown AT value: 2900: 0
    <50af1>   Unknown AT value: 2900: 0
    <50b14>   Unknown AT value: 2900: 0
    <50b43>   Unknown AT value: 2900: 0
    <50ba9>   Unknown AT value: 2900: 0
    <50bcf>   Unknown AT value: 2900: 0
    <50c7a>   Unknown AT value: 2900: 0
    <50c96>   Unknown AT value: 2900: 0
    <50cc2>   Unknown AT value: 2900: 0
    <50cf1>   Unknown AT value: 2900: 0
    <50d57>   Unknown AT value: 2900: 0
    <50d7d>   Unknown AT value: 2900: 0
    <50e28>   Unknown AT value: 2900: 0
    <50e46>   Unknown AT value: 2900: 0
    <50e6a>   Unknown AT value: 2900: 0
    <50e93>   Unknown AT value: 2900: 0
    <50ef4>   Unknown AT value: 2900: 0
    <50f13>   Unknown AT value: 2900: 0
    <50fb7>   Unknown AT value: 2900: 0
    <50fe0>   Unknown AT value: 2900: 0
    <51007>   Unknown AT value: 2900: 0
    <5103e>   Unknown AT value: 2900: 0
    <510ad>   Unknown AT value: 2900: 0
    <510da>   Unknown AT value: 2900: 0
    <5118c>   Unknown AT value: 2900: 0
    <511a9>   Unknown AT value: 2900: 0
    <511d8>   Unknown AT value: 2900: 0
    <5120b>   Unknown AT value: 2900: 0
    <51275>   Unknown AT value: 2900: 0
    <5129e>   Unknown AT value: 2900: 0
    <5134c>   Unknown AT value: 2900: 0
    <51372>   Unknown AT value: 2900: 0
    <5139e>   Unknown AT value: 2900: 0
    <513d7>   Unknown AT value: 2900: 0
    <51447>   Unknown AT value: 2900: 0
    <51477>   Unknown AT value: 2900: 0
    <5152c>   Unknown AT value: 2900: 0
    <51543>   Unknown AT value: 2900: 0
    <51612>   Unknown AT value: 2900: 0
    <51647>   Unknown AT value: 2900: 0
    <5165e>   Unknown AT value: 2900: 0
    <5171e>   Unknown AT value: 2900: 0
    <51734>   Unknown AT value: 2900: 0
    <51802>   Unknown AT value: 2900: 0
    <51836>   Unknown AT value: 2900: 0
    <5184c>   Unknown AT value: 2900: 0
    <5190b>   Unknown AT value: 2900: 0
    <51924>   Unknown AT value: 2900: 0
    <519f5>   Unknown AT value: 2900: 0
    <51a2c>   Unknown AT value: 2900: 0
    <51a45>   Unknown AT value: 2900: 0
    <51b07>   Unknown AT value: 2900: 0
    <51b23>   Unknown AT value: 2900: 0
    <51bf4>   Unknown AT value: 2900: 0
    <51c10>   Unknown AT value: 2900: 0
    <51c4a>   Unknown AT value: 2900: 0
    <51c66>   Unknown AT value: 2900: 0
    <51d2b>   Unknown AT value: 2900: 0

What did you expect to see?

The attr 2900 is DW_AT_go_kind, it should not be 0 in any types.

What did you see instead?

the attr DW_AT_go_kind of some types is 0.

The dwarf syms defined by src/cmd/link/internal/ld/dwarf.go^(*dwctxt).defptrto missed attr DW_AT_go_kind.

@gopherbot
Copy link

@gopherbot gopherbot commented May 5, 2022

Change https://go.dev/cl/402056 mentions this issue: cmd/link: fix the missing go_kind attr for pointer types defined by defptrto

@dr2chase dr2chase added the NeedsFix label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
None yet
Development

No branches or pull requests

3 participants