JDK-6782577 : Access Violation + Segmentation Fault in JVM (Hotspot Compiler)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-12-09
  • Updated: 2011-02-16
  • Resolved: 2009-04-03
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)


FULL OS VERSION :
Microsoft Windows XP [Version 5.1.2600]

Linux XXXdesktop 2.6.24-22-generic #1 SMP Mon Nov 24 18:32:42 UTC 2008 i686 GNU/Linux

SunOS io 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-480R



A DESCRIPTION OF THE PROBLEM :
Attached sample code causes access violation exceptions on windows and segmentation faults on linux and solaris.

THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
javac -g:none BugTest.java
java -server BugTest

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
 infinite loop

Actual:
 seg fault

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Attached seperatly


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public final class BugTest {

  public static void main(String[] args) {
    BugTest b = new BugTest();
    while (true) {
      b.crashTimeParty();
    }
  }

  private void crashTimeParty() {
    int i = 0;
    int j = 0;

    if (someThing == 1)
      do {
        if (++i == 10)
          return;
      } while (true);
    else
      // This section isn't actually entered
      do {
        int x = 0;

        // Remove any of these = good.
        o[0] = myJ[x];
        o[0] = myJ[x];
        o[0] = myJ[x];
        o[0] = myJ[x];
        o[0] = myJ[x];
        o[0] = myJ[x];
        o[0] = myJ[x];
        o[0] = myJ[x];
        o[0] = myJ[x];
        
        if (++i == 6) // <=5 good. >=6 bad.
          return;
        
        // Remove this = good.
        o[0] = myJ[x];
      } while (true);
  }

  private int someThing = 1;

  private int o[] = null; // never really referenced.

  static final int[] myJ = new int[256];

  static final int a[] = null; // never really referenced.

}

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

CUSTOMER SUBMITTED WORKAROUND :
Turn of the native compiler - however - our potential customers are interested in seeing the better performance that the compiler offers.

Comments
EVALUATION The crash happens on Solaris too, but only on 32-bit. It happens with: java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode) but it's fixed in: java version "1.6.0_14-ea" Java(TM) SE Runtime Environment (build 1.6.0_14-ea-b04) Java HotSpot(TM) Server VM (build 14.0-b13, mixed mode) A fastdebug build triggers on that assert: # Internal Error (/export0/BUILD_AREA/jdk6_13/hotspot/src/share/vm/opto/superword.cpp:440), pid=210, tid=23[thread 24 also had an error] # Error: assert(in_bb(n),"must be in block") Searching the commit logs it seems this is a duplicate of 6646020. Still validating.
03-04-2009

SUGGESTED FIX -XX:-UseSuperWord
03-04-2009