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

Orphaned java processes #10

Open
sim642 opened this issue Oct 24, 2021 · 6 comments
Open

Orphaned java processes #10

sim642 opened this issue Oct 24, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@sim642
Copy link
Member

sim642 commented Oct 24, 2021

I have closed all VS Code processes and somehow the java processes from GobPie still keep running:
image

I'm not sure if this is an issue in GobPie specifically (not allowing itself to be terminated for some reason) or in Magpie more generally.

@sim642 sim642 added the bug Something isn't working label Oct 24, 2021
@FeldrinH
Copy link
Collaborator

FeldrinH commented Feb 7, 2023

Could not reproduce on WSL by opening, running analyses and closing. Either this has been accidentally fixed or there is some particular step or environment-specific detail required to achieve this.

@sim642
Copy link
Member Author

sim642 commented Apr 12, 2023

This is still happening to me on the latest version from @FeldrinH's fork at least:
image
These java processes are not children of any VS Code process, but orphaned and thus direct children of the system init process.

Somehow it's even worse now because the java processes (not their Goblint children!) are running at 100% CPU.

EDIT: Here's the thread dump of one such process: gobpie-orphan-cpu.txt. "adb-server-worker" #54 there seems to have accumulated a lot of CPU time, so that's the new thing that might be causing the CPU usage, but the java process staying alive is probably not caused by that.

@sim642
Copy link
Member Author

sim642 commented Apr 12, 2023

One thing that seems to cause such processes is doing "Developer: Reload Window" in VS Code. Maybe it's not handling well the closure of some LSP socket on the VS Code side.

The reason I keep having to reload window is that modifying and saving files for whatever reason stops working for me: no new analysis is ever started.

@FeldrinH
Copy link
Collaborator

There seem to be three different problems here:

  • Closing VSCode sometimes leaves orphaned processes.
    I think I have observed something similar a couple of times on my computer, but I can't reproduce it reliably. I have some ideas about what might be causing this, but none of them are easy to fix or test.

  • GobPie process consuming 100% of one CPU core.
    I have observed this a couple of times on my computer and I think I know what causes this. I think there is a race condition that can lead to the abstract debugger socket file being deleted by the previous GobPie process after the new process has bound to it, which causes it to get stuck in an infinite loop of throwing, catching and logging errors. If I am correct this will be fixed today evening.

  • The reason I keep having to reload window is that modifying and saving files for whatever reason stops working for me: no new analysis is ever started.

    This I have never observed and off the top of my head I can't even concieve how this could possibly happen. If it happens again it might be worth checking the GobPie log output in VSCode, maybe something there could give us a clue.

@FeldrinH
Copy link
Collaborator

Small update:

The 100% CPU issue should be fixed on https://github.com/FeldrinH/GobPie/tree/abstract-debugging and should not occur at all on GobPie versions without abstract debugging.

As for orphaned processes, I tried to reload the window and I noticed that old GobPie processes do stay open. I don't know why that is. However, when I close VSCode all GobPie processes are closed with it, so I still can't reproduce the issue itself.

Analysis-on-save breaking I cannot reproduce at all. @sim642 it would probably be a good idea to open a new issue for this, if you can reproduce it consistently on the latest version.

@FeldrinH
Copy link
Collaborator

Another update:

The analysis-on-save issue turned out to be that GobPie simply does not trigger an analysis when saving .h or .i files.

This should be fixed once #58 is merged.

karoliineh added a commit that referenced this issue Jun 26, 2024
* Add coverage github workflow
* Add jacoco plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants