Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Panic when vscode attempts to inspect variables #3865

Closed
firelizzard18 opened this issue Nov 20, 2024 · 1 comment
Closed

Panic when vscode attempts to inspect variables #3865

firelizzard18 opened this issue Nov 20, 2024 · 1 comment

Comments

@firelizzard18
Copy link

  1. What version of Delve are you using (dlv version)?

    1.23.1, build ID 2eba762d75437d380e48fc42213853f13aa2904d, built with the same commit of go that I'm working on (as in I reinstalled delve with a go binary built from the CL I'm working on).

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

    Tip (CL 601535)

  3. What operating system and processor architecture are you using?

    Gentoo on a Framework 16

    Linux 6.6.21-gentoo-x86_64 #121 SMP PREEMPT_DYNAMIC Wed Oct 30 15:28:26 CDT 2024 x86_64 AMD Ryzen 9 7940HS w/ Radeon 780M Graphics AuthenticAMD GNU/Linux
    
  4. What did you do?

    I'm debugging golang CL 601535. I set a breakpoint in diffJSON in cmd/internal/test2json/test2json_test.go.

  5. What did you expect to see?

    A normal debugging session.

  6. What did you see instead?

    A panic in the debugger output and an internal runtime error in the variables view.

debug console
Starting: /home/firelizzard/go/bin/dlv dap --listen=127.0.0.1:40719 --log-dest=3 from /home/firelizzard/src/golang/go/src/cmd/internal/test2json
DAP server listening at: 127.0.0.1:40719
Type 'dlv help' for list of commands.
2024-11-19T17:20:39-07:00 error layer=dap recovered panic: runtime error: invalid memory address or nil pointer dereference
goroutine 7 [running]:
runtime/debug.Stack()
	/home/firelizzard/src/golang/go/src/runtime/debug/stack.go:26 +0x5e
github.com/go-delve/delve/service/dap.(*Session).recoverPanic(0xc0001badc0, {0xca93a0, 0xc000b75020})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/dap/server.go:579 +0x58
panic({0xacab40?, 0x11bd6b0?})
	/home/firelizzard/src/golang/go/src/runtime/panic.go:787 +0x132
github.com/go-delve/delve/pkg/proc.(*Variable).mapIterator(0xc000c64740)
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/variables.go:2081 +0x59d
github.com/go-delve/delve/pkg/proc.(*Variable).loadValueInternal(0xc000c64740, 0x2, {0x1, 0x1, 0x200, 0x40, 0xffffffffffffffff, 0x1900})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/variables.go:1345 +0x56a
github.com/go-delve/delve/pkg/proc.(*Variable).loadValueInternal(0xc000a5e008, 0x1, {0x1, 0x1, 0x200, 0x40, 0xffffffffffffffff, 0x1900})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/variables.go:1401 +0xdca
github.com/go-delve/delve/pkg/proc.(*Variable).loadValueInternal(0xc000f17e60, 0x0, {0x1, 0x1, 0x200, 0x40, 0xffffffffffffffff, 0x1900})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/variables.go:1401 +0xdca
github.com/go-delve/delve/pkg/proc.(*Variable).loadValueInternal(0xc000e9c000, 0x0, {0x1, 0x1, 0x200, 0x40, 0xffffffffffffffff, 0x1900})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/variables.go:1325 +0xca8
github.com/go-delve/delve/pkg/proc.loadValues(...)
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/variables.go:1290
github.com/go-delve/delve/pkg/proc.(*EvalScope).FunctionArguments(0xc0003b20f0?, {0x1, 0x1, 0x200, 0x40, 0xffffffffffffffff, 0x1900})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/pkg/proc/eval.go:680 +0x1d1
github.com/go-delve/delve/service/debugger.(*Debugger).FunctionArguments(0x199?, 0x1?, 0x1?, 0x1c8?, {0x1, 0x1, 0x200, 0x40, 0xffffffffffffffff, 0x0})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/debugger/debugger.go:1669 +0x167
github.com/go-delve/delve/service/dap.(*Session).onScopesRequest(0xc0001badc0, 0xc000b75020)
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/dap/server.go:2215 +0x114
github.com/go-delve/delve/service/dap.(*Session).handleRequest(0xc0001badc0, {0xca93a0, 0xc000b75020})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/dap/server.go:759 +0x1165
github.com/go-delve/delve/service/dap.(*Session).ServeDAPCodec(0xc0001badc0)
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/dap/server.go:565 +0x32a
github.com/go-delve/delve/service/dap.(*Server).runSession(0xc0002134d0, {0x7fea96046c58?, 0xc000090960?})
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/dap/server.go:497 +0xcb
github.com/go-delve/delve/service/dap.(*Server).Run.func1()
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/dap/server.go:489 +0x2aa
created by github.com/go-delve/delve/service/dap.(*Server).Run in goroutine 1
	/home/firelizzard/go/pkg/mod/github.com/go-delve/delve@v1.23.1/service/dap/server.go:471 +0xa9
@aarzilli
Copy link
Member

The implementation for maps changed on go-tip and the commit to support the new implementation hasn't been merged yet.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants