schell / steeloverseer

A file watcher and development tool.
BSD 3-Clause "New" or "Revised" License
128 stars 15 forks source link

Zombie processes #32

Open robinvd opened 6 years ago

robinvd commented 6 years ago

After running a command, a zombie process stays.

32430 robin     20   0  127208   4812   3068 S   0.0  0.0   0:00.24                          `- bash                                                                                                                                                                                        
23581 robin     20   0  1.001t  34584  30164 S   0.0  0.3   0:00.09                              `- sos                                                                                                                                                                                     
23661 robin     20   0       0      0      0 Z   0.0  0.0   0:00.04                                  `- cabal                                                                                                                                                                               
24087 robin     20   0       0      0      0 Z   0.0  0.0   0:00.04                                  `- cabal                                                                                                                                                                               
24213 robin     20   0       0      0      0 Z   0.0  0.0   0:00.05                                  `- cabal

im using Steel Overseer 2.0.1.0 and the command sos -p '.*\.hs' -c 'cabal run'

schell commented 6 years ago

Thanks for the issue. What OS are you running? Does this happen on exit (ctrl-c) or during program execution? It looks like the latter. Maybe some better thread handling is in order.

mitchellwrosen commented 6 years ago

If process A (steeloverseer) runs command B (cabal run) which itself spawns something (C) and then exits, C becomes a zombie. In this case it's B's job to wait on all of its children, not A's.

Is it possible that's what's going on here?

schell commented 6 years ago

@mitchellwrosen sounds plausible. @robinvd what was sos's output after the command ran?

robinvd commented 6 years ago

im running nixos. after a file change

Added: src/Emit.hs~
[1/1] cabal run
(bunch of cabal and program output)
Success ✓

@mitchellwrosen that could be, but in top cabal is a direct child of sos