United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6855164 SIGSEGV during compilation of method involving loop over CharSequence
JDK-6855164 : SIGSEGV during compilation of method involving loop over CharSequence

Details
Type:
Bug
Submit Date:
2009-06-25
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
linux_ubuntu,linux,solaris_10
Sub-Component:
compiler
CPU:
x86,sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10,6u16
Fixed Versions:
hs16 (b06)

Related Reports
Backport:
Backport:
Duplicate:
Relates:

Sub Tasks

Description
(hs_err file text removed because it was too large.  It will be added as an attachment)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
class Crasher{
  public static void main(String[] args) throws Exception{
    StringBuffer builder = new StringBuffer();

    for(int i = 0; i < 100; i++)
      builder.append("I am the very model of a modern major general\n");

    for(int j = 0; j < builder.length(); j++){
      previousSpaceIndex(builder, j);
    }
  }

  private static final int previousSpaceIndex(CharSequence sb, int seek) {
    seek--;
    while (seek > 0) {
      if (sb.charAt(seek) == ' ') {
        while (seek > 0 && sb.charAt(seek - 1) == ' ')
          seek--;
        return seek;
      }
      seek--;
    }
    return 0;
  }
}

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

CUSTOMER SUBMITTED WORKAROUND :
I have not found one yet.
Running this test case using the fastdebug build fails an assertion:

% /opt/java/jdk1.7.0-b59/fastdebug/bin/java  -server -d64 -showversion -Xbatch -XX:+PrintCompilation Crasher
VM option '+PrintCompilation'
java version "1.7.0-ea-fastdebug"
Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b59)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b03-fastdebug, mixed mode)

  1 s b   java.lang.StringBuffer::charAt (28 bytes)
  2   b   Crasher::previousSpaceIndex (53 bytes)
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/split_if.cpp:113
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/BUILD_AREA/jdk7/hotspot/src/share/vm/opto/split_if.cpp:113), pid=21575, tid=12
#  Error: assert(bol->is_Bool(),"")
#
# JRE version: 7.0-b59
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0-b03-fastdebug mixed mode solaris-amd64 )
# An error report file with more information is saved as:
# /var/tmp/tbell/pub/tmpjava/hs_err_pid21575.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Current thread is 12
Dumping core ...
zsh: IOT instruction (core dumped)  /opt/java/jdk1.7.0-b59/fastdebug/bin/java -server -d64 -showversion -Xbatch  




See the attached file (hs_err.html) for more information.

                                    

Comments
WORK AROUND

1) Run with the -client flag to select the client compiler

2) Run with the -Xcomp flag.  (This us usually not a great idea, but it does avoid this crash)
                                     
2009-06-25
WORK AROUND

run with -XX:-SplitIfBlocks
                                     
2009-07-01
EVALUATION

The regressin started from Steve's work on 6385730. The work exposed more opportunities
for split_if_with_blocks. Unfortunately, we could not split a block if it contains a
FastLockNode with a PhiNode as input because the FastLockNode could not be moved around.
The easy fix is that we don't split such blocks.
                                     
2009-07-02
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/0f2d888530e7
                                     
2009-07-03
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/0f2d888530e7
                                     
2009-07-11
EVALUATION

Verified (in JDK 7 b65 PIT)
                                     
2009-07-13



Hardware and Software, Engineered to Work Together