United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6975006 assert(check.is_deoptimized_frame()) failed: missed deopt
JDK-6975006 : assert(check.is_deoptimized_frame()) failed: missed deopt

Details
Type:
Bug
Submit Date:
2010-08-05
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P2
Resolution:
Fixed
Affected Versions:
hs19
Fixed Versions:
hs19 (b06)

Related Reports
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
We've seen several failures like the following on both c1 and c2:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/tmp/jprt/P1/B/171114.kvn/source/src/share/vm/runtime/frame.cpp:293), pid=6986, tid=3
#  assert(check.is_deoptimized_frame()) failed: missed deopt
#
# JRE version: 7.0
# Java VM: OpenJDK Client VM (19.0-b02-201007231711.kvn.6969569-fastdebug mixed mode solaris-sparc )
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

                                    

Comments
EVALUATION

The logic for NeedsDeoptSuspend isn't safe if the thread in native comes to a halt during deopt.
                                     
2010-08-05
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/da877bdc9000
                                     
2010-08-13
EVALUATION

6975006: assert(check.is_deoptimized_frame()) failed: missed deopt
Reviewed-by: kvn, twisti

The safepointing logic treats threads that are thread_in_native as if
they are halted since the Java state is safe while we are in native
state.  If the thread happens to return from native during the
safepoint it will simply come to a halt.  On sparc this creates some
complexity when patching for deoptimization because the return address
is kept in a register and only flushed to stack by the chip.  We force
flushing of the windows in the JNI stub but because of the way
register windows work this doesn't help the frame that is just above a
native wrapper since the window might be on chip while the native
wrapper itself is executing.  There's machinery in the deopt code that
detects the case where the caller of a native wrapper is the one being
deoptimized and arranges for the native wrapper to rewrite the return
address when it comes out of native.  The problem is that this code
examines the current state of the thread at the time the deopt occurs
not what state was when the safepoint started.  This creates a little
race where a native wrapper might come to a halt on it's own after the
safepoint started but before the deopt patching occurred, which
sidesteps the deopt suspend logic because it's not in one of the
thread_in_native states.  The fix is to record the state of the thread
at the beginning of the safepoint and consult that when triggering the
deopt suspend logic.

Tested by repeatedly running test with -XX:+DeoptimizeALot.
Previously it would fail within 5 minutes but after the fix it ran
overnight until I simply killed it.
                                     
2010-08-18



Hardware and Software, Engineered to Work Together