-
Notifications
You must be signed in to change notification settings - Fork 182
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment data
- PTVSD version: 2020.3.71113
- OS and version: macOS 10.15.3 using remote ssh into a Raspberry Pi 3B Raspbian Buster
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.3
- Using VS Code or Visual Studio: VS Code
Actual behavior
When debugging as sudo, when the debugger is stopped the process still runs as the termination command fails. The terminal returns to the command prompt, but the process is running in the background.
Expected behavior
When the debugger is stopped, the process should stop.
Steps to reproduce:
-
Use this python code:
import asyncio async def main(): async def main_loop(): while True: print('looping') await asyncio.sleep(1) await main_loop() if __name__ == '__main__': asyncio.run(main())
-
Debug the local file using the option
"sudo": truein thelaunch.json -
It will run and output
looping -
Stop the debugger. You will see an exception:
E+00006.483: Failed to kill Debuggee[PID=2134] Traceback (most recent call last): File "/home/pi/.vscode-server/extensions/ms-python.python-2020.3.71113/pythonFiles/lib/python/debugpy/wheels/debugpy/launcher/../../debugpy/launcher/debuggee.py", line 104, in kill process.kill() File "/usr/lib/python3.7/subprocess.py", line 1756, in kill self.send_signal(signal.SIGKILL) File "/usr/lib/python3.7/subprocess.py", line 1746, in send_signal os.kill(self.pid, sig) PermissionError: [Errno 1] Operation not permitted Stack where logged: File "/home/pi/.vscode-server/extensions/ms-python.python-2020.3.71113/pythonFiles/lib/python/debugpy/wheels/debugpy/launcher/../../debugpy/launcher/debuggee.py", line 106, in kill log.swallow_exception("Failed to kill {0}", describe()) File "/home/pi/.vscode-server/extensions/ms-python.python-2020.3.71113/pythonFiles/lib/python/debugpy/wheels/debugpy/launcher/../../debugpy/common/log.py", line 215, in swallow_exception _exception(format_string, *args, **kwargs)
-
The output will keep showing
looping
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working