JDK-6975006 : assert(check.is_deoptimized_frame()) failed: missed deopt
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs19
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2010-08-05
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u21pFixed 7Fixed hs19Fixed
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 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.
18-08-2010

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

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