8198826: -XX:+VerifyStack fails with fatal error: ExceptionMark constructor expects no pending exceptions

Save and restore pending exception while executing stack verification code at deoptimization.

Reviewed-by: kvn, dholmes
This commit is contained in:
Tobias Hartmann 2018-03-02 11:06:51 +01:00
parent bacf4db5bd
commit f6f71565b7
2 changed files with 5 additions and 2 deletions

View file

@ -56,6 +56,7 @@
#include "runtime/vframeArray.hpp"
#include "runtime/vframe_hp.hpp"
#include "utilities/events.hpp"
#include "utilities/preserveException.hpp"
#include "utilities/xmlstream.hpp"
#if INCLUDE_JVMCI
@ -648,6 +649,8 @@ JRT_LEAF(BasicType, Deoptimization::unpack_frames(JavaThread* thread, int exec_m
#ifndef PRODUCT
if (VerifyStack) {
ResourceMark res_mark;
// Clear pending exception to not break verification code (restored afterwards)
PRESERVE_EXCEPTION_MARK;
thread->validate_frame_layout();

View file

@ -23,10 +23,10 @@
/*
* @test
* @bug 6898462
* @bug 6898462 8198826
* @summary failed reallocations of scalar replaced objects during deoptimization causes crash
*
* @run main/othervm -XX:-BackgroundCompilation -Xmx128M
* @run main/othervm -XX:-BackgroundCompilation -Xmx128M -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack
* -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::main
* -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::m9_1
* compiler.uncommontrap.TestDeoptOOM