-
Notifications
You must be signed in to change notification settings - Fork 112
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
Dangling ghc
process when ctrl+C twice while "Running test..."
#257
Comments
I assume you are on Windows, since otherwise the OS would take care of clean up for you. Unfortunately without the OS playing ball, I'm a bit stuck. If the process refuses to terminate I could make ghcid also refuse to terminate, but that sucks. Also, with Cygwin and Mingw compatibility layers the behaviour changes again, so I'm not sure anyone has ever managed to get something working in all combinations. |
Hi! Thanks for the reply. This is on Mac osx. |
I forgot to ask: what OS are you on? And does it reproduce on that OS? Maybe it's only a mac osx thing. |
Weird. I thought Mac followed the same process owner pattern and thus leaking processes wasn't easy. I'm on Windows where I have no doubt this can reproduce. |
I agree, but for me it sounds better than the current situation. Currently I don't know about the orphan processes until I open a process explorer because my computer got very hot and slow. If |
@jwoudenberg fair point, hard to disagree... Perhaps printing out "Stuck while shutting ..." would give people the necessary clues. |
@ndmitchell you are aware of the GHC RTS's behaviour regarding SIGINT, right? https://gitlab.haskell.org/ghc/ghc/wikis/commentary/rts/signals#the-interrupt-signal
|
This is crucial to fix for using ghcid for development purposes, otherwise you can end up with more then one development process, leading to weird behavior. I'm using plain processes to start development and foreman will send a graceful shutdown event and then to a SIGKILL after 5 seconds. |
Description
When running
ghci
and passing--test something
, if you press ctrl+C quickly twice then a danglinggch
process will remain. Theghc
process consumes 100% of the CPU.Steps to reproduce
src/Lib.hs
is modified to doputStrLn
30000 times without a loop (inlined). The reason for this long file is that it takes a noticeable time to compile (to simulate a big project).stack exec -- ghcid --test "Lib.someFunc"
ghcid
shows "Running test...` and before it starts running the program, hit ctrl+C twice, quickly. If done correctly to reproduce this, the word "Interrupted" shouldn't have appeared in the console.ghc
process remains, consuming 100% of the CPU.Diagnosis
I assume when
ghcid
shows "Running test..." and before it actually execute the program passed in--test
, it compiles the program. If you hit ctrl+C once and wait you'll see "Interrupted" printed after a few milliseconds, and there will be no danglingghc
process. However, if you hit ctrl+C again before seeing "Interrupted", the program exists but aghc
process remains. My guess is that some clean up is missing at that point, but I'm not familiar with the code to further diagnose it and send a fix, but maybe this info can help.This is probably related to #191, or another case of it, though this issue provides a way to consistently reproduce the problem.
The text was updated successfully, but these errors were encountered: