JDK-6855164 : SIGSEGV during compilation of method involving loop over CharSequence
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6u10,6u16
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,linux_ubuntu,solaris_10
  • CPU: x86,sparc
  • Submitted: 2009-06-25
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u18Fixed 7Fixed hs16Fixed
Related Reports
Duplicate :  
Relates :  
(hs_err file text removed because it was too large.  It will be added as an attachment)

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) {
    while (seek > 0) {
      if (sb.charAt(seek) == ' ') {
        while (seek > 0 && sb.charAt(seek - 1) == ' ')
        return seek;
    return 0;

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

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.

EVALUATION Verified (in JDK 7 b65 PIT)

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

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

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.

WORK AROUND run with -XX:-SplitIfBlocks

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)