question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

leaves zombie processes

See original GitHub issue

Issue Type: Bug

Using the extension and exiting/reloading vscode leaves zombie (defunct) java processes on the host. I’m using “Remote: SSH” to work (remote is Linux, local is Windows).

Extension version: 0.79.2 VS Code version: Code 1.57.0 (b4c1bd0a9b03c749ea011b06c6d2676c8091a70c, 2021-06-09T17:18:42.354Z) OS version: Windows_NT x64 10.0.18363 Restricted Mode: No Remote OS version: Linux x64 5.10.25-linuxkit Remote OS version: Linux x64 5.10.25-linuxkit Remote OS version: Linux x64 5.10.25-linuxkit

pgrep | ps
$ pgrep java | xargs ps -f 
UID        PID  PPID  C STIME TTY      STAT   TIME CMD
user     323     1  0 Jun11 pts/4    Z      0:53 [java] <defunct>
user     845     1  0 Jun10 ?        Z      3:13 [java] <defunct>
user     877     1  0 Jun10 ?        Z      3:21 [java] <defunct>
user     975     1  0 Jun10 ?        Z      3:15 [java] <defunct>
user    3858     1  0 Jun10 ?        Z     25:55 [java] <defunct>
user   13540     1  0 Jun13 ?        Z      6:16 [java] <defunct>
user   16407     1  0 Jun12 pts/4    Z      0:51 [java] <defunct>
user   20677     1  0 09:12 ?        Z      0:11 [java] <defunct>
user   22122     1  0 Jun12 pts/4    Z      0:51 [java] <defunct>
user   25333     1  0 Jun11 ?        Z      2:02 [java] <defunct>
user   25822     1  0 Jun10 pts/4    Z      0:53 [java] <defunct>
user   30418     1  7 09:23 ?        Z      2:05 [java] <defunct>
user   31579     1  0 Jun10 pts/4    Z      1:28 [java] <defunct>
user   36139     1  0 09:28 ?        Z      0:06 [java] <defunct>
user   37038     1  0 09:29 ?        Z      0:08 [java] <defunct>
user   37646     1  0 09:29 ?        Z      0:07 [java] <defunct>
user   38144     1  0 Jun13 ?        Z      0:33 [java] <defunct>
user   39655     1  0 09:31 ?        Z      0:06 [java] <defunct>
user   40020     1  0 Jun13 ?        Z      0:57 [java] <defunct>
user   40079     1  5 09:31 ?        Z      1:05 [java] <defunct>
user   42914     1  0 Jun13 pts/4    Z      0:14 [java] <defunct>
user   43065     1  0 Jun13 pts/4    Z      0:47 [java] <defunct>
user   54953     1  0 Jun13 ?        Z      0:27 [java] <defunct>
user   55101     1  0 Jun13 ?        Z      8:54 [java] <defunct>
user   55573     1  0 Jun12 pts/4    Z      0:21 [java] <defunct>
user   55769     1  0 Jun12 pts/4    Z      0:33 [java] <defunct>
user   56866 52065  0 09:44 ?        Sl     0:04 /usr/lib/jvm/java-11-openjdk-amd64/bin/java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -noverify -jar /home/user/.vscode-server/extensions/redhat.java-0.79.2/server/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar -configuration /home/user/.vscode-server/data/User/globalStorage/redhat.java/0.79.2/config_ss_linux -data /home/user/.vscode-server/data/User/workspaceStorage/73e7468acc665bdca57d62194cba9be9/redhat.java/ss_ws
user   57034     1  8 Jun12 ?        Sl   212:10 /usr/lib/jvm/java-11-openjdk-amd64/bin/java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -noverify -jar /home/user/.vscode-server/extensions/redhat.java-0.79.2/server/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar -configuration /home/user/.vscode-server/data/User/globalStorage/redhat.java/0.79.2/config_linux -data /home/user/.vscode-server/data/User/workspaceStorage/ecbff0b173cd02be928095d5a6e765cb/redhat.java/jdt_ws
user   57093 52052  1 09:44 ?        Sl     0:08 /usr/lib/jvm/java-11-openjdk-amd64/bin/java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -noverify -jar /home/user/.vscode-server/extensions/redhat.java-0.79.2/server/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar -configuration /home/user/.vscode-server/data/User/globalStorage/redhat.java/0.79.2/config_ss_linux -data /home/user/.vscode-server/data/User/workspaceStorage/158468538c785d689c62e773b324708c/redhat.java/ss_ws
user   57126     1  0 Jun13 ?        Z      1:07 [java] <defunct>
user   57176 52053  1 09:44 ?        Sl     0:06 /usr/lib/jvm/java-11-openjdk-amd64/bin/java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dfile.encoding=utf8 -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -noverify -jar /home/user/.vscode-server/extensions/redhat.java-0.79.2/server/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar -configuration /home/user/.vscode-server/data/User/globalStorage/redhat.java/0.79.2/config_ss_linux -data /home/user/.vscode-server/data/User/workspaceStorage/ecbff0b173cd02be928095d5a6e765cb/redhat.java/ss_ws
user   71016     1  0 Jun12 ?        Z      1:04 [java] <defunct>
user   77966     1  0 Jun11 ?        Z      6:00 [java] <defunct>
user   81535     1  0 Jun12 ?        Z      0:18 [java] <defunct>
user   81747     1  0 Jun12 ?        Z      0:44 [java] <defunct>
user   81943     1  0 Jun12 ?        Z      1:06 [java] <defunct>
user   84281     1  0 Jun12 ?        Z      0:18 [java] <defunct>
user   84471     1  0 Jun12 ?        Z      0:44 [java] <defunct>
user   84716     1  0 Jun13 ?        Z      1:34 [java] <defunct>
user   85093     1  0 Jun13 ?        Z      1:21 [java] <defunct>
user   86370     1  0 Jun13 ?        Z      1:11 [java] <defunct>
user   86616     1  0 Jun13 ?        Z      8:25 [java] <defunct>
user   87113     1  0 Jun12 ?        Z      0:54 [java] <defunct>
user   88254     1  0 Jun12 ?        Z      0:57 [java] <defunct>
user   89366     1  0 Jun12 ?        Z      1:26 [java] <defunct>
user   93919     1  0 Jun11 ?        Z      0:02 [java] <defunct>
System Info
Item Value
CPUs Intel® Core™ i7-8565U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.81GB (3.57GB free)
Process Argv
Screen Reader no
VM 0%
Item Value
Remote SSH: localhost
OS Linux x64 5.10.25-linuxkit
CPUs Intel® Core™ i7-8565U CPU @ 1.80GHz (3 x 1992)
Memory (System) 18.57GB (8.03GB free)
VM 0%
Item Value
Remote SSH: localhost
OS Linux x64 5.10.25-linuxkit
CPUs Intel® Core™ i7-8565U CPU @ 1.80GHz (3 x 1992)
Memory (System) 18.57GB (8.03GB free)
VM 0%
Item Value
Remote SSH: localhost
OS Linux x64 5.10.25-linuxkit
CPUs Intel® Core™ i7-8565U CPU @ 1.80GHz (3 x 1992)
Memory (System) 18.57GB (8.03GB free)
VM 0%

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
snjezacommented, Jun 16, 2021

@aviv-amdocs I can reproduce the issue using your docker image. It isn’t a VS Code issue. You have to start sshd properly. You can try to start sshd using the following:

  1. add entrypoint.sh:
#!/usr/bin/env bash
sudo /usr/bin/ssh-keygen -A
sudo /usr/sbin/sshd -D &
tail -f /dev/null
  1. remove the line:
CMD ["sudo", "/usr/sbin/sshd", "-D"]
  1. add
COPY ["entrypoint.sh","/home/user/entrypoint.sh"]
ENTRYPOINT ["/home/user/entrypoint.sh"]

after

USER ${USER_ID}:${USER_ID}
1reaction
rgrunbercommented, Jun 14, 2021

Part of this is a known issue which should be fixed by https://github.com/redhat-developer/vscode-java/issues/1928. When we adopted languageclient v7, shutdown requests sent to the syntax server were not being handled correctly, so in our next release, we have a workaround.

The zombie process behaviour could be an issue with remote connections given that it seems to happen for any language server (syntax, standard) that’s started up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Hunt, Kill and Remove a Zombie Process on Linux
In the world of Linux, a zombie process refers to any process that is essentially removed from the system as 'defunct', but still...
Read more >
Zombie Processes and their Prevention - GeeksforGeeks
Zombie state: When a process is created in UNIX using fork() system call, the parent process is cloned. If the parent process calls...
Read more >
status: leaves behind zombie (i.e. <defunct>) processes ...
I happened to run ps -e and noticed hundreds of process with command dvc <defunct> . I was able to reproduce in a...
Read more >
What is Zombie Process in Linux? - Tutorialspoint
A zombie process is a process whose execution is completed but it still has an entry in the process table. Zombie processes usually...
Read more >
Killing zombie processes on Linux using kill command - nixCraft
Explains how to list and kill zombie processes on Linux operating systems using various command-line options.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found