Get the latest tech news
Will sending `kill -11` to Java process raises a NullPointerException?
For example, the HotSpot JVM implement null-pointer detection by catching SIGSEGV signal. So if we manually generate a SIGSEGV from external, will that also be recognized as NullPointerException i...
Summary Yes, in some marginal cases an external kill command may cause a bogus NullPointerException in a Java application. Practice To increase chances of a user signal hitting the right instruction, we'll write an infinite loop that repeatedly stores to an object field. If the signal misses mov instruction with an implicit null check, or if si_addr is larger than the page size, the JVM will crash with a fatal error instead of throwing NPE.
Or read this on Hacker News