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

DSPDebugTarget may leave dummy child process alive #1051

Closed
FlorianKroiss opened this issue Aug 13, 2024 · 1 comment
Closed

DSPDebugTarget may leave dummy child process alive #1051

FlorianKroiss opened this issue Aug 13, 2024 · 1 comment

Comments

@FlorianKroiss
Copy link
Contributor

FlorianKroiss commented Aug 13, 2024

When the DSPDebugTarget receives output before a process was started, it creates a dummy process so that it can write the output to a console. When the debugger reports another process later on, the direct reference to this dummy process (DSPDebugTarget.process) is overwritten. Later on, when terminate is called on DSPDebugTarget, it only tries to terminate the last reported process, leaving the dummy process alive.

I noticed that this happens when debugging Python with debugpy, which sends telemetry output before starting a process.
For my specific case it would be enough to defer creation of a dummy process until we actually have something to write to the console, so something that isn't telemetry data.

Steps to reproduce:

  1. Install Python
  2. Install debugpy
  3. Create a new project in Eclipse and add a file called test.py containing a simple program, e.g., print("foo")
  4. Create a new "Debug Adapter Launcher" launch configuration
  5. Select "Launch a Debug Server using ..."
  6. Set Command to your python executable
  7. Set Arguments to -m debugpy.adapter
  8. Set Launch Parameters to {"request": "launch", "program": "path/to/your/test.py"}
  9. Press Debug to start Launch Configuration
  10. See that an extra process is shown in the debug view, which is not terminated and prevents the launch from being removed
  11. Performing step 9 multiple times causes Launches to pile up in Debug view

A workaround is to manually terminate the dummy process via the debug view, which allows to cleanup the launch

@sebthom
Copy link
Member

sebthom commented Aug 15, 2024

Your PR was merged and a new LSP4e version was released. Thanks for your contribution!

@sebthom sebthom closed this as completed Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants