Ask questionspython without debugging won't start if there is a breakpoint

@tmdag commented on Thu May 02 2019

Environment data

  • VSCode Version: 1.33.1
  • OS Version:Linux 5.0.7-200.fc29.x86_64
  • Extension version (available under the Extensions sidebar): Python 2019.4.11987
  • Anaconda Extension Pack 1.0.1

Steps to reproduce:

Open Python code create a breakpoint run python without debugging (ctrl+F5) Terminal output:

cd /home/user/dev/Pytool ; env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 /usr/bin/python3 /home/user/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/ --default --nodebug --client --host localhost --port 36019 /home/user/dev/Pytool/ Terminated Does this issue occur when all extensions are disabled?: Yes/No Not sure - Python extension is required

Enabled Extensions:

Bookmarks 10.4.3 C/C++ 0.221 Gist 3.0.3 Git History 0.4.6 GitLens - 9.6.3 markdownlint 0.26.0

Syncing 2.1.6 OpenCL 0.5.2 VEX 0.4.0 TAML 0.4.0

@jxramos commented on Thu May 02 2019

I'm seeing this too on a MacOS, it immediately exits with Terminated: 15. This behavior persists even if the breakpoint is disabled/unchecked.


Answer questions fabioz

I'm able to reproduce this (on Linux) with the code below (it seems it can be any script that does not end too fast):

import time
while True:

I've instrumented to see what's going on when it receives the setBreakpoints and it seems that it does nothing in both cases (when breakpoints are received or not) -- in both cases it just calls on_invalid_request (from the dummy MESSAGE_PROCESSOR in ptvsd/ which just returns self.send_response(request, success=True).

The difference is that afterwards, ptvsd receives a disconnect message from VSCode if breakpoints are passed and if no breakpoints are passed it proceeds to receive a configurationDone and threads (as a note, even by changing the disconnect in the failing case to do nothing (just send self.send_response(request, success=True)), the python process is killed right afterwards anyways).

Enabling faulthandler didn't acknowledge any crash in the application.

To me it doesn't seem like the issue lies on ptvsd (it seems like VSCode is promptly killing the ptvsd process in the case that breakpoints are passed).

@karthiknadig should this be passed to someone in the VSCode client side?

Fabio Zadrozny fabioz Python enthusiast. Maintainer of PyDev, PyDev.Debugger, LiClipse, LiClipseText, PyVmMonitor and mu-repo
Github User Rank List