go-delve / delve

Delve is a debugger for the Go programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"recovered panic ... " strictly when debugging after unmarshaling proto struct pb

kishenpateldotwork opened this issue · comments

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output,
stacktraces, etc) as linked gists.

If this is about source listing not showing up (or breakpoints not being
accepted) while running in a container please read our
FAQ
first.

  1. What version of Delve are you using (dlv version)?
    Delve Debugger
    Version: 1.22.1

  2. What version of Go are you using? (go version)?
    go version go1.22.0 darwin/arm64

  3. What operating system and processor architecture are you using?
    macOS Sonoma 14.0 Apple M1 Pro 16GB

  4. What did you do?
    Simply debugging code. Works fine normally except debugger seems to immediately choke on any breakpoint after:

	bytes, _ := protojson.Marshal(tempStpb)
	err = json.Unmarshal(bytes, &data)
  1. What did you expect to see?
    No panic with the locals populated and be able to continue stepping through

  2. What did you see instead?
    Please see attached pictures:

I have also included a go playground: https://go.dev/play/p/yRLKh1G9Hot
If you set a breakpoint on line 26 and another after it on line 29, you should see the debugger works as expected on the first one but as soon as it gets past that line any breakpoint like on line 29 causes debugger to panic.. I am certain it is not code related because if i do not place breakpoints then the code executes perfectly fine (in fact if you just set one breakpoint on line 37 then you will even see the fmt.Println outputs the correct data but the debugger still panic)

image
image

You have some watch expression being evaluated that is causing this, what is it? If you try to replicate this using the command line interface you'll see that it doesn't happen.

Hi @aarzilli you are right, I have not been able to reproduce it after my watch items were cleared.. if I run into this again I'll be sure to add more information to this ticket!

That's unfortunate that you cleared your watches. I'll close this one you can reopen a new one if you figure out what's causing, it is a legitimate bug.