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

debug: toggling breakpoints hangs suspends execution (see #1648) #2034

Closed
steveheyman opened this issue Jan 28, 2022 · 2 comments
Closed

debug: toggling breakpoints hangs suspends execution (see #1648) #2034

steveheyman opened this issue Jan 28, 2022 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@steveheyman
Copy link

steveheyman commented Jan 28, 2022

This is reopening issue #1648.

What did I do

Recreated the test case that @zzjin posted on September 17, 2021

What did I expect

Setting the breakpoint on line 10 would not cause execution to be suspended.

What did I see instead

The message "Execution halted to set breakpoints - please resume execution manually" appeared in the logs. The debugger was stopped and F5 was required to resume execution. Although @suzme said that this was fixed in VSCode 1.63.0, there may be a regression or another issue.

Output logs:

Starting: C:\Users\compuser\go\bin\dlv.exe dap --check-go-version=false --log=true --log-output=debugger,dap --listen=127.0.0.1:1074 from C:\Users\compuser\Documents\test\gosimplehttp
DAP server listening at: 127.0.0.1:1074
2022-01-27T19:45:30-08:00 debug layer=dap DAP server pid = 62856
2022-01-27T19:45:30-08:00 debug layer=dap [<- from client]{"seq":1,"type":"request","command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"go","locale":"en-us","linesStartAt1":true,"columnsStartAt1":true,"pathFormat":"path","supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"supportsMemoryReferences":true,"supportsProgressReporting":true,"supportsInvalidatedEvent":true}}
2022-01-27T19:45:30-08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":true,"supportsConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"supportsSetVariable":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":true,"supportsDelayedStackTraceLoading":true,"supportsClipboardContext":true}}
2022-01-27T19:45:30-08:00 debug layer=dap [<- from client]{"seq":2,"type":"request","command":"launch","arguments":{"name":"Debug","type":"go","request":"launch","mode":"debug","program":".","showLog":true,"logOutput":"debugger,dap","__configurationTarget":5,"packagePathToGoModPathMap":{"c:\\Users\\compuser\\Documents\\test\\gosimplehttp":"c:\\Users\\compuser\\Documents\\test\\gosimplehttp"},"debugAdapter":"dlv-dap","showRegisters":false,"showGlobalVariables":false,"substitutePath":[],"dlvFlags":[],"hideSystemGoroutines":false,"dlvToolPath":"C:\\Users\\compuser\\go\\bin\\dlv.exe","env":{"GOPATH":"C:\\Users\\compuser\\go"},"__buildDir":"C:\\Users\\compuser\\Documents\\test\\gosimplehttp","__sessionId":"7436fda7-6643-41dc-ab8d-576e1ba30ae6"}}
2022-01-27T19:45:30-08:00 debug layer=dap debug backend is 'default'
2022-01-27T19:45:30-08:00 debug layer=dap building program '.' in 'C:\Users\compuser\Documents\test\gosimplehttp' with flags ''
2022-01-27T19:45:31-08:00 debug layer=dap running binary 'C:\Users\compuser\Documents\test\gosimplehttp\__debug_bin.exe' in 'C:\Users\compuser\Documents\test\gosimplehttp'
2022-01-27T19:45:31-08:00 info layer=debugger launching process with args: [C:\Users\compuser\Documents\test\gosimplehttp\__debug_bin.exe]
2022-01-27T19:45:32-08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"initialized"}
2022-01-27T19:45:32-08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":2,"success":true,"command":"launch"}
2022-01-27T19:45:32-08:00 debug layer=dap [<- from client]{"seq":3,"type":"request","command":"setFunctionBreakpoints","arguments":{"breakpoints":[]}}
2022-01-27T19:45:32-08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
2022-01-27T19:45:32-08:00 debug layer=dap [<- from client]{"seq":4,"type":"request","command":"configurationDone","arguments":{}}
2022-01-27T19:45:32-08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":4,"success":true,"command":"configurationDone"}
2022-01-27T19:45:32-08:00 debug layer=debugger continuing
2022-01-27T19:45:32-08:00 debug layer=dap [<- from client]{"seq":5,"type":"request","command":"threads"}
2022-01-27T19:45:32-08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":5,"success":true,"command":"threads","body":{"threads":[{"id":-1,"name":"Current"}]}}
2022-01-27T19:45:34-08:00 debug layer=dap [<- from client]{"seq":6,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"main.go","path":"c:\\Users\\compuser\\Documents\\test\\gosimplehttp\\main.go"},"breakpoints":[{"line":10}],"lines":[10]}}
2022-01-27T19:45:34-08:00 debug layer=dap halting execution to set breakpoints
2022-01-27T19:45:34-08:00 debug layer=debugger halting
2022-01-27T19:45:34-08:00 debug layer=dap "continue" command stopped - reason "manual", location :0
2022-01-27T19:45:34-08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"stopped","body":{"reason":"pause","allThreadsStopped":true}}
2022-01-27T19:45:34-08:00 debug layer=dap [-> to client]{"seq":0,"type":"event","event":"output","body":{"category":"console","output":"Execution halted to set breakpoints - please resume execution manually\n","source":{}}}
Execution halted to set breakpoints - please resume execution manually
2022-01-27T19:45:34-08:00 info layer=debugger created breakpoint: &api.Breakpoint{ID:1, Name:"sourceBp Path=\"c:\\\\Users\\\\compuser\\\\Documents\\\\test\\\\gosimplehttp\\\\main.go\"  Line=10 Column=0", Addr:0x8d6605, Addrs:[]uint64{0x8d6605}, File:"C:/Users/compuser/Documents/test/gosimplehttp/main.go", Line:10, FunctionName:"main.main.func1", Cond:"", HitCond:"", Tracepoint:false, TraceReturn:false, Goroutine:false, Stacktrace:0, Variables:[]string(nil), LoadArgs:(*api.LoadConfig)(nil), LoadLocals:(*api.LoadConfig)(nil), WatchExpr:"", WatchType:0x0, VerboseDescr:[]string(nil), HitCount:map[string]uint64{}, TotalHitCount:0x0, Disabled:false}
2022-01-27T19:45:34-08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":6,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"source":{"name":"main.go","path":"c:\\Users\\compuser\\Documents\\test\\gosimplehttp\\main.go"},"line":10}]}}
2022-01-27T19:45:34-08:00 debug layer=dap [<- from client]{"seq":7,"type":"request","command":"threads"}
2022-01-27T19:45:34-08:00 debug layer=dap [-> to client]{"seq":0,"type":"response","request_seq":7,"success":true,"command":"threads","body":{"threads":[{"id":1,"name":"[Go 1] internal/poll.runtime_pollWait"},{"id":2,"name":"[Go 2] runtime.gopark"},{"id":18,"name":"[Go 18] runtime.gopark"},{"id":19,"name":"[Go 19] runtime.gopark"},{"id":20,"name":"[Go 20] runtime.gopark"}]}}

Version Information:

go version go1.17.6 windows/amd64

go extension version:
Name: Go
Id: golang.go
Description: Rich Go language support for Visual Studio Code
Version: 0.31.0
Publisher: Go Team at Google
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=golang.Go

code -v
1.63.2
899d46d82c4c95423fb7e10e68eba52050e30ba3
x64

gopls -v version

Build info
----------
golang.org/x/tools/gopls v0.7.5
    golang.org/x/tools/gopls@v0.7.5 h1:8Az52YwcFXTWPvrRomns1C0N+zlgTyyPKWvRazO9GG8=
    github.com/BurntSushi/toml@v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
    github.com/google/go-cmp@v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
    golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
    golang.org/x/sys@v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
    golang.org/x/text@v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
    golang.org/x/tools@v0.1.9-0.20220114220130-fd7798718afd h1:lTnuArxJC+n54TyvWUPyHhrnGxYvhSi13/aM2Ndr4bs=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.2.1 h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY=
    mvdan.cc/gofumpt@v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA=
    mvdan.cc/xurls/v2@v2.3.0 h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I=

dlv-dap version -v

Delve Debugger
Version: 1.7.2
Build: $Id: a06f0b8c273325e2160bfd35972c12eda410077c $
Build Details: go1.17.3
 mod    github.com/go-delve/delve       v1.7.3-0.20211109082426-9013a121d8bc    h1:W/nYlpoFw1KtHtNzPnZ6N8OoVm8734cWSwhMnXGrc/4=
 dep    github.com/cilium/ebpf  v0.7.0  h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k=
 dep    github.com/cosiner/argv v0.1.0  h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg=
 dep    github.com/cpuguy83/go-md2man/v2        v2.0.0  h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
 dep    github.com/derekparker/trie     v0.0.0-20200317170641-1fdf38b7b0e9      h1:G765iDCq7bP5opdrPkXk+4V3yfkgV9iGFuheWZ/X/zY=
 dep    github.com/google/go-dap        v0.6.0  h1:Y1RHGUtv3R8y6sXq2dtGRMYrFB2hSqyFVws7jucrzX4=
 dep    github.com/hashicorp/golang-lru v0.5.4  h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
 dep    github.com/inconshreveable/mousetrap    v1.0.0  h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
 dep    github.com/konsorten/go-windows-terminal-sequences      v1.0.3  h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
 dep    github.com/mattn/go-colorable   v0.0.9  h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
 dep    github.com/mattn/go-isatty      v0.0.3  h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
 dep    github.com/mattn/go-runewidth   v0.0.3  h1:a+kO+98RDGEfo6asOGMmpodZq4FNtnGP54yps8BzLR4=
 dep    github.com/peterh/liner v1.2.1  h1:O4BlKaq/LWu6VRWmol4ByWfzx6MfXc5Op5HETyIy5yg=
 dep    github.com/russross/blackfriday/v2      v2.0.1  h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
 dep    github.com/shurcooL/sanitized_anchor_name       v1.0.0  h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
 dep    github.com/sirupsen/logrus      v1.6.0  h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
 dep    github.com/spf13/cobra  v1.1.3  h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
 dep    github.com/spf13/pflag  v1.0.5  h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
 dep    go.starlark.net v0.0.0-20200821142938-949cc6f4b097      h1:YiRMXXgG+Pg26t1fjq+iAjaauKWMC9cmGFrtOEuwDDg=
 dep    golang.org/x/arch       v0.0.0-20190927153633-4e8777c89be4      h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI=
 dep    golang.org/x/sys        v0.0.0-20211019181941-9d821ace8654      h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
 dep    gopkg.in/yaml.v2        v2.4.0  h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

Originally posted by @steveheyman in #1648 (comment)

@gopherbot gopherbot added this to the Untriaged milestone Jan 28, 2022
@hyangah
Copy link
Contributor

hyangah commented Jan 28, 2022

@steveheyman What is the version of dlv? (the extension doesn't use dlv-dap any more, so feel free to delete it)

According to delve's change log, the fix was added to delve 1.7.3 so 1.7.3 or newer version is needed. The latest is 1.8.0.

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 28, 2022
@steveheyman
Copy link
Author

Thanks for the quick response. I was running 1.7.2. Upgrading to 1.8.0 fixed the issue. Sorry for the false alarm.

@golang golang locked and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants