United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6459670 C2 segv running jlapack
JDK-6459670 : C2 segv running jlapack

Details
Type:
Bug
Submit Date:
2006-08-11
Status:
Resolved
Updated Date:
2010-04-03
Project Name:
JDK
Resolved Date:
2006-08-25
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P1
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
The latest 1.6 C2 SEGV running jlapack-0.6.

Tom peeled out a test case into a small jar file that fails with CompileTheWorld.

foundation% /java/re/jdk/1.6.0/promoted/latest/binaries/solaris-i586/fastdebug/bin/java -server -XX:+PrintCompilation -Xbootclasspath/p:dla.jar -XX:+CompileTheWorld
VM option '+PrintCompilation'
VM option '+CompileTheWorld'
CompileTheWorld : Compiling all classes in /tmp/kvn/prof/dla.jar

CompileTheWorld (1) : RandomReturn
  1   b   RandomReturn::getChar (5 bytes)
  2   b   RandomReturn::<init> (5 bytes)
  3   b   RandomReturn::<clinit> (11 bytes)
  4   b   RandomReturn::nextInt (7 bytes)
  5   b   RandomReturn::nextDouble (7 bytes)
  6   b   RandomReturn::nextLong (7 bytes)
  7   b   RandomReturn::nextBoolean (7 bytes)
  8   b   RandomReturn::nextFloat (7 bytes)
CompileTheWorld (2) : doubleW
  9   b   doubleW::<init> (10 bytes)
CompileTheWorld (3) : intW
 10   b   intW::<init> (10 bytes)
CompileTheWorld (4) : Dlatms
 11   b   Dlatms::<init> (5 bytes)
 12   b   Dlatms::dlatms (7637 bytes)
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xfe1c9305, pid=19403, tid=12
#
# Java VM: Java HotSpot(TM) Server VM (1.6.0-rc-fastdebug-b95-debug mixed mode)
# Problematic frame:
# V  [libjvm.so+0x9c9305]
#
# An error report file with more information is saved as hs_err_pid19403.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 ...
Abort
foundation% hs_err hs_err_pid19403.log
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xfe1c9305, pid=19403, tid=12
#
# Java VM: Java HotSpot(TM) Server VM (1.6.0-rc-fastdebug-b95-debug mixed mode)
# Problematic frame:
# V  [libjvm.so+0x9c9305]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

---------------  T H R E A D  ---------------

Current thread (0x081bdc00):  JavaThread "CompilerThread1" daemon [_thread_in_native, id=12]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000020

Registers:
EAX=0x00000000, EBX=0xfec2f628, ECX=0x7fffffff, EDX=0x00000002
ESP=0xb59fd864, EBP=0xb59fd890, ESI=0x08968128, EDI=0x0836985c
EIP=0xfe1c9305, EFLAGS=0x00010202

Top of Stack: (sp=0xb59fd864)
0xb59fd864:   08968510 08968510 fec2f628 fea45036
0xb59fd874:   0000009d b59fe9a0 fed11298 0811cc68
0xb59fd884:   0000000e 08968510 00000003 b59fd8d4
0xb59fd894:   fe0ff0c4 08968510 b59fe9a0 00000001
0xb59fd8a4:   089680c8 b59fe9a0 fec2f628 00000020
0xb59fd8b4:   081bdc00 089679e0 fec2f628 b59fe9e0
0xb59fd8c4:   fec68468 fe1c9194 00000001 b59fe9a0
0xb59fd8d4:   b59fd904 fe0fee56 b59fe9a0 089680c8

Instructions: (pc=0xfe1c9305)
0xfe1c92f5:   83 7e 10 01 0f 86 38 0f 00 00 8b 46 04 8b 40 04
0xfe1c9305:   0f b7 40 20 83 e0 7f 83 f8 60 0f 85 d1 00 00 00

Stack: [0xb59c0000,0xb5a00000),  sp=0xb59fd864,  free space=246k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x9c9305] Node*SubINode::Ideal(PhaseGVN*,bool) + 0x171
V  [libjvm.so+0x8ff0c4] Node*PhaseIterGVN::transform_old(Node*) + 0x218
V  [libjvm.so+0x8fee56] Node*PhaseIterGVN::transform(Node*) + 0xbe
V  [libjvm.so+0x12d0f6] Node*AddNode::Ideal(PhaseGVN*,bool) + 0x1ee
V  [libjvm.so+0x12e255] Node*AddINode::Ideal(PhaseGVN*,bool) + 0x7ed
V  [libjvm.so+0x8ff0c4] Node*PhaseIterGVN::transform_old(Node*) + 0x218
V  [libjvm.so+0x8fee56] Node*PhaseIterGVN::transform(Node*) + 0xbe
V  [libjvm.so+0x7b939b] Node*PhaseIdealLoop::is_counted_loop(Node*,IdealLoopTree*) + 0x14a7
V  [libjvm.so+0x7beac0] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0x6c
V  [libjvm.so+0x7bf488] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa34
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf49b] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa47
V  [libjvm.so+0x7bf488] void IdealLoopTree::counted_loop(PhaseIdealLoop*) + 0xa34
V  [libjvm.so+0x7c0047] PhaseIdealLoop::PhaseIdealLoop(PhaseIterGVN&,const PhaseIdealLoop*,bool) + 0x72b
V  [libjvm.so+0x2af0c9] void Compile::Optimize() + 0x26d
V  [libjvm.so+0x2ab546] Compile::Compile(ciEnv*,C2Compiler*,ciMethod*,int,bool)+ 0xb9a
V  [libjvm.so+0x1a3228] void C2Compiler::compile_method(ciEnv*,ciMethod*,int) +0x68
V  [libjvm.so+0x2bd9bc] void CompileBroker::invoke_compiler_on_method(CompileTask*) + 0xbd0
V  [libjvm.so+0x2bc5cc] void CompileBroker::compiler_thread_loop() + 0x798
V  [libjvm.so+0xa2a512] void compiler_thread_entry(JavaThread*,Thread*) + 0x2a
V  [libjvm.so+0xa2346e] void JavaThread::thread_main_inner() + 0x16e
V  [libjvm.so+0xa23218] void JavaThread::run() + 0x358
V  [libjvm.so+0x896037] java_start + 0xe3
C  [libc.so.1+0x9f6f8] _thr_setup + 0x4e
C  [libc.so.1+0x9f9e0] _lwp_start + 0x0


Current CompileTask:
opto: 12   b  Dlatms.dlatms(IILjava/lang/String;[IILjava/lang/String;[DIIDDIILjava/lang/String;[DII[DILintW;)V (7637 bytes)


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x081c0000 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=13]
=>0x081bdc00 JavaThread "CompilerThread1" daemon [_thread_in_native, id=12]
  0x081bc400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=11]
  0x081bac00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=10]
  0x08199c00 JavaThread "Finalizer" daemon [_thread_blocked, id=9]
  0x08198c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=8]
  0x08083c00 JavaThread "main" [_thread_blocked, id=2]

Other Threads:
  0x08194c00 VMThread [id=7]
  0x081c2400 WatcherThread [id=14]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 PSYoungGen      total 12544K, used 215K [0xf3000000, 0xf3e00000, 0xfa200000)
  eden space 10752K, 2% used [0xf3000000,0xf3035c38,0xf3a80000)
  from space 1792K, 0% used [0xf3c40000,0xf3c40000,0xf3e00000)
  to   space 1792K, 0% used [0xf3a80000,0xf3a80000,0xf3c40000)
 PSOldGen        total 110592K, used 0K [0xba000000, 0xc0c00000, 0xf3000000)
  object space 110592K, 0% used [0xba000000,0xba000000,0xc0c00000)
 PSPermGen       total 16384K, used 1642K [0xb6000000, 0xb7000000, 0xba000000)
  object space 16384K, 10% used [0xb6000000,0xb619a870,0xb7000000)


VM Arguments:
jvm_args: -XX:+PrintCompilation -Xbootclasspath/p:dla.jar -XX:+CompileTheWorld
java_command: <unknown>
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=/export/home/kvn/jdk1.6.0_b84
CLASSPATH=/net/jaberwocky/export/home2/work/6380525/build/solaris
PATH=/java/devtools/i386/SUNWspro/SS11/bin:./:/home/kvn/bin:/bin:/usr/j2se/bin:/
usr/dt/bin:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/usr/lib:/usr/sbin:/usr/ucb:/usr/u
cb/bin:/sbin:/etc:/usr/openwin/bin:/opt/SUNWspro/bin:/set/misc/local/bin:.
LD_LIBRARY_PATH=/net/jre.sfbay/p/v06/jdk/6.0/rc/b95/binaries/solaris-i586/fastde
bug/jre/lib/i386/server:/net/jre.sfbay/p/v06/jdk/6.0/rc/b95/binaries/solaris-i58
6/fastdebug/jre/lib/i386:/net/jre.sfbay/p/v06/jdk/6.0/rc/b95/binaries/solaris-i5
86/fastdebug/jre/../lib/i386:.
SHELL=/bin/csh

Signal Handlers:
SIGSEGV: [libjvm.so+0xafb4e0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGBUS: [libjvm.so+0xafb4e0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGFPE: [libjvm.so+0x89b474], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGPIPE: [libjvm.so+0x89b474], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGILL: [libjvm.so+0x89b474], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGHUP: [libjvm.so+0x898498], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGINT: [libjvm.so+0x898498], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGQUIT: [libjvm.so+0x898498], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGTERM: [libjvm.so+0x898498], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGQUIT: [libjvm.so+0x898498], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGTERM: [libjvm.so+0x898498], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIG39: [libjvm.so+0x89b4a0], sa_mask[0]=0x00000000, sa_flags=0x00000008
SIG40: [libjvm.so+0x89b474], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c


---------------  S Y S T E M  ---------------

OS:                          Solaris 10 3/05 s10_74L2a X86
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 22 January 2005

uname:SunOS 5.10 Generic_118844-28 i86pc  (T2 libthread)
rlimit: STACK 10240k, CORE 0k, NOFILE 65536, AS infinity
load average:1.28 1.61 2.38

CPU:total 4 family 15, cmov, cx8, fxsr, mmx, sse, sse2, mmxext, 3dnowext, 3dnow

Memory: 4k page, physical 7928872k(1839560k free)

vm_info: Java HotSpot(TM) Server VM (1.6.0-rc-fastdebug-b95) for solaris-x86, bu
ilt on Aug 10 2006 02:31:06 by "" with unknown Workshop:0x580

foundation%

                                    

Comments
EVALUATION

The problem is in C2 design. It allows to delete a new Ideal node
during IGVN transformation before the node is used.
We usually use hook nodes to prevent such situations.
But we missed the bug case when it happens due to the node hashing 
and reusing it during transformation:

  // Global Value Numbering
  i = hash_find_insert(k);      // Check for pre-existing node
  if( i && (i != k) ) {
    // Return the pre-existing node if it isn't dead
    NOT_PRODUCT( set_progress(); )
    add_users_to_worklist( k );
    subsume_node( k, i );       // Everybody using k now uses i
    return i;
  }
                                     
2006-08-12
SUGGESTED FIX

Hook new nodes to keep them alive during IGVN transformation.

Webrev:                 http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/1.6/rc/baseline/2006/20060818164951.kvn.6459670_1.6/workspace/webrevs/webrev-2006.08.18/index.html
                                     
2006-08-19



Hardware and Software, Engineered to Work Together