Skip to content

[delve/pkg/dwarf] panic: runtime error: slice bounds out of range #3873

Open
@amalavet

Description

@amalavet

For certain applications, Delve is panicking when I attempt to debug. This issue is only present for some of my go projects, some applications I can debug without issue.

  1. What version of Delve are you using (dlv version)?
Delve Debugger
Version: 1.23.1
Build: $Id: 2eba762d75437d380e48fc42213853f13aa2904d $
  1. What version of Go are you using? (go version)?
go version go1.23.3 darwin/arm64
  1. What operating system and processor architecture are you using?
darwin/arm64 (MacOS)
  1. What did you do?
❯ dlv debug cmd/server/main.go
  1. What did you expect to see?
Type 'help' for list of commands.
(dlv)
  1. What did you see instead?
panic: runtime error: slice bounds out of range [74:0]

goroutine 7 [running]:
github.com/go-delve/delve/pkg/dwarf/line.parseIncludeDirs5(0x14003cc3810, 0x1400419d1a0)
        REDACTED/go/1.23.3/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/dwarf/line/line_parser.go:188 +0x460
github.com/go-delve/delve/pkg/dwarf/line.Parse({0x14006b3e630, 0xd}, 0x1400419d1a0, {0x0, 0x0, 0x0}, 0x0, 0x76c000, 0x0, 0x8)
        REDACTED/go/1.23.3/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/dwarf/line/line_parser.go:100 +0x23c
github.com/go-delve/delve/pkg/proc.(*BinaryInfo).loadDebugInfoMaps(0x1400023e000, 0x140016bc000, {0x14003c42000, 0x9b6289, 0x9b6289}, {0x14004768000, 0x6cf93a, 0x6cf93a}, 0x140016943c0, 0x14000242200)
        REDACTED/go/1.23.3/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/bininfo.go:2478 +0x7a8
created by github.com/go-delve/delve/pkg/proc.loadBinaryInfoMacho in goroutine 1
        REDACTED/go/1.23.3/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/bininfo.go:2017 +0x590

Also, here is my go env

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='REDACTED/Library/Caches/go-build'
GOENV='REDACTED/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='REDACTED/go/1.23.3/pkg/mod'
GONOPROXY=''
GONOSUMDB=REDACTED
GOOS='darwin'
GOPATH='REDACTED/go/1.23.3'
GOPRIVATE=''
GOPROXY=REDACTED
GOROOT='REDACTED/.goenv/versions/1.23.3'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='REDACTED/.goenv/versions/1.23.3/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.3'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='REDACTED/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='/usr/local/bin/gcc'
CXX='/usr/bin/g++'
CGO_ENABLED='1'
GOMOD='REDACTED/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fmessage-length=0 -ffile-prefix-map=/var/folders/p2/r1fr92ns20dggzgnmv20w1p80000gn/T/go-build3234217224=/tmp/go-build -gno-record-gcc-switches -fno-common'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions