Just debugged a crash where the VM goes to _thread_in_Java before passing the arguments. When passing the arguments to call_stub, a bad oop causes a crash which leads to the catchall error message because the thread is in java. We should move this above the
thread transition in javaCalls.cpp : args->parameters().
Also -Xcheck:jni should catch the non oop argument but doesn't check arguments.
os_<platform>.cpp should not call SharedRuntime::continuation_for_implicit_exception if the code blob is null. This causes the exception handler to lose the location of the real crash (I think).
;; Using jvm: "/java/re/jdk/1.7.0/promoted/ea/b33/binaries/windows-i586/jre/bin/client/jvm.dll"#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (sharedRuntime.cpp:549), pid=3684, tid=3104
# Error: guarantee(cb != 0,"exception happened outside interpreter, nmethods and vtable stubs (1)")
#
# Java VM: Java HotSpot(TM) Client VM (14.0-b01 mixed mode windows-x86 )
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x0efc5000): JavaThread "AWT-EventQueue-0" [_thread_in_Java, id=3104, stack(0x0f2d0000,0x0f320000)]
Stack: [0x0f2d0000,0x0f320000], sp=0x0f31e1b4, free space=312k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x1bd5b7];; ?report_and_die@VMError@@QAEXXZ+0x4d7
V [jvm.dll+0x955b8];; ?report_fatal@@YAXPBDH0@Z+0x28
V [jvm.dll+0x1700a3];; ?continuation_for_implicit_exception@SharedRuntime@@SAPAEPAVJavaThread@@PAEW4ImplicitExceptionKind@1@@Z+0x183
V [jvm.dll+0x14d4d1];; ?topLevelExceptionFilter@@YGJPAU_EXCEPTION_POINTERS@@@Z+0x191
V [jvm.dll+0x14e5af];; ?os_exception_wrapper@os@@SAXP6AXPAVJavaValue@@PAVmethodHandle@@PAVJavaCallArguments@@PAVThread@@@Z0123@Z+0x6f
V [jvm.dll+0xc95cd];; ?call@JavaCalls@@SAXPAVJavaValue@@VmethodHandle@@PAVJavaCallArguments@@PAVThread@@@Z+0x1d
V [jvm.dll+0xd243f];; ?jni_invoke_nonstatic@@YAXPAUJNIEnv_@@PAVJavaValue@@PAV_jobject@@W4JNICallType@@PAU_jmethodID@@PAVJNI_ArgumentPusher@@PAVThread@@@Z+0x1ef
V [jvm.dll+0xd5237];; _jni_CallVoidMethodV@16+0xa7
V [jvm.dll+0xe1839];; _checked_jni_CallVoidMethodV@16+0x99