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 golang cannot close with button unless kill it(__debug_bin) with cmd #1536

Closed
enjoycx opened this issue Jun 2, 2021 · 6 comments
Closed
Labels
debug/legacy legacy debug adapter related issues - new issues won't be fixed Debug Issues related to the debugging functionality of the extension. FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@enjoycx
Copy link

enjoycx commented Jun 2, 2021

No description provided.

@gopherbot gopherbot added this to the Untriaged milestone Jun 2, 2021
@polinasok polinasok changed the title debug golang cannot close with button unless kill it(__dubug_bin) with cmd debug golang cannot close with button unless kill it(__debug_bin) with cmd Jun 2, 2021
@polinasok
Copy link
Contributor

polinasok commented Jun 2, 2021

@enjoycx Could you please include additional details in your report to help us diagnose the issue: such as your launch.json configuration, anything that got logged into the Debug Console (you can get additional information there with "trace":"log", "showLog":true, "logOutput":"rpc,debugger,dap") and steps to reproduce the problem and any screenshots that might help us understand what happened. If you are using the new dlv-dap adapter, please see Reporting Issues.

In general there could be circumstances where the debugger might get unresponsive, so the stop operation from the editor could timeout before the debugger/adapter shut things down gracefully and acknowledge the request. We try to catch such cases and forcefully kill delve. In the legacy adapter vs dlv-dap adapter it is done with different signals. The legacy adapter would leave the debuggee running when killed from the extension while the dlv-dap adapter should be able to shut things down correctly. So please do let us know which one you are using. And also if delve itself is still running when you close the debug session.

@polinasok polinasok added Debug Issues related to the debugging functionality of the extension. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jun 2, 2021
@enjoycx
Copy link
Author

enjoycx commented Jun 3, 2021

the project remote run in docker

launch.json

{
"version": "0.2.0",
"configurations": [
{
"name": "webservices",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/main.go",
"cwd": "..",
"env": {
},
"args": [],
"showLog": true,
}
]
}

** first logs:**

Verbose logs are written to:
/tmp/vscode-go-debug.txt
InitializeRequest
InitializeResponse
LaunchRequest
Using GOPATH: /go
Using GOROOT: /usr/local/go
Using PATH: /vscode/vscode-server/bin/x64/054a9295330880ed74ceaedda236253b4f39a335/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/workspaces/tool
Current working directory: /workspaces/server
Running: /go/bin/dlv debug /workspaces/server/main.go --headless=true --listen=127.0.0.1:10241 --api-version=2 --log=true --log-output=rpc,debug,dap --wd=..
Warning: unknown log output value "debug", run 'dlv help log' for usage.
2021-06-03T03:07:02Z debug layer=rpc API server pid = 66422
API server listening at: 127.0.0.1:10241
InitializeEvent
SetBreakPointsRequest
SetBreakPointsRequest
SetBreakPointsRequest
SetBreakPointsRequest
SetBreakPointsRequest
2021-06-03T03:07:02Z debug layer=rpc <- RPCServer.GetVersion(api.GetVersionIn{})
2021-06-03T03:07:02Z debug layer=rpc -> *api.GetVersionOut{"DelveVersion":"Version: 1.6.0\nBuild: $Id: 8cc9751909843dd55a46e8ea2a561544f70db34d $","APIVersion":2,"Backend":"native","TargetGoVersion":"Go cmd/compile go1.14.4","MinSupportedVersionOfGo":"1.13.0","MaxSupportedVersionOfGo":"1.16.0"} error: ""
2021-06-03T03:07:02Z debug layer=rpc (async 2) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:07:02Z debug layer=rpc (async 3) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:07:02Z debug layer=rpc (async 4) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:07:02Z debug layer=rpc (async 5) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:07:02Z debug layer=rpc (async 6) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:07:02Z debug layer=rpc (async 6) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:07:02Z debug layer=rpc (async 4) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:07:02Z debug layer=rpc (async 2) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
All cleared
Creating on: /workspaces/controller/shop/store_utils.go:135
All cleared
Creating on: /workspaces/model/user/user_model/special_offer.go:473
All cleared
Creating on: /workspaces/chatserver/chat/chat.go:64
All cleared
Creating on: /workspaces/controller/event/event.go:85
All cleared
Creating on: /workspaces/roomserver/roomproxy/room_test.go:47
2021-06-03T03:07:02Z debug layer=rpc (async 5) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:07:02Z debug layer=rpc (async 3) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:07:02Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/controller/shop/store_utils.go","line":135,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:07:02Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":1,"name":"","addr":20391194,"addrs":[20391194],"file":"/workspaces/controller/shop/store_utils.go","line":135,"functionName":"webservices/controller/shop.PurchaseKeyAddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}} error: ""
2021-06-03T03:07:02Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/model/user/user_model/special_offer.go","line":473,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
Error on CreateBreakpoint: could not find statement at /workspaces/model/user/user_model/special_offer.go:473, please use a line with a statement
Error on CreateBreakpoint: could not find file /workspaces/chatserver/chat/chat.go
All set:[{"Breakpoint":{"id":1,"name":"","addr":20391194,"addrs":[20391194],"file":"/workspaces/controller/shop/store_utils.go","line":135,"functionName":"webservices/controller/shop.PurchaseKeyAddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}}]
SetBreakPointsResponse
All set:[null]
All set:[null]
SetBreakPointsResponse
SetBreakPointsResponse
2021-06-03T03:07:02Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"","line":0,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":null,"totalHitCount":0}} error: "could not find statement at /workspaces/model/user/user_model/special_offer.go:473, please use a line with a statement"
2021-06-03T03:07:02Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/chatserver/chat/chat.go","line":64,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:07:02Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"","line":0,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":null,"totalHitCount":0}} error: "could not find file /workspaces/chatserver/chat/chat.go"
2021-06-03T03:07:02Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/controller/event/event.go","line":85,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:07:02Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":2,"name":"","addr":22317567,"addrs":[22317567],"file":"/workspaces/controller/event/event.go","line":85,"functionName":"webservices/controller/event.AddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}} error: ""
2021-06-03T03:07:02Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/roomserver/roomproxy/room_test.go","line":47,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:07:02Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"","line":0,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":null,"totalHitCount":0}} error: "could not find file /workspaces/roomserver/roomproxy/room_test.go"
Error on CreateBreakpoint: could not find file /workspaces/roomserver/roomproxy/room_test.go
All set:[{"Breakpoint":{"id":2,"name":"","addr":22317567,"addrs":[22317567],"file":"/workspaces/controller/event/event.go","line":85,"functionName":"webservices/controller/event.AddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}}]
SetBreakPointsResponse
All set:[null]
SetBreakPointsResponse
ConfigurationDoneRequest
2021-06-03T03:07:02Z debug layer=rpc (async 12) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:07:02Z debug layer=rpc (async 12) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":66529,"pc":139917692398624,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
Changing DebugState from Halted to Running
ConfigurationDoneResponse {"seq":67,"type":"response","request_seq":8,"command":"configurationDone","success":true}
2021-06-03T03:07:02Z debug layer=rpc (async 13) <- RPCServer.Command(api.DebuggerCommand{"name":"continue","ReturnInfoLoadConfig":null})
2021-06-03T03:07:02Z debug layer=rpc (async 14) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:07:02Z debug layer=rpc (async 14) -> rpc2.StateOut{"State":{"Running":true,"Recording":false,"Threads":null,"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""

[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

using env: export GIN_MODE=release
using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] Listening and serving HTTP on :2619
DisconnectRequest
Closing Delve.
HaltRequest
2021-06-03T03:07:32Z debug layer=rpc (async 15) <- RPCServer.Command(api.DebuggerCommand{"name":"halt","ReturnInfoLoadConfig":null})

second start logs:

Verbose logs are written to:
/tmp/vscode-go-debug.txt
InitializeRequest
InitializeResponse
LaunchRequest
Using GOPATH: /go
Using GOROOT: /usr/local/go
Using PATH: /vscode/vscode-server/bin/x64/054a9295330880ed74ceaedda236253b4f39a335/bin:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/workspaces/tool
Current working directory: /workspaces/server
Running: /go/bin/dlv debug /workspaces/server/main.go --headless=true --listen=127.0.0.1:19817 --api-version=2 --log=true --log-output=rpc,debug,dap --wd=..
Warning: unknown log output value "debug", run 'dlv help log' for usage.
2021-06-03T03:15:39Z debug layer=rpc API server pid = 67772
API server listening at: 127.0.0.1:19817
InitializeEvent
SetBreakPointsRequest
SetBreakPointsRequest
SetBreakPointsRequest
SetBreakPointsRequest
SetBreakPointsRequest
2021-06-03T03:15:40Z debug layer=rpc <- RPCServer.GetVersion(api.GetVersionIn{})
2021-06-03T03:15:40Z debug layer=rpc -> *api.GetVersionOut{"DelveVersion":"Version: 1.6.0\nBuild: $Id: 8cc9751909843dd55a46e8ea2a561544f70db34d $","APIVersion":2,"Backend":"native","TargetGoVersion":"Go cmd/compile go1.14.4","MinSupportedVersionOfGo":"1.13.0","MaxSupportedVersionOfGo":"1.16.0"} error: ""
2021-06-03T03:15:40Z debug layer=rpc (async 2) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:15:40Z debug layer=rpc (async 3) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:15:40Z debug layer=rpc (async 4) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:15:40Z debug layer=rpc (async 5) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:15:40Z debug layer=rpc (async 6) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:15:40Z debug layer=rpc (async 4) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:15:40Z debug layer=rpc (async 3) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:15:40Z debug layer=rpc (async 6) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
Debuggee is not running. Setting breakpoints without halting.
All cleared
Creating on: /workspaces/model/user/user_model/special_offer.go:473
All cleared
Creating on: /workspaces/roomserver/roomproxy/room_test.go:47
All cleared
Creating on: /workspaces/controller/shop/store_utils.go:135
All cleared
Creating on: /workspaces/chatserver/chat/chat.go:64
All cleared
Creating on: /workspaces/controller/event/event.go:85
2021-06-03T03:15:40Z debug layer=rpc (async 2) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:15:40Z debug layer=rpc (async 5) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
2021-06-03T03:15:40Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/model/user/user_model/special_offer.go","line":473,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:15:40Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"","line":0,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":null,"totalHitCount":0}} error: "could not find statement at /workspaces/model/user/user_model/special_offer.go:473, please use a line with a statement"
Error on CreateBreakpoint: could not find statement at /workspaces/model/user/user_model/special_offer.go:473, please use a line with a statement
Error on CreateBreakpoint: could not find file /workspaces/roomserver/roomproxy/room_test.go
All set:[null]
All set:[null]
SetBreakPointsResponse
SetBreakPointsResponse
2021-06-03T03:15:40Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/roomserver/roomproxy/room_test.go","line":47,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:15:40Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"","line":0,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":null,"totalHitCount":0}} error: "could not find file /workspaces/roomserver/roomproxy/room_test.go"
2021-06-03T03:15:40Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/controller/shop/store_utils.go","line":135,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:15:40Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":1,"name":"","addr":20391194,"addrs":[20391194],"file":"/workspaces/controller/shop/store_utils.go","line":135,"functionName":"webservices/controller/shop.PurchaseKeyAddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}} error: ""
2021-06-03T03:15:40Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/chatserver/chat/chat.go","line":64,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
2021-06-03T03:15:40Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"","line":0,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":null,"totalHitCount":0}} error: "could not find file /workspaces/chatserver/chat/chat.go"
2021-06-03T03:15:40Z debug layer=rpc <- RPCServer.CreateBreakpoint(rpc2.CreateBreakpointIn{"Breakpoint":{"id":0,"name":"","addr":0,"addrs":null,"file":"/workspaces/controller/event/event.go","line":85,"Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":null,"totalHitCount":0}})
Error on CreateBreakpoint: could not find file /workspaces/chatserver/chat/chat.go
All set:[{"Breakpoint":{"id":1,"name":"","addr":20391194,"addrs":[20391194],"file":"/workspaces/controller/shop/store_utils.go","line":135,"functionName":"webservices/controller/shop.PurchaseKeyAddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}}]
All set:[{"Breakpoint":{"id":2,"name":"","addr":22317567,"addrs":[22317567],"file":"/workspaces/controller/event/event.go","line":85,"functionName":"webservices/controller/event.AddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}}]
SetBreakPointsResponse
SetBreakPointsResponse
All set:[null]
SetBreakPointsResponse
2021-06-03T03:15:40Z debug layer=rpc -> *rpc2.CreateBreakpointOut{"Breakpoint":{"id":2,"name":"","addr":22317567,"addrs":[22317567],"file":"/workspaces/controller/event/event.go","line":85,"functionName":"webservices/controller/event.AddReward","Cond":"","continue":false,"traceReturn":false,"goroutine":false,"stacktrace":0,"LoadArgs":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"LoadLocals":{"FollowPointers":true,"MaxVariableRecurse":1,"MaxStringLen":64,"MaxArrayValues":64,"MaxStructFields":-1},"hitCount":{},"totalHitCount":0}} error: ""
ConfigurationDoneRequest
2021-06-03T03:15:40Z debug layer=rpc (async 12) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:15:40Z debug layer=rpc (async 12) -> rpc2.StateOut{"State":{"Running":false,"Recording":false,"currentThread":{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":67908,"pc":140630292585504,"file":"","line":0,"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
Changing DebugState from Halted to Running
ConfigurationDoneResponse {"seq":66,"type":"response","request_seq":8,"command":"configurationDone","success":true}
2021-06-03T03:15:40Z debug layer=rpc (async 13) <- RPCServer.Command(api.DebuggerCommand{"name":"continue","ReturnInfoLoadConfig":null})
time="2021-06-03T03:15:40Z" level=info msg="sentry OK" sentryDSN=
2021-06-03T03:15:40Z debug layer=rpc (async 14) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2021-06-03T03:15:40Z debug layer=rpc (async 14) -> rpc2.StateOut{"State":{"Running":true,"Recording":false,"Threads":null,"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}} error: ""
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

using env: export GIN_MODE=release
using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] Listening and serving HTTP on :2619
[GIN-debug] [ERROR] listen tcp :2619: bind: address already in use
2021-06-03T03:15:41Z debug layer=rpc (async 13) -> rpc2.CommandOut{"State":{"Running":false,"Recording":false,"Threads":null,"NextInProgress":false,"exited":true,"exitStatus":0,"When":""}} error: ""
continue state {"Running":false,"Recording":false,"Threads":null,"NextInProgress":false,"exited":true,"exitStatus":0,"When":""}
handleReenterDebug(breakpoint).
TerminatedEvent
DisconnectRequest
Closing Delve.
HaltRequest
2021-06-03T03:15:42Z debug layer=rpc (async 15) <- RPCServer.Command(api.DebuggerCommand{"name":"halt","ReturnInfoLoadConfig":null})
2021-06-03T03:15:42Z debug layer=rpc (async 15) -> null error: "Process 67908 has exited with status 0"
HaltResponse
Failed to halt - Process 67908 has exited with status 0
DetachRequest
2021-06-03T03:15:42Z debug layer=rpc <- RPCServer.Detach(rpc2.DetachIn{"Kill":true})
2021-06-03T03:15:42Z debug layer=rpc -> *rpc2.DetachOut{} error: ""
DisconnectRequest to parent to shut down protocol server.
DisconnectResponse
Process exiting with code: 0
Sending TerminatedEvent as delve is closed

@polinasok
Copy link
Contributor

polinasok commented Jun 8, 2021

@enjoycx Thank you for additional information.
Do I understand correctly that the 1st log represents the issue while the 2nd log represents clean shutdown?
The first log looks oddly truncated. A halt request is sent to the debugger. The debugger is responsive as we see that the request was received, but then nothing.

Looks like I provided the wrong flag earlier to enable all the logging. It should be "debugger", not "debug" -"logOutput":"rpc,debugger,dap".

Is this easily reproduced? Does this happen often? Is dlv still running when the session is over?
Have you tried using the new dlv-dap adapter as described here to see if it does better?

@enjoycx
Copy link
Author

enjoycx commented Jun 9, 2021

The first log is the log printed by the shutdown program, and the second one is the log printed by the startup program. Because it was not closed when it was closed, it couldn't get up the second time

I guess it's the reason why I run in docker remotely, or the reason why many breakpoints in my program haven't been deleted

I can't turn it off almost every time now. I need to use CMD kill

@polinasok
Copy link
Contributor

polinasok commented Jun 9, 2021

@enjoycx It sounds like your experience is rather frustrating. And I am sorry about that. I sincerely do want to help, but sadly from your description, I do not fully understand what exactly you do and where things go wrong.

Ideally, we look for a simple reproducible local test case to debug and diagnose problems. When that is not possible, a list of the exact steps that you follow in addition to the log would be quite helpful as well.

I am not sure what you mean by "shutdown program" and "start-up program". It looks to me that you first launch a debug session that launches your http server on port 2619. Then you end the session and start a new one, which tries to start up the same http server on the same port 2619. Except the port is still in use, so the target and the session terminate. Is that correct?

Additional information that would help:

  • Do you use Stop (which is meant to kill the target process) or Disconnect (which is meant to leave the target running)?
    image
  • Do you see the dlv debugger in your process list still running after the debug session is over? (in case you have more than one, it's process id is logged - e.g. 2021-06-03T03:15:39Z debug layer=rpc API server pid = 67772
  • Do you see your __debug_bin process still running in the process list after the debug session is over?
  • Do you by any chance start a new session very quickly before things had time to shut down and clean up? For example, it can take a moment for the OS to free the port even after a server is stopped.
  • Does this work with dlv cli? (using `dlv debug /workspaces/server/main.go --log=true --log-output=rpc,debugger --wd=..)? (This would help us determine if the problem is in dlv or in vscode-go).
  • Does this work with dlv-dap? If not, please share the log with "logOutput":"rpc,debugger,dap". We are moving away from the legacy debug adapter that you are currently using to this one in the near future and do not plan to make fixes in the legacy adapter. The new adapter should handle shutdown better and have improved logging to help us diagnose any problems (some of it might end up under OUTPUT > Go Debug and not DEBUG CONSOLE).

@hyangah hyangah added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jun 10, 2021
@gopherbot
Copy link
Collaborator

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@polinasok polinasok added the debug/legacy legacy debug adapter related issues - new issues won't be fixed label Jul 16, 2021
@golang golang locked and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug/legacy legacy debug adapter related issues - new issues won't be fixed Debug Issues related to the debugging functionality of the extension. 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

4 participants