United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7126041 jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
JDK-7126041 : jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04

Details
Type:
Bug
Submit Date:
2011-12-30
Status:
Closed
Updated Date:
2012-03-24
Project Name:
JDK
Resolved Date:
2012-03-24
Component:
hotspot
OS:
linux_ubuntu,linux
Sub-Component:
compiler
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs23 (b16)

Related Reports
Backport:
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.7.0_04-ea"
Java(TM) SE Runtime Environment (build 1.7.0_04-ea-b06)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b09, mixed mode)

A DESCRIPTION OF THE PROBLEM :
when running RubyMine with these options
-Xms32m
-Xmx768m
-XX:MaxPermSize=150m
-ea
-verbose:gc
-XX:+PrintCommandLineFlags
-XX:+UseG1GC

it starts, loads for a while, then crash with
[...]
[GC pause (young) 49M->37M(61M), 0,0964380 secs]
[GC pause (mixed) 44M->35M(68M), 0,1227620 secs]
[GC pause (young) 55M->38M(68M), 0,0570140 secs]
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f190634841e, pid=8216, tid=139745050031872
#
# JRE version: 7.0_04-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x2a741e]  GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x3ee
#
# Core dump written. Default location: /home/federicopinionage/works_oa/RubyMine-3.2.4/bin/core or core.8216
#
# An error report file with more information is saved as:
# /home/federicopinionage/works_oa/RubyMine-3.2.4/bin/hs_err_pid8216.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#


ERROR MESSAGES/STACK TRACES THAT OCCUR :
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f190634841e, pid=8216, tid=139745050031872
#
# JRE version: 7.0_04-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x2a741e]  GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x3ee
#
# Core dump written. Default location: /home/federicopinionage/works_oa/RubyMine-3.2.4/bin/core or core.8216
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x0000000001a64800):  JavaThread "C1 CompilerThread1" daemon [_thread_in_native, id=8231, stack(0x00007f18ee00f000,0x00007f18ee110000)]

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x0000000000000030

Registers:
RAX=0x0000000000000000, RBX=0x00007f18f9efc6b0, RCX=0xfffffffffffffff8, RDX=0x0000000000000041
RSP=0x00007f18ee10e240, RBP=0x00007f18ee10e330, RSI=0x00007f18ee10e1c0, RDI=0x00007f18f9efa6f0
R8 =0x00007f1906d4cdc0, R9 =0x0000000000002027, R10=0x000000000250bf10, R11=0x0000000000000001
R12=0x00007f18ee10e350, R13=0x00007f18f9ef9d90, R14=0x0000000000000041, R15=0x00007f18f9ef9610
RIP=0x00007f190634841e, EFLAGS=0x0000000000010217, CSGSFS=0x0000000000000033, ERR=0x0000000000000004
  TRAPNO=0x000000000000000e

  Top of Stack: (sp=0x00007f18ee10e240)
0x00007f18ee10e240:   00007f18ee10e670 00007f18f9ef9610
0x00007f18ee10e250:   0000000000000015 00007f18f9efbbf0
0x00007f18ee10e260:   0000000000000020 00007f18f9ef97e0
0x00007f18ee10e270:   00007f18f9efc3f0 0000000000000015
0x00007f18ee10e280:   00007f18f9efc400 0000000000000015
0x00007f18ee10e290:   0000000000000015 00007f18f9efc410
0x00007f18ee10e2a0:   0000000000000000 00007f19063d9253
0x00007f18ee10e2b0:   0000000001a65070 00007f18f9ef9690
0x00007f18ee10e2c0:   00007f18f9ef9610 00007f18f9ef9690
0x00007f18ee10e2d0:   00007f18f9ef9660 00007f18f8cbd790
0x00007f18ee10e2e0:   00007f18ee10e330 00007f190634f34f
0x00007f18ee10e2f0:   00007f18ee10e330 00007f1906317095
0x00007f18ee10e300:   00007f18ee10e320 00007f18f9ef9690
0x00007f18ee10e310:   00007f18f9ef9610 00007f18f8cbd790
0x00007f18ee10e320:   00007f18f9ef9660 00007f18ee10e670
0x00007f18ee10e330:   00007f18ee10e3f0 00007f190634fb8f
0x00007f18ee10e340:   0000000000000061 000000410199e8c0
0x00007f18ee10e350:   00007f18f9efc3f0 00007f18ee10e670
0x00007f18ee10e360:   00007f18f9efc6b0 00007f18f9ef96b0
0x00007f18ee10e370:   0000000000000000 000000000000009f
0x00007f18ee10e380:   000000000250b820 0000000000000000
0x00007f18ee10e390:   00007f18f9efc480 00007f18f9efc230
0x00007f18ee10e3a0:   000000000250b660 000000000250b710
0x00007f18ee10e3b0:   00000000f805f400 0000000000000550
0x00007f18ee10e3c0:   00007f18ee10e3e0 00007f18f9ef9610
0x00007f18ee10e3d0:   00007f18f9ef95f0 00007f18ee10e670
0x00007f18ee10e3e0:   0000000000000041 00007f18f8cbd790
0x00007f18ee10e3f0:   00007f18ee10e430 00007f190634fc96
0x00007f18ee10e400:   00007f1800000001 00007f18f9ef95f0
0x00007f18ee10e410:   0000000000000041 00007f18ee10e670
0x00007f18ee10e420:   00007f18f8cbd790 0000000001a61b30
0x00007f18ee10e430:   00007f18ee10e4c0 00007f190633219b

Instructions: (pc=0x00007f190634841e)
0x00007f19063483fe:   41 83 fe ff 0f 84 13 fe ff ff 48 8b 85 38 ff ff
0x00007f190634840e:   ff 49 63 d6 48 8b 40 08 48 8b 04 d0 48 8b 40 58
0x00007f190634841e:   44 8b 40 30 45 85 c0 0f 84 f0 fd ff ff 49 8b 7c
0x00007f190634842e:   24 08 48 8d 35 41 4b 5e 00 e8 34 93 fe ff e9 da

Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x00007f18f9efc6b0 is an unknown value
RCX=0xfffffffffffffff8 is an unknown value
RDX=0x0000000000000041 is an unknown value
RSP=0x00007f18ee10e240 is pointing into the stack for thread: 0x0000000001a64800
RBP=0x00007f18ee10e330 is pointing into the stack for thread: 0x0000000001a64800
RSI=0x00007f18ee10e1c0 is pointing into the stack for thread: 0x0000000001a64800
RDI=0x00007f18f9efa6f0 is an unknown value
R8 =0x00007f1906d4cdc0: <offset 0xcabdc0> in /opt/jvm/jdk1.7.0/jre/lib/amd64/server/libjvm.so at 0x00007f19060a1000
R9 =0x0000000000002027 is an unknown value
R10=0x000000000250bf10 is an unknown value
R11=0x0000000000000001 is an unknown value
R12=0x00007f18ee10e350 is pointing into the stack for thread: 0x0000000001a64800
R13=0x00007f18f9ef9d90 is an unknown value
R14=0x0000000000000041 is an unknown value
R15=0x00007f18f9ef9610 is an unknown value


Stack: [0x00007f18ee00f000,0x00007f18ee110000],  sp=0x00007f18ee10e240,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x2a741e]  GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x3ee
V  [libjvm.so+0x2aeb8f]  IRScope::IRScope(Compilation*, IRScope*, int, ciMethod*, int, bool)+0x1df
V  [libjvm.so+0x2aec96]  IR::IR(Compilation*, ciMethod*, int)+0x96
V  [libjvm.so+0x29119b]  Compilation::build_hir()+0x6b
V  [libjvm.so+0x291bfe]  Compilation::compile_java_method()+0x6e
V  [libjvm.so+0x291d60]  Compilation::compile_method()+0x70
V  [libjvm.so+0x2920ce]  Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*)+0x1be
V  [libjvm.so+0x292654]  Compiler::compile_method(ciEnv*, ciMethod*, int)+0xb4
V  [libjvm.so+0x3a5f1f]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x2ef
V  [libjvm.so+0x3a6dad]  CompileBroker::compiler_thread_loop()+0x43d
V  [libjvm.so+0x821668]  JavaThread::thread_main_inner()+0xc8
V  [libjvm.so+0x70a020]  java_start(Thread*)+0x100


Current CompileTask:
C1:  12685  101 %     3       com.intellij.openapi.components.impl.stores.StorageUtil$3::fun @ 65 (178 bytes)


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x000000000224b800 JavaThread "ApplicationImpl pooled thread 7" [_thread_blocked, id=8269, stack(0x00007f18def47000,0x00007f18df048000)]
  0x00000000029a2800 JavaThread "ApplicationImpl pooled thread 6" [_thread_blocked, id=8268, stack(0x00007f18df048000,0x00007f18df149000)]
  0x000000000299f800 JavaThread "ApplicationImpl pooled thread 5" [_thread_blocked, id=8267, stack(0x00007f18df149000,0x00007f18df24a000)]
  0x000000000299d800 JavaThread "ApplicationImpl pooled thread 4" [_thread_blocked, id=8266, stack(0x00007f18df24a000,0x00007f18df34b000)]
  0x000000000299b000 JavaThread "ApplicationImpl pooled thread 3" [_thread_blocked, id=8265, stack(0x00007f18df34b000,0x00007f18df44c000)]
  0x00000000023fd800 JavaThread "Alarm pool(own)" [_thread_blocked, id=8264, stack(0x00007f18df44c000,0x00007f18df54d000)]
  0x00007f18f9212000 JavaThread "SimpleTimer" daemon [_thread_blocked, id=8263, stack(0x00007f18df54d000,0x00007f18df64e000)]
  0x00007f18f92c9000 JavaThread "ApplicationImpl pooled thread 2" [_thread_blocked, id=8262, stack(0x00007f18df64e000,0x00007f18df74f000)]
  0x00007f18f95ac800 JavaThread "AnimatorThread" [_thread_blocked, id=8261, stack(0x00007f18dfd21000,0x00007f18dfe22000)]
  0x00007f18f95a9000 JavaThread "timer-int" daemon [_thread_blocked, id=8260, stack(0x00007f18dfe22000,0x00007f18dff23000)]
  0x00007f18f9568800 JavaThread "TimerQueue" daemon [_thread_blocked, id=8259, stack(0x00007f18dff23000,0x00007f18e0024000)]
  0x000000000208d000 JavaThread "Alarm pool(shared)" [_thread_blocked, id=8258, stack(0x00007f18e0024000,0x00007f18e0125000)]
  0x0000000001c9f800 JavaThread "Alarm pool(own)" [_thread_blocked, id=8257, stack(0x00007f18e0125000,0x00007f18e0226000)]
  0x00007f18f94d1800 JavaThread "FS Synchronizer" [_thread_blocked, id=8256, stack(0x00007f18e0226000,0x00007f18e0327000)]
  0x00007f18f933c000 JavaThread "LowMemoryWatcher" daemon [_thread_blocked, id=8255, stack(0x00007f18e12e9000,0x00007f18e13ea000)]
  0x00007f18f8d99800 JavaThread "XML-RPC Weblistener" [_thread_in_native, id=8254, stack(0x00007f18e160f000,0x00007f18e1710000)]
  0x000000000215d800 JavaThread "Performance watcher" [_thread_blocked, id=8253, stack(0x00007f18e1710000,0x00007f18e1811000)]
  0x000000000215c800 JavaThread "ApplicationImpl pooled thread 1" [_thread_blocked, id=8252, stack(0x00007f18e1811000,0x00007f18e1912000)]
  0x00007f18f8c2e000 JavaThread "ApplicationImpl pooled thread 0" [_thread_blocked, id=8251, stack(0x00007f18e1b1a000,0x00007f18e1c1b000)]
  0x00007f18f8bc5800 JavaThread "Progress Cancel Checker" [_thread_blocked, id=8250, stack(0x00007f18e1c1b000,0x00007f18e1d1c000)]
  0x00007f18f8bae000 JavaThread "Flushing thread" [_thread_blocked, id=8249, stack(0x00007f18e1d1c000,0x00007f18e1e1d000)]
  0x00007f18f88d3800 JavaThread "timed reference disposer" [_thread_blocked, id=8248, stack(0x00007f18e27b1000,0x00007f18e28b2000)]
  0x00007f18f86a7000 JavaThread "Periodic tasks thread" [_thread_blocked, id=8247, stack(0x00007f18ed68f000,0x00007f18ed790000)]
  0x00007f18f8662800 JavaThread "AWT-EventQueue-0 3.2.4#RM-107.612, eap:false" [_thread_in_vm, id=8246, stack(0x00007f18e28b2000,0x00007f18e29b3000)]
  0x00007f18f8660800 JavaThread "AWT-Shutdown" [_thread_blocked, id=8245, stack(0x00007f18e29b3000,0x00007f18e2ab4000)]
  0x00007f18f865e800 JavaThread "SocketListenerThread" [_thread_in_native, id=8244, stack(0x00007f18e2ab4000,0x00007f18e2bb5000)]
  0x00007f18f865d000 JavaThread "SocketListenerThread" [_thread_in_native, id=8243, stack(0x00007f18e2bb5000,0x00007f18e2cb6000)]
  0x00007f18f865c000 JavaThread "MessageDeliveryThread" [_thread_blocked, id=8242, stack(0x00007f18e2cb6000,0x00007f18e2db7000)]
  0x00007f18f843f800 JavaThread "Image Fetcher 0" daemon [_thread_blocked, id=8239, stack(0x00007f18eb301000,0x00007f18eb402000)]
  0x00007f18f8415000 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=8238, stack(0x00007f18eb402000,0x00007f18eb503000)]
  0x00007f18f83d9000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=8237, stack(0x00007f18eb92e000,0x00007f18eba2f000)]
  0x0000000001c7a800 JavaThread "Lock thread" [_thread_in_native, id=8236, stack(0x00007f18ed378000,0x00007f18ed479000)]
  0x0000000001928000 JavaThread "DestroyJavaVM" [_thread_blocked, id=8217, stack(0x00007f1907837000,0x00007f1907938000)]
  0x0000000001b03000 JavaThread "timed reference disposer" [_thread_blocked, id=8234, stack(0x00007f18edcf1000,0x00007f18eddf2000)]
  0x0000000001a67000 JavaThread "Service Thread" daemon [_thread_blocked, id=8232, stack(0x00007f18edf0e000,0x00007f18ee00f000)]
=>0x0000000001a64800 JavaThread "C1 CompilerThread1" daemon [_thread_in_native, id=8231, stack(0x00007f18ee00f000,0x00007f18ee110000)]
  0x0000000001a62800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=8230, stack(0x00007f18ee110000,0x00007f18ee211000)]
  0x0000000001a60000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=8229, stack(0x00007f18ee211000,0x00007f18ee312000)]
  0x0000000001a5e000 JavaThread "Surrogate Locker Thread (Concurrent GC)" daemon [_thread_blocked, id=8228, stack(0x00007f18ee312000,0x00007f18ee413000)]
  0x0000000001a0a000 JavaThread "Finalizer" daemon [_thread_blocked, id=8227, stack(0x00007f18eeaf9000,0x00007f18eebfa000)]
  0x0000000001a08000 JavaThread "Reference Handler" daemon [_thread_blocked, id=8226, stack(0x00007f18fc080000,0x00007f18fc181000)]

Other Threads:
  0x0000000001a00000 VMThread [stack: 0x00007f18fc181000,0x00007f18fc282000] [id=8225]
  0x0000000001a72000 WatcherThread [stack: 0x00007f18ede0d000,0x00007f18edf0e000] [id=8233]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 garbage-first heap   total 69632K, used 42358K [0x00000000c6a00000, 0x00000000cae00000, 0x00000000f6a00000)
  region size 1024K, 7 young (7168K), 3 survivors (3072K)
 compacting perm gen  total 65536K, used 64675K [0x00000000f6a00000, 0x00000000faa00000, 0x0000000100000000)
   the space 65536K,  98% used [0x00000000f6a00000, 0x00000000fa928c08, 0x00000000fa928e00, 0x00000000faa00000)
No shared spaces configured.

Heap Regions: (Y=young(eden), SU=young(survivor), HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TS=gc time stamp, PTAMS=previous top-at-mark-start, NTAMS=next top-at-mark-start)
          F TS     5 PTAMS 0x00000000c6a00000 NTAMS 0x00000000c6a00000 space 1024K,   0% used [0x00000000c6a00000, 0x00000000c6a00000, 0x00000000c6b00000)
          F TS     5 PTAMS 0x00000000c6b00000 NTAMS 0x00000000c6b00000 space 1024K,   0% used [0x00000000c6b00000, 0x00000000c6b00000, 0x00000000c6c00000)
            TS     3 PTAMS 0x00000000c6c00000 NTAMS 0x00000000c6d00000 space 1024K, 100% used [0x00000000c6c00000, 0x00000000c6d00000, 0x00000000c6d00000)
          F TS     3 PTAMS 0x00000000c6d00000 NTAMS 0x00000000c6d00000 space 1024K,   0% used [0x00000000c6d00000, 0x00000000c6d00000, 0x00000000c6e00000)
          F TS     5 PTAMS 0x00000000c6e00000 NTAMS 0x00000000c6e00000 space 1024K,   0% used [0x00000000c6e00000, 0x00000000c6e00000, 0x00000000c6f00000)
            TS     3 PTAMS 0x00000000c6f00000 NTAMS 0x00000000c7000000 space 1024K, 100% used [0x00000000c6f00000, 0x00000000c7000000, 0x00000000c7000000)
          F TS     5 PTAMS 0x00000000c7000000 NTAMS 0x00000000c7000000 space 1024K,   0% used [0x00000000c7000000, 0x00000000c7000000, 0x00000000c7100000)
            TS     3 PTAMS 0x00000000c7100000 NTAMS 0x00000000c7200000 space 1024K, 100% used [0x00000000c7100000, 0x00000000c7200000, 0x00000000c7200000)
          F TS     5 PTAMS 0x00000000c7200000 NTAMS 0x00000000c7200000 space 1024K,   0% used [0x00000000c7200000, 0x00000000c7200000, 0x00000000c7300000)
            TS     0 PTAMS 0x00000000c7400000 NTAMS 0x00000000c7400000 space 1024K, 100% used [0x00000000c7300000, 0x00000000c7400000, 0x00000000c7400000)
          F TS     5 PTAMS 0x00000000c7400000 NTAMS 0x00000000c7400000 space 1024K,   0% used [0x00000000c7400000, 0x00000000c7400000, 0x00000000c7500000)
          F TS     5 PTAMS 0x00000000c7500000 NTAMS 0x00000000c7500000 space 1024K,   0% used [0x00000000c7500000, 0x00000000c7500000, 0x00000000c7600000)
            TS     3 PTAMS 0x00000000c7600000 NTAMS 0x00000000c7700000 space 1024K, 100% used [0x00000000c7600000, 0x00000000c7700000, 0x00000000c7700000)
            TS     3 PTAMS 0x00000000c7700000 NTAMS 0x00000000c7800000 space 1024K, 100% used [0x00000000c7700000, 0x00000000c7800000, 0x00000000c7800000)
          F TS     3 PTAMS 0x00000000c7800000 NTAMS 0x00000000c7800000 space 1024K,   0% used [0x00000000c7800000, 0x00000000c7800000, 0x00000000c7900000)
            TS     3 PTAMS 0x00000000c7900000 NTAMS 0x00000000c7a00000 space 1024K, 100% used [0x00000000c7900000, 0x00000000c7a00000, 0x00000000c7a00000)
          F TS     5 PTAMS 0x00000000c7a00000 NTAMS 0x00000000c7a00000 space 1024K,   0% used [0x00000000c7a00000, 0x00000000c7a00000, 0x00000000c


( This report has more than 16,000 characters and has been truncated. )

                                    

Comments
EVALUATION

Seems to die in the following code in GraphBuilder::GraphBuilder():

 if (osr_bci != -1) {
    BlockBegin* osr_block = blm.bci2block()->at(osr_bci);
    assert(osr_block->is_set(BlockBegin::was_visited_flag),"osr entry must have been visited for osr compile");

    // check if osr entry point has empty stack - we cannot handle non-empty stacks at osr entry points
    if (!osr_block->state()->stack_is_empty()) {
      BAILOUT("stack not empty at OSR entry point");
    }
  }


  2a73fe:       41 83 fe ff             cmp    $0xffffffffffffffff,%r14d
  2a7402:       0f 84 13 fe ff ff       je     2a721b <GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x1eb>
  2a7408:       48 8b 85 38 ff ff ff    mov    -0xc8(%rbp),%rax
  2a740f:       49 63 d6                movslq %r14d,%rdx
  2a7412:       48 8b 40 08             mov    0x8(%rax),%rax
  2a7416:       48 8b 04 d0             mov    (%rax,%rdx,8),%rax
  2a741a:       48 8b 40 58             mov    0x58(%rax),%rax
  2a741e:       44 8b 40 30             mov    0x30(%rax),%r8d         <<<
  2a7422:       45 85 c0                test   %r8d,%r8d
  2a7425:       0f 84 f0 fd ff ff       je     2a721b <GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x1eb>


So, we somehow end up having osr_block->state() == NULL. It would be nice to have a reproducible testcase - I tried running RubyMine it doesn't reproduce.
                                     
2011-12-31
EVALUATION

the current compilation is:
C1:  12685  101 %     3       com.intellij.openapi.components.impl.stores.StorageUtil$3::fun @ 65 (178 bytes)

and it crashes the VM in the GraphBuilder constructor because, as Igor notes in the CR, osr_block->state() is NULL.
What I found is that the OSR block that starts at bci 65 gets disconnected from the graph when it's built because the compiler finds it's unreachable i.e. for every branch that could go to bci 65, it finds it can prove the other branch is always taken. So the state for the osr_block is never built and remains NULL.
When looking at the bytecodes for the method it makes sense that bci 65 is not reachable. Branching to bci 65 happens if Boolean.valueOf() returns a NULL object but Boolean.ValueOf always returns a preallocated object so it can't be null and C1 inlines Boolean.valueOf so it finds that out.
The weird part is that the only back branches in the method are the ones to bci 65 and they can never be taken so we shouldn't OSR compile this method and the root cause is that we try to.

This is the method oop:

$157 = {<oopDesc> = {_mark = 0x1, _metadata = {_klass = 0xf6a01600, _compressed_klass = 4137686528}, static _bs = 0x7ff504000b50}, _constMethod = 0xf806ab80, _constants = 0xf806a6b8, _method_data = 0xf806dea0, _interpreter_invocation_count = 33156, _access_flags = {
    _flags = 16777217}, _vtable_index = -2, _method_size = 17, _max_stack = 4, _max_locals = 5, _size_of_parameters = 2, _intrinsic_id = 0 '\000', _interpreter_throwout_count = 0, _number_of_breakpoints = 0, _invocation_counter = {_counter = 165985,
    static InterpreterInvocationLimit = 80000, static InterpreterBackwardBranchLimit = 10700, static InterpreterProfileLimit = 26400, static _init = {0, 0}, static _action = {0x7ff513298520 <do_nothing(methodHandle, Thread*)>,
      0x7ff513298300 <do_decay(methodHandle, Thread*)>}}, _backedge_counter = {_counter = 163913, static InterpreterInvocationLimit = 80000, static InterpreterBackwardBranchLimit = 10700, static InterpreterProfileLimit = 26400,
    static _init = <same as static member of an already seen type>, static _action = <same as static member of an already seen type>}, _prev_time = 1325527901506, _rate = 2.24134874, _i2i_entry = 0x7ff50ba6d1e0 "\017\267K:\017\267S8+??\372\366\001",
  _adapter = 0x7ff5040c2fe0, _from_compiled_entry = 0x7ff50bf55520 "\211\204$", _code = 0x7ff50bf552d0, _from_interpreted_entry = 0x7ff50ba954e0 "H\213\004$L\213\334H\203\344\360PI\213\303L\213[pH\213p\020H\213P\bI\211\237\b\002"}

This is the methodData oop:

$160 = {<oopDesc> = {_mark = 0x1, _metadata = {_klass = 0xf6a01780, _compressed_klass = 4137686912}, static _bs = 0x7ff504000b50}, _method = 0xf806ac90, _size = 1576, _hint_di = 576, _nof_decompiles = 0, _nof_overflow_recompiles = 0, _nof_overflow_traps = 0,
  _trap_hist = {_align = 0, _array = '\000' <repeats 16 times>}, _eflags = 0, _arg_local = 0, _arg_stack = 0, _arg_returned = 0, _creation_mileage = 255, _invocation_counter = {_counter = 1033, static InterpreterInvocationLimit = 80000,
    static InterpreterBackwardBranchLimit = 10700, static InterpreterProfileLimit = 26400, static _init = {0, 0}, static _action = {0x7ff513298520 <do_nothing(methodHandle, Thread*)>, 0x7ff513298300 <do_decay(methodHandle, Thread*)>}}, _backedge_counter = {_counter = 1,
    static InterpreterInvocationLimit = 80000, static InterpreterBackwardBranchLimit = 10700, static InterpreterProfileLimit = 26400, static _init = <same as static member of an already seen type>, static _action = <same as static member of an already seen type>},
  _invocation_counter_start = 0, _backedge_counter_start = 0, _num_loops = 0, _num_blocks = 39, _highest_comp_level = 2 '\002', _highest_osr_comp_level = 0 '\000', _would_profile = true, _data_size = 1392, _data = {65540}}

The interesting part is that _backedge_counter in the method oop is large but the _backedge_counter in the methodData oop is very small. Also _highest_comp_level = 2. So we're running a c1 version of the code already. What I think happens is that the c1 code for the method at level 2 increments backedge counters incorrectly. The canonicalizer converts some Ifs (the same If that leads to block @bci 65 to be optimized out for the level 3 compile) into Gotos. When it does that:
       set_canonical(new Goto(sux, x->state_before(), x->is_safepoint()));
and x->is_safepoint() is true if:
  bool is_bb = tsux->bci() < stream()->cur_bci() || fsux->bci() < stream()->cur_bci();
So the new Goto is a safepoint if one branch of the If was a back branch but not if the one that we know is always taken is a back branch. In our case the If is changed to a Goto forward but marked as a safepoint. In void LIRGenerator::do_Goto(Goto* x):
  if (x->is_safepoint()) {
  ..
   increment_backedge_counter(info, x->profiled_bci());
  
So we increment and test the backedge counter for a forward branch and end up triggering an OSR compile thinking the branch is a back branch so a branch to bci 65. The code at _from_compiled_entry must be code at level 2 and it has increment&test and calls to the runtime with a bci of a branch to bci 65 passed as an argument.
                                     
2012-02-09
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/80107dc493db
                                     
2012-02-15
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/80107dc493db
                                     
2012-02-18
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/80107dc493db
                                     
2012-03-22



Hardware and Software, Engineered to Work Together