From: Thomas Pornin on 25 Feb 2010 17:33 According to Roedy Green <see_website(a)mindprod.com.invalid>: > On 25 Feb 2010 13:26:18 GMT, Thomas Pornin <pornin(a)bolet.org> wrote, > quoted or indirectly quoted someone who said : > > >To be precise, in many JVM, null references are not checked before > >access; instead, the access is trapped by the OS, which generates a > >system-level exception (on Unix-like systems, a SIGSEGV or SIGBUS > >signal). The JVM intercepts that signal, obtains the faulty code > >address, and converts the signal into a NullPointerException which is > >then thrown in the offending thread. > > How did you discover this? It is a common implementation technique, which predates Java. Also, Sun's JVM could not achieve the performance it displays if it did not use that technique. Moreover, having the JVM crash on what should have been a NullPointerException, instead complaining with a message which basically says "I got a SIGSEGV, but I could not find out which thread did it and where its stack is hidden", that's a definite clue. Last by not least, Sun's JVM source code is, by definition, the ultimate source on Sun's JVM behaviour. See JVM_handle_linux_signal() in hotspot/src/os_cpu/linux_i486/vm/os_linux_i486.cpp (from Java Research License Source Release). Stack overflow is also handled by trapping the OS signal. --Thomas Pornin
From: Arne Vajhøj on 25 Feb 2010 22:30 On 25-02-2010 16:11, Roedy Green wrote: > On Thu, 25 Feb 2010 10:50:42 -0500, Lew<noone(a)lewscanon.com> wrote, > quoted or indirectly quoted someone who said : >> Come on, guys, Jcheeze! The OP clearly meant crash of his program, not the JVM. > > I would say most programmers reserve the word "crash" for the JVM > blowing up, not just an unhandled exception. I am not so sure about that. You write a C/C++ program that does something that makes the machine throw an exception, so the program crashes if it is not handled. You write a Java program that does something that makes the JVM throw an exception, so the program crashes if it is not handled. Same thing. So if you are writing Java apps, then an unhandled exception in Java is a crash. But if you are writing JVM's, then you need the C/C++ code in the JVM to crash before you consider it a crash. The number of people writing Java apps is a lot greater than the number of people writing JVM's. Arne
From: Arved Sandstrom on 26 Feb 2010 04:56 Arne Vajh�j wrote: > On 25-02-2010 16:11, Roedy Green wrote: >> On Thu, 25 Feb 2010 10:50:42 -0500, Lew<noone(a)lewscanon.com> wrote, >> quoted or indirectly quoted someone who said : >>> Come on, guys, Jcheeze! The OP clearly meant crash of his program, >>> not the JVM. >> >> I would say most programmers reserve the word "crash" for the JVM >> blowing up, not just an unhandled exception. > > I am not so sure about that. > > You write a C/C++ program that does something that makes > the machine throw an exception, so the program > crashes if it is not handled. > > You write a Java program that does something > that makes the JVM throw an exception, so the > program crashes if it is not handled. > > Same thing. > > So if you are writing Java apps, then an unhandled > exception in Java is a crash. > > But if you are writing JVM's, then you need the C/C++ > code in the JVM to crash before you consider it a crash. > > The number of people writing Java apps is a lot greater > than the number of people writing JVM's. > > Arne > Most business users I know rightfully understand a simple truth - the application is either working or it's not. They don't actually use the word "crash" often - the popular term is "outage", which is descriptive enough. And they could really not care less whether it was the JVM that locked up or crashed, or it was their J2EE application that crashed, or it was their J2EE application that's in deadlock or just glacially slow. It's all an outage. If someone wants to use the word "crash" to describe the end of useful execution of their application due to an error, as opposed to the JVM itself blowing up, I'm not going to say they're wrong. And the business user will call both an "outage". AHS
From: Mike Schilling on 26 Feb 2010 15:15
Arved Sandstrom wrote: > Most business users I know rightfully understand a simple truth - the > application is either working or it's not. They don't actually use the > word "crash" often - the popular term is "outage", which is > descriptive enough. And they could really not care less whether it > was the JVM that locked up or crashed, or it was their J2EE > application that crashed, or it was their J2EE application that's in > deadlock or just glacially slow. It's all an outage. Likewise, if a service is unavailble for networking reasons completely unrelated to the running of the service itself, that's still an outage. |