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

Command failed: protocol error E09 during set breakpoint for packet #1116

Closed
alphaaleph opened this issue Feb 5, 2018 · 14 comments
Closed

Comments

@alphaaleph
Copy link

Please answer the following before submitting your issue:

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

  1. What version of Delve are you using (dlv version)?
  2. What version of Go are you using? (go version)?
  3. What operating system and processor architecture are you using?
  4. What did you do?
  5. What did you expect to see?
  6. What did you see instead?

ANSWERS:

  1. dlv Version: 1.0.0-rc.2
  2. go version go1.9.3 darwin/amd64
  3. Mac OSX Sierra 10.12.6
  4. Run debugger against go project, and enter:
    b main.go:8 (line 8 exists)
  5. Not an error when I hit enter. :-)
  6. An error: protocol error E09

Other info: This happens in the work Mac. I have my home Mac running the same setup as above, and it works in that machine. So I was thinking, permission problem with the work Mac? But I also have a setup running in Archlinux in my Parallels Desktop, inside my work Mac; and that version runs!!??

The Parallels VM info is:

  1. dlv Version: 1.0.0-rc.1
  2. go version go1.8.5 linux/amd64
  3. 4.7.4.1-ARCH

So it works in home Mac, and it works in work Mac running Linux VM; but it doesn't work in work Mac..!!?? Any ideas? I'll try to trace the delve code when I have a chance.

@aarzilli
Copy link
Member

aarzilli commented Feb 6, 2018

So I was thinking, permission problem with the work Mac?

That's likely, debugservice can not set software breakpoints.

@hankjacobs
Copy link

For what its worth, I had the same issue and determined it was due to Cylance (an antivirus / malware / security app). Whitelisting /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver did the trick.

@aarzilli
Copy link
Member

Closing, likely not (our) bug.

@jessesuen
Copy link

Thank you @hankjacobs! This was infuriating.

@shlomi-dr
Copy link

shlomi-dr commented Jul 3, 2021

For what its worth, I had the same issue and determined it was due to Cylance (an antivirus / malware / security app). Whitelisting /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver did the trick.

I am experiencing the same problem, but I can't find anything to whitelist this in (no Cylance or other things that I know of, and the laptop is fresh out of the store, so no corporate stuff). Googling this problem returns literally only this page, so I thought I might as well ask for help here.

Screen Shot 2021-07-02 at 5 23 58 PM

Here are the versions I have installed, and the error I am seeing:

> go version
go version go1.16.5 darwin/amd64
> dlv version
Delve Debugger
Version: 1.6.1
Build: $Id: 114218c22f3791287c4bc2f4ff35a846a1416ee9 $
> sw_vers
ProductName:    macOS
ProductVersion: 11.4
BuildVersion:   20F71
> dlv debug cmd/main.go
Type 'help' for list of commands.
(dlv) b main.main
Command failed: protocol error E09 during set breakpoint for packet $Z0,7ffd012df4fb,4

Perhaps you could help me root cause this? Or maybe point me someplace I can get help?

Thanks!

Found solution

It seems that on M1 mac laptops, we need to install the ARM version of go and not the AMD version:

  1. Go to https://golang.org/dl/
  2. Look for the installer for MacOS that is on ARMv8 architecture, eg. go1.16.6.darwin-arm64.pkg
  3. Download and install
  4. Make sure the rest of the go-tools are setup (vscode does this automatically)

Now, lets try again:

> go version
go version go1.16.6 darwin/arm64
> dlv version
Delve Debugger
Version: 1.6.1
Build: $Id: 114218c22f3791287c4bc2f4ff35a846a1416ee9 $
> sw_vers
ProductName:	macOS
ProductVersion:	11.4
BuildVersion:	20F71
> dlv debug cmd/main.go
Type 'help' for list of commands.
(dlv) b main.main
Breakpoint 1 (enabled) set at 0x102cf67e0 for main.main() ./cmd/main.go:23
(dlv) c
> main.main() ./cmd/main.go:23 (hits goroutine(1):1 total:1) (PC: 0x102cf67e0)
    18:			fmt.Printf("Usage: %s %s\n", os.Args[0], strings.Join(arg, " "))
    19:			os.Exit(1)
    20:		}
    21:	}
    22:
=>  23:	func main() {
    24:		println("Test module")
    25:		checkArgs("<arg1>", "<arg2>")
    26:
    27:		logger := logger.NewLogger()
    28:		config, err := config.ReadConfig(logger)
(dlv)

Success! 🥳

@steve7688
Copy link

steve7688 commented Mar 18, 2022

Hey guys I am using go version go1.18 darwin/arm64 but still get an error

 protocol error E09 during set breakpoint for packet $Z0,7ff701704851,4

when I set a breakpoint

I just use goland

@muzig
Copy link

muzig commented Apr 6, 2022

export GOOS=darwin
export GOARCH=arm64

then restart goland,maybe useful

@yongliu1992
Copy link

export GOOS=darwin export GOARCH=arm64

thanks,useful

@josiahcoad
Copy link

josiahcoad commented Oct 27, 2022

Hey still not working for me on M1 Mac with Vscode. Spent hours on this already.

I am able to get dlv working from command line. ie, if i type dlv debug main.go, a dlv interpreter appears that I can successfully set breakpoints and step through code. The problem comes when I try to set breakpoint in VSCode, the breakpoint goes gray with error message protocol error E09 during set breakpoint for packet $Z0,7ff800d20a09,4. The program runs normally.

Screen Shot 2022-10-27 at 1 50 16 PM

>>> which dlv
dlv: aliased to /Users/jcoad/go/bin/dlv
>>> dlv version
Delve Debugger
Version: 1.9.1
Build: $Id: d81b9fd12bfa603f3cf7a4bc842398bd61c42940
>>> echo $GOOS $GOARCH
darwin arm64
>>> go version
go version go1.19.2 darwin/arm64

@derekparker
Copy link
Member

@hyangah @suzmue @polinasok

@thanhdatvo
Copy link

thanhdatvo commented Nov 7, 2022

I had same problem.
The problem may be because I installed go using both brew and .pkg file
I fixed it by removing usr/local/go then I restarted the vscode
The go debugger's breakpoints work again

@groggy7
Copy link

groggy7 commented Jan 11, 2024

I had same problem and i figured out it was because i mistakenly installed x86 version of Go while updating.

@danielshmbg
Copy link

Try adding additional config in launch.json, somehow it’s working just fine on my laptop.

 "configurations": [
  {
    ...
    "logOutput": "dap",
    "showLog": false
  }
 ]

@raz-cohen
Copy link

For what its worth, I had the same issue and determined it was due to Cylance (an antivirus / malware / security app). Whitelisting /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver did the trick.

I am experiencing the same problem, but I can't find anything to whitelist this in (no Cylance or other things that I know of, and the laptop is fresh out of the store, so no corporate stuff). Googling this problem returns literally only this page, so I thought I might as well ask for help here.

Screen Shot 2021-07-02 at 5 23 58 PM

Here are the versions I have installed, and the error I am seeing:

> go version
go version go1.16.5 darwin/amd64
> dlv version
Delve Debugger
Version: 1.6.1
Build: $Id: 114218c22f3791287c4bc2f4ff35a846a1416ee9 $
> sw_vers
ProductName:    macOS
ProductVersion: 11.4
BuildVersion:   20F71
> dlv debug cmd/main.go
Type 'help' for list of commands.
(dlv) b main.main
Command failed: protocol error E09 during set breakpoint for packet $Z0,7ffd012df4fb,4

Perhaps you could help me root cause this? Or maybe point me someplace I can get help?

Thanks!

Found solution

It seems that on M1 mac laptops, we need to install the ARM version of go and not the AMD version:

  1. Go to https://golang.org/dl/
  2. Look for the installer for MacOS that is on ARMv8 architecture, eg. go1.16.6.darwin-arm64.pkg
  3. Download and install
  4. Make sure the rest of the go-tools are setup (vscode does this automatically)

Now, lets try again:

> go version
go version go1.16.6 darwin/arm64
> dlv version
Delve Debugger
Version: 1.6.1
Build: $Id: 114218c22f3791287c4bc2f4ff35a846a1416ee9 $
> sw_vers
ProductName:	macOS
ProductVersion:	11.4
BuildVersion:	20F71
> dlv debug cmd/main.go
Type 'help' for list of commands.
(dlv) b main.main
Breakpoint 1 (enabled) set at 0x102cf67e0 for main.main() ./cmd/main.go:23
(dlv) c
> main.main() ./cmd/main.go:23 (hits goroutine(1):1 total:1) (PC: 0x102cf67e0)
    18:			fmt.Printf("Usage: %s %s\n", os.Args[0], strings.Join(arg, " "))
    19:			os.Exit(1)
    20:		}
    21:	}
    22:
=>  23:	func main() {
    24:		println("Test module")
    25:		checkArgs("<arg1>", "<arg2>")
    26:
    27:		logger := logger.NewLogger()
    28:		config, err := config.ReadConfig(logger)
(dlv)

Success! 🥳

Goshhh, you just helped me.
Tnx!
For anyone who's encountering this issue, I highly suggest to first try and match the correct Go 'version' (arm\amd etc...)

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

No branches or pull requests