United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6343401 Crash removing empty loop
JDK-6343401 : Crash removing empty loop

Details
Type:
Bug
Submit Date:
2005-10-28
Status:
Resolved
Updated Date:
2010-04-03
Project Name:
JDK
Resolved Date:
2005-11-30
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.2_10
Fixed Versions:

Related Reports
Backport:
Backport:

Sub Tasks

Description
$ /opt/jdk1.4.2/bin/java -Xcomp -server CommFileAccess

Unexpected Signal : 11 occurred at PC=0xFE103C38
Function=[Unknown. Nearest: JVM_GetMethodIxExceptionTableLength+0x1943C]
Library=/export/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so

Current Java thread:

Dynamic libraries:
0x10000         /opt/jdk1.4.2/bin/java
0xff350000      /usr/lib/libthread.so.1
0xff390000      /usr/lib/libdl.so.1
0xff200000      /usr/lib/libc.so.1
0xff330000      /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
0xfe000000      /export/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
0xff2e0000      /usr/lib/libCrun.so.1
0xff1e0000      /usr/lib/libsocket.so.1
0xff100000      /usr/lib/libnsl.so.1
0xff0d0000      /usr/lib/libm.so.1
0xff1c0000      /usr/lib/libsched.so.1
0xff310000      /usr/lib/libw.so.1
0xff0a0000      /usr/lib/libmp.so.2
0xff050000      /export/home1/jdk1.4.2/jre/lib/sparc/native_threads/libhpi.so
0xfe7d0000      /export/home1/jdk1.4.2/jre/lib/sparc/libverify.so
0xfe790000      /export/home1/jdk1.4.2/jre/lib/sparc/libjava.so
0xff020000      /export/home1/jdk1.4.2/jre/lib/sparc/libzip.so
0xfdfb0000      /usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.2

Heap at VM Abort:
Heap
 def new generation   total 2112K, used 121K [0xf1400000, 0xf1620000, 0xf2950000
)
  eden space 2048K,   5% used [0xf1400000, 0xf141e440, 0xf1600000)
  from space 64K,   0% used [0xf1600000, 0xf1600000, 0xf1610000)
  to   space 64K,   0% used [0xf1610000, 0xf1610000, 0xf1620000)
 tenured generation   total 1408K, used 0K [0xf2950000, 0xf2ab0000, 0xf5400000)
   the space 1408K,   0% used [0xf2950000, 0xf2950000, 0xf2950200, 0xf2ab0000)
 compacting perm gen  total 16384K, used 1077K [0xf5400000, 0xf6400000, 0xf94000
00)
   the space 16384K,   6% used [0xf5400000, 0xf550d538, 0xf550d600, 0xf6400000)

Local Time = Thu Oct 27 15:43:57 2005
Elapsed Time = 6
#
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002EF 01
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.2-b28 compiled mode)
#
# An error report file has been saved as hs_err_pid1455.log.
# Please refer to the file for further information.
#
Abort(coredump)
$
(gdb) bt
#0  0xff369764 in __sigprocmask () from /usr/lib/libthread.so.1
#1  0xff35e978 in _resetsig () from /usr/lib/libthread.so.1
#2  0xff35e118 in _sigon () from /usr/lib/libthread.so.1
#3  0xff361158 in _thrp_kill () from /usr/lib/libthread.so.1
#4  0xff24b908 in raise () from /usr/lib/libc.so.1
#5  0xff2358f4 in abort () from /usr/lib/libc.so.1
#6  0xfe499600 in __1cCosFabort6Fi_v_ () from /export/home1/jdk1.4.2/jre/lib/spa
rc/server/libjvm.so
#7  0xfe497914 in __1cCosbBhandle_unexpected_exception6FpnGThread_ipCpv_v_ () fr
om /export/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#8  0xfe1dad34 in JVM_handle_solaris_signal () from /export/home1/jdk1.4.2/jre/l
ib/sparc/server/libjvm.so
#9  0xff36b82c in __sighndlr () from /usr/lib/libthread.so.1
#10 <signal handler called>
#11 0xfe103c38 in __1cHSubNodeFValue6kMpnOPhaseTransform__pknEType__ () from /ex
port/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#12 0xfe0d2780 in __1cMPhaseIterGVNNtransform_old6MpnENode__2_ () from /export/h
ome1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#13 0xfe19cf20 in __1cMPhaseIterGVNIoptimize6M_v_ () from /export/home1/jdk1.4.2
/jre/lib/sparc/server/libjvm.so
#14 0xfe1c2544 in __1cOPhaseIdealLoop2t6MrnMPhaseIterGVN_pk0i_v_ () from /export
/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#15 0xfe20407c in __1cHCompileIOptimize6M_v_ () from /export/home1/jdk1.4.2/jre/
lib/sparc/server/libjvm.so
#16 0xfe202490 in __1cHCompile2t6MpnFciEnv_pnHciScope_pnIciMethod_iii_v_ () from
 /export/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#17 0xfe1fec9c in __1cKC2CompilerOcompile_method6MpnFciEnv_pnHciScope_pnIciMetho
d_ii_v_ () from /export/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#18 0xfe1fe460 in __1cNCompileBrokerZinvoke_compiler_on_method6FpnLCompileTask__
v_ () from /export/home1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#19 0xfe2ae490 in __1cNCompileBrokerUcompiler_thread_loop6F_v_ () from /export/h
ome1/jdk1.4.2/jre/lib/sparc/server/libjvm.so
#20 0xfe26b0c0 in __1cKJavaThreadDrun6M_v_ () from /export/home1/jdk1.4.2/jre/li
b/sparc/server/libjvm.so
#21 0xfe2675a0 in _start () from /export/home1/jdk1.4.2/jre/lib/sparc/server/lib
jvm.so
(gdb)
$ cat CommFileAccess.java
class CommFileAccess
{
  byte[] cmp_wk = new byte[1024];

  public static void main(String[] args)
  {
    CommFileAccess x = new CommFileAccess();
    byte[] ba = new byte[1];
    x.compressMsg(ba, 0);
  }

  int compressMsg(byte[] ba, int iarg2)
  {
    int i_4;
    int i_5 = 0;
    int i_6 = 0;
    int i_8 = 0;
    byte[] ba_11 = new byte[64];
    int i_13 = 0;
    byte[] ba_14 = new byte[2];

    for (;i_5 < iarg2; i_5++)
    {
      if (10 == ba[iarg2 + i_5])
      {
        if (i_8 > 0)
        {
          memoCopy(cmp_wk, i_13, ba_11, 0, i_8);
        }
        continue;
      }

      for (i_4 = 0; i_4 < (i_6+1); i_4++)
      {
        i_8++;
        memoCopy(cmp_wk, i_13, ba_11, 0, i_8);
        i_13 += i_8;
      }
    }

    memoCopy(cmp_wk, i_13, ba_14, 0, 1);
    i_13++;
    for (i_4 = 0; i_4 < i_13; i_4++) {}
    return i_13;
  }

  static void memoCopy(byte[] ta, int ti, byte[] sa, int si, int len) {
    for (int i = 0; i < len; i++) {
      ta[ti+i] = sa[si+i];
    }
  }
}

                                    

Comments
SUGGESTED FIX

Possible fix:

--- split_if.cpp
***************
*** 115,120 ****
--- 115,121 ----
              register_new_node(x, iff_ctrl);
              _igvn.hash_delete(iff);
              iff->set_req(1, x);
+             _igvn._worklist.push(iff);
            }
            _igvn.remove_dead_node( bol );
            --i;
***************
*** 128,133 ****
--- 129,135 ----
          register_new_node(x, get_ctrl(bol));
          _igvn.hash_delete(bol);
          bol->set_req(1, x);
+         _igvn._worklist.push(bol);
        }
        _igvn.remove_dead_node( n );
        
***************
*** 352,357 ****
--- 354,360 ----
        break;
    _igvn.hash_delete(use);
    use->set_req(i, new_def);
+   _igvn._worklist.push(use);
  }
  
  //------------------------------do_split_if------------------------------------
                                     
2005-11-01
EVALUATION

Nodes modified in split_if are not being placed on the
igvn worklist.  This causes a useless loop to not
be recognized as such because it's exit expression
is not fully optimized.
                                     
2005-11-01
SUGGESTED FIX

/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2005/20051116120148.nips.bug6343401/
http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2005/20051116120148.nips.bug6343401/workspace/webrevs/webrev-2005.11.17/index.html
                                     
2005-11-18



Hardware and Software, Engineered to Work Together