8030027: nsk/jvmti/scenarios/hotswap/HS101/hs101t006 Crashed the vm on Linux-amd64: SIGSEGV in JavaThread::last_java_vframe(RegisterMap*)+0xfa
authorsspitsyn
Fri, 17 Jan 2014 02:13:40 -0800
changeset 22519 924605caa9a8
parent 22518 e23c5545e376
child 22520 b9e88eed82d7
8030027: nsk/jvmti/scenarios/hotswap/HS101/hs101t006 Crashed the vm on Linux-amd64: SIGSEGV in JavaThread::last_java_vframe(RegisterMap*)+0xfa Summary: Add a safe guard to VMOp_GetCurrentLocation against non-walkable stack of target thread exiting from Java execution Reviewed-by: mgronlun, dholmes, sla, dcubed Contributed-by: serguei.spitsyn@oracle.com
hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp
--- a/hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp	Thu Jan 16 10:51:16 2014 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiEnvThreadState.cpp	Fri Jan 17 02:13:40 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -272,7 +272,7 @@
     // There can be a race condition between a VM_Operation reaching a safepoint
     // and the target thread exiting from Java execution.
     // We must recheck the last Java frame still exists.
-    if (_thread->has_last_Java_frame()) {
+    if (!_thread->is_exiting() && _thread->has_last_Java_frame()) {
       javaVFrame* vf = _thread->last_java_vframe(&rm);
       assert(vf != NULL, "must have last java frame");
       Method* method = vf->method();