Skip to content

cmd/compile: DWARF Incorrect location list #47850

Open
@mahdi-hm

Description

@mahdi-hm

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

$ go version
go version go1.16.7 linux/amd64

Does this issue reproduce with the latest release?

The problem exists on 1.14.9 and 1.17RC2 as well

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mahdi/.cache/go-build"
GOENV="/home/mahdi/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/mahdi/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/mahdi/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.7"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build275819546=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Using some debuggers like Delve I tried to debug below code and monitor some local variable inside printParams function. I put a break point on line 16 which is the 5th line in the mentioned function using break main.printParams:5

package main

import "fmt"

func printParams(b2 [][]int, p2 *[][]int) {
	fmt.Println("Entering printParams")
	b2[1] = append(b2[1], 99)
	for i := 0; i < len(b2); i++ {
		for j := 0; j < len(b2[i]); j++ {
			fmt.Println(b2[i][j])
		}
	}
	fmt.Println((*p2)[0][0])
	fmt.Println("Exiting printParams")
}

func main() {
	var slice = make([][]int, 2)

	slice[0] = []int{11, 12, 13}
	slice[1] = []int{21, 22, 23}
	slice[1] = append(slice[1], 24)

	printParams(slice, &slice)
}

What did you expect to see?

When stopping at line 16 and tried to read the local variable using locals in delve, the result was this:

i = (unreadable could not find loclist entry at 0x86495 for address 0x49772a)
j = 0

What did you see instead?

I expected to be able to see the value of variable i something like below:

i = 0
j = 0

Metadata

Metadata

Assignees

Labels

NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Status

Triage Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions