8030027: nsk/jvmti/scenarios/hotswap/HS101/hs101t006 Crashed the vm on Linux-amd64: SIGSEGV in JavaThread::last_java_vframe(RegisterMap*)+0xfa

Add a safe guard to VMOp_GetCurrentLocation against non-walkable stack of target thread exiting from Java execution

Reviewed-by: mgronlun, dholmes, sla, dcubed
This commit is contained in:
Serguei Spitsyn 2014-01-17 02:13:40 -08:00 committed by Serguei Spitsyn
parent 7f34fe7eee
commit 0aac4235b3

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -272,7 +272,7 @@ class VM_GetCurrentLocation : public VM_Operation {
// There can be a race condition between a VM_Operation reaching a safepoint // There can be a race condition between a VM_Operation reaching a safepoint
// and the target thread exiting from Java execution. // and the target thread exiting from Java execution.
// We must recheck the last Java frame still exists. // 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); javaVFrame* vf = _thread->last_java_vframe(&rm);
assert(vf != NULL, "must have last java frame"); assert(vf != NULL, "must have last java frame");
Method* method = vf->method(); Method* method = vf->method();