P
pinto
hi all,
I was asked by an interviewer as to how to crash a JVM.If any of
you know abt it let me know.
I was asked by an interviewer as to how to crash a JVM.If any of
you know abt it let me know.
It is quite easy by loading a library with some self-written JNI-code.pinto said:hi all,
I was asked by an interviewer as to how to crash a JVM.If any of
you know abt it let me know.
hi all,
I was asked by an interviewer as to how to crash a JVM.If any of
you know abt it let me know.
pinto said:hi all,
I was asked by an interviewer as to how to crash a JVM.If any of
you know abt it let me know.
Daniel said:JNI is what we usually do
I have also been able to crash the JVM by
feeding it some slightly illegal bytecode with the help of the JVMTI
interface which I was using for some dynamic bytecode modification.
Chris said:Daniel Sjöblom wrote:
Interesting. I'd have expected that the byte-code verification would have
eliminated "crash-me" sequences. Perhaps the verifier isn't run on bytecode
injected via the debugging interfaces ?
hi all,
I was asked by an interviewer as to how to crash a JVM.If any of
you know abt it let me know.
Chris said:What about:
void func() {
func();
}
Daniel said:Hmm. I just tried to generate some bogus bytecode (replaced iadd with
fadd in an otherwise legal classfile), again using the JVMTI interface.
Now I get this message:
=============== DEBUG MESSAGE: illegal bytecode sequence - method not
verified ================
Error occurred during initialization of VM
(and a NullPointerException is thrown to boot!?)
I wonder how you are supposed to interpret "method not verified". Does
it mean "we did no real verification, but this is just obviously wrong"
or does it mean "we did verification, and it failed"? Shouldn't the VM
have thrown VerifyError?
I'm not sure, but I think that if VerifyError was thrown anywhere, it should
have been thrown to the code that caused the class to be loaded in the first
place, i.e. in the "debugee" rather than to the debugger (using the expression
"debugger" loosely).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.