Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Debugger exits unexpectedly after continue #49

Closed
karthiknadig opened this issue Feb 8, 2018 · 9 comments
Closed

Debugger exits unexpectedly after continue #49

karthiknadig opened this issue Feb 8, 2018 · 9 comments

Comments

@karthiknadig
Copy link
Member

1> [DebugAdapter] --> C (continue-10): {"command":"continue","arguments":{"threadId":1},"seq":10,"type":"request"}
1> [DebugAdapter] <--   R (continue-10): {"type": "response", "seq": 14, "request_seq": 10, "success": true, "command": "continue", "message": "", "body": {}}
1> ERROR: The debug adapter exited unexpectedly.

This seems to occur after hitting last breakpoint (continue to end scenario). From the log it appears no exited event is generated.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Feb 12, 2018

Works for me (in vscode). can you provide a sample code with instructions.
BTW, I'm waiting for terminated event.

@huguesv huguesv added this to the Preview 1 milestone Feb 15, 2018
@huguesv
Copy link
Contributor

huguesv commented Feb 16, 2018

Repros for me in Visual Studio. I get a message box.

@karthiknadig
Copy link
Member Author

This seems to be specific to VS. The debug adapter logs stop after receiving the continue response. ptvsd continues to send messages including exited and terminated events. But the debug adapter host claims the adapter exited unexpectedly

 1> [DebugAdapter] --> C (continue-11): {"command":"continue","arguments":{"threadId":1},"seq":11,"type":"request"}
 1> [DebugAdapter] <--   R (continue-11): {"type": "response", "seq": 14, "request_seq": 11, "success": true, "command": "continue", "message": "", "body": {}}
 1> ERROR: Debug adapter error output: Received command: CMD_GET_FRAME 114	1000000010	pid_25708_id_1610141740056	1610155521768	FRAME
 1> ERROR: Debug adapter error output: ('processing internal command ', '<_pydevd_bundle.pydevd_comm.InternalGetFrame object at 0x00000176E4EE25F8>')
 1> ERROR: Debug adapter error output: sending cmd -->        CMD_GET_FRAME 114	1000000010	<xml><var name="__builtins__" type="dict" qualifier="builtins" value="{'ArithmeticError': <class 'ArithmeticError'&gt;, 'AssertionError': <class 'AssertionError'&gt;, 'AttributeError': <class 'AttributeError'&gt;, 'BaseException': <class 'BaseException'&gt;, 'BlockingIOError': <class 'BlockingIOError'&gt;, 'BrokenPipeError': <class 'BrokenPipeError'&gt;, 'BufferError': <class 'BufferError'&gt;, 'BytesWarning': <class 'BytesWarning'&gt;, 'ChildProcessError': <class 'ChildProcessError'&gt;, 'ConnectionAbortedError': <class 'ConnectionAb...tedError'&gt;, 'ConnectionError': <class 'ConnectionError'&gt;, 'ConnectionRefusedError': <class 'ConnectionRe...sedError'&gt;, 'ConnectionResetError': <class 'ConnectionResetError'&gt;, 'DeprecationWarning': <class 'DeprecationWarning'&gt;, ...}" isContainer="True" /> <var name="__doc__" type="NoneType" qualifier="builtins" value="None" /> <var name="__file__" type="str" qualifier="builtins" value="'C:\\Users\\kanadig\\Source\\Repos\\PyScratch\\Scratch\\Scratch.py'" /> <var name="__loader__" type="SourceFileLoader" qualifier="_frozen_importlib_external" value="<_frozen_importlib_external.SourceFileLoader object at 0x00000176E3E214E0&gt;" isContainer="True" /> <var name="__name__" type="str" qualifier="builtins" value="'__main__'" /> <var name="__package__" type="NoneType" qualifier="builtins" value="None" /> <var name="__spec__" type="NoneType" qualifier="builtins" value="None" /> <var name="_pydev_stop_at_break" type="function" qualifier="builtins" value="<function _pydev_stop_at_break at 0x00000176E4CDD048&gt;" isContainer="True" /> </xml> 
 1> ERROR: Debug adapter error output: headers: b'Content-Length: 1567\r\n\r\n'
 1> ERROR: The debug adapter exited unexpectedly.
 1> ERROR: Debug adapter error output: content: b'{"type": "response", "seq": 13, "request_seq": 10, "success": true, "command": "variables", "message": "", "body": {"variables": [{"name": "__builtins__", "type": "dict", "value": "{\'ArithmeticError\': <class \'ArithmeticError\'>, \'AssertionError\': <class \'AssertionError\'>, \'AttributeError\': <class \'AttributeError\'>, \'BaseException\': <class \'BaseException\'>, \'BlockingIOError\': <class \'BlockingIOError\'>, \'BrokenPipeError\': <class \'BrokenPipeError\'>, \'BufferError\': <class \'BufferError\'>, \'BytesWarning\': <class \'BytesWarning\'>, \'ChildProcessError\': <class \'ChildProcessError\'>, \'ConnectionAbortedError\': <class \'ConnectionAb...tedError\'>, \'ConnectionError\': <class \'ConnectionError\'>, \'ConnectionRefusedError\': <class \'ConnectionRe...sedError\'>, \'ConnectionResetError\': <class \'ConnectionResetError\'>, \'DeprecationWarning\': <class \'DeprecationWarning\'>, ...}", "variablesReference": 2}, {"name": "__doc__", "type": "NoneType", "value": "None"}, {"name": "__file__", "type": "str", "value": "\'C:\\\\\\\\Users\\\\\\\\kanadig\\\\\\\\Source\\\\\\\\Repos\\\\\\\\PyScratch\\\\\\\\Scratch\\\\\\\\Scratch.py\'"}, {"name": "__loader__", "type": "SourceFileLoader", "value": "<_frozen_importlib_external.SourceFileLoader object at 0x00000176E3E214E0>", "variablesReference": 3}, {"name": "__name__", "type": "str", "value": "\'__main__\'"}, {"name": "__package__", "type": "NoneType", "value": "None"}, {"name": "__spec__", "type": "NoneType", "value": "None"}, {"name": "_pydev_stop_at_break", "type": "function", "value": "<function _pydev_stop_at_break at 0x00000176E4CDD048>", "variablesReference": 4}]}}'
 1> ERROR: Debug adapter error output: headers: b'Content-Length: 117\r\n\r\n'
 1> ERROR: Debug adapter error output: content: b'{"type": "response", "seq": 14, "request_seq": 11, "success": true, "command": "continue", "message": "", "body": {}}'
 1> ERROR: Debug adapter error output: debugger: received >>106	1000000011	pid_25708_id_1610141740056
 1> ERROR: Debug adapter error output: <<
 1> ERROR: Debug adapter error output: Received command: CMD_THREAD_RUN 106	1000000011	pid_25708_id_1610141740056
 1> ERROR: Debug adapter error output: sending cmd -->       CMD_THREAD_RUN 106	10	pid_25708_id_1610141740056	-1 
 1> ERROR: Debug adapter error output: headers: b'Content-Length: 75\r\n\r\n'
 1> ERROR: Debug adapter error output: content: b'{"type": "event", "seq": 15, "event": "continued", "body": {"threadId": 1}}'
 1> ERROR: Debug adapter error output: headers: b'Content-Length: 72\r\n\r\n'
 1> ERROR: Debug adapter error output: content: b'{"type": "event", "seq": 16, "event": "exited", "body": {"exitCode": 0}}'
 1> ERROR: Debug adapter error output: headers: b'Content-Length: 63\r\n\r\n'
 1> ERROR: Debug adapter error output: content: b'{"type": "event", "seq": 17, "event": "terminated", "body": {}}'

@karthiknadig
Copy link
Member Author

I hit this issue only when PYDEV_DEBUG=True.

@DonJayamanne
Copy link
Contributor

I can confirm this is VS specific. Works in VSC Windows and Mac

@DonJayamanne
Copy link
Contributor

I believe #134 fixes this issue.

@karthiknadig
Copy link
Member Author

#134 does not resolve this issue.

@DonJayamanne
Copy link
Contributor

Agreed, assumed it would due to the existence of the word ConnectionError in the log

@karthiknadig
Copy link
Member Author

this is now fixed:

 1> [DebugAdapter] --> C (continue-12): {"command":"continue","arguments":{"threadId":1},"seq":12,"type":"request"}
 1> [DebugAdapter] <--   R (continue-12): {"type": "response", "seq": 15, "request_seq": 12, "success": true, "command": "continue", "message": "", "body": {}}
 1> [DebugAdapter] <--   E (continued): {"type": "event", "seq": 16, "event": "continued", "body": {"threadId": 1}}
 1> [DebugAdapter] <--   E (exited): {"type": "event", "seq": 17, "event": "exited", "body": {"exitCode": 0}}
 1> [DebugAdapter] <--   E (thread): {"type": "event", "seq": 18, "event": "thread", "body": {"reason": "exited", "threadId": 1}}
 1> [DebugAdapter] <--   E (terminated): {"type": "event", "seq": 19, "event": "terminated", "body": {}}
 1> [DebugAdapter] --> C (disconnect-13): {"command":"disconnect","arguments":{},"seq":13,"type":"request"}
 1> [DebugAdapter] <--   R (disconnect-13): {"type": "response", "seq": 20, "request_seq": 13, "success": true, "command": "disconnect", "message": "", "body": {}}

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

No branches or pull requests

3 participants