Mercurial > hg > graal-jvmci-8
comparison src/share/vm/prims/jvmtiEnvBase.hpp @ 12277:c1d7040a1183
8022836: JVM crashes in JVMTIENVBASE::GET_CURRENT_CONTENDED_MONITOR and GET_OWNED_MONITOR
Summary: Check that the _java_thread parameter is valid when it is possible that the JavaThread has exited after the initial checks were made in generated/jvmtifiles/jvmtiEnter.cpp: jvmti_GetCurrentContendedMonitor()
Reviewed-by: dcubed, dsamersoff
author | sgabdura |
---|---|
date | Wed, 18 Sep 2013 16:48:49 +0400 |
parents | db9981fd3124 |
children | de6a9e811145 |
comparison
equal
deleted
inserted
replaced
12218:6f45933aef35 | 12277:c1d7040a1183 |
---|---|
404 _owned_monitor_ptr = mon_ptr; | 404 _owned_monitor_ptr = mon_ptr; |
405 } | 405 } |
406 VMOp_Type type() const { return VMOp_GetCurrentContendedMonitor; } | 406 VMOp_Type type() const { return VMOp_GetCurrentContendedMonitor; } |
407 jvmtiError result() { return _result; } | 407 jvmtiError result() { return _result; } |
408 void doit() { | 408 void doit() { |
409 _result = ((JvmtiEnvBase *)_env)->get_current_contended_monitor(_calling_thread,_java_thread,_owned_monitor_ptr); | 409 _result = JVMTI_ERROR_THREAD_NOT_ALIVE; |
410 if (Threads::includes(_java_thread) && !_java_thread->is_exiting() && | |
411 _java_thread->threadObj() != NULL) { | |
412 _result = ((JvmtiEnvBase *)_env)->get_current_contended_monitor(_calling_thread,_java_thread,_owned_monitor_ptr); | |
413 } | |
410 } | 414 } |
411 }; | 415 }; |
412 | 416 |
413 // VM operation to get stack trace at safepoint. | 417 // VM operation to get stack trace at safepoint. |
414 class VM_GetStackTrace : public VM_Operation { | 418 class VM_GetStackTrace : public VM_Operation { |