RE: System.exit deadlock if called within a hook

2022-04-27 Thread remi.catherinot
Ok, Yes that would be hard to track down hooks "blocked" either directly or indirectly that way. Indirect blocking case are the hardest one, like a hook joining another thread that is blocked calling System.exit. This hook might really be blocked if joining again and again regardless of any joi

RE: System.exit deadlock if called within a hook

2022-04-25 Thread remi.catherinot
Ok, you're right that it can raise an exception when the calling thread does not have the security privileges needed. But what if it had them ? Right now the deadlock comes from the fact is doesn't got back to the caller with an exception and doesn't end the current thread. My 1st proposal was t

System.exit deadlock if called within a hook

2022-04-25 Thread remi.catherinot
Hi, Exemple code to deadlock the JVM. Only Runtime.halt from within the JVM or a SIGKILL from outside stops it. Normal kills and Ctrl-C (which is a SIGTERM) fail to do so. public class ExitInHookDemo { public static void main(String...args) { Runtime.getRunti