JDK-6863159 : G1: Reproducible JVM crash with escape analysis and G1
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 6u14
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-07-22
  • Updated: 2013-09-18
  • Resolved: 2009-07-23
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)

FULL OS VERSION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
A specific Scala method crashes when Hotspot tries to compile it but only when the following VM flags are set:
-server -XX:+DoEscapeAnalysis -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC

removing either EA or G1 prevents the crash

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the supplied Scala application

EXPECTED VERSUS ACTUAL BEHAVIOR :
The program should run without crash, the C2 compiler crashes

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Attached seperatly.


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------

case class Vec3(x:Float, y:Float, z:Float)
object Vec3 {
    def min(xs:Iterable[Vec3]):Vec3 = {
        val i = xs.elements
        var Vec3(x,y,z) = i.next
        while(i.hasNext) {
            val v = i.next
            if(v.x < x) x = v.x
            if(v.y < y) y = v.y
            if(v.z < z) z = v.z
        }
        Vec3(x,y,z)
    }

    def main(args:Array[String]) {
        val l = new _root_.scala.collection.mutable.ArrayBuffer[Vec3]
        for(i <- 0 to 80000) l+= Vec3(i,i,i)

        for(j <- 1 to 10) {
            println(min(l))
        }
    }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Disable G1 or EscapeAnalysis

Comments
EVALUATION It's a dup of 6851742, fixed by the compiler group.
23-07-2009