Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6863159

G1: Reproducible JVM crash with escape analysis and G1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 6u14
    • hotspot
    • gc
    • x86
    • windows_xp

      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

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: