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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Java

Java

Photo of Java process

Java process

Photo of NullPointerException

NullPointerException

Related news:

News photo

NTS (TeX reimplementation in Java from 2001) still compiles under Java 16

News photo

Pitfalls of comparing BigDecimals in Java

News photo

Show HN: I generated API documentation for all Java packages