United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6490942 C2 assert(tp->base() != Type::AnyPtr,"not a bare pointer")
6490942 : C2 assert(tp->base() != Type::AnyPtr,"not a bare pointer")

Details
Type:
Bug
Submit Date:
2006-11-07
Status:
Resolved
Updated Date:
2010-04-03
Project Name:
JDK
Resolved Date:
2006-12-02
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs10

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
After my putback 20061102095649.kvn.6479927 C2 asserts 
during compilation:

#  Internal Error (/net/prt-solsparc-q1-10/tmp/PrtBuildDir/workspace/src/share/vm/opto/machnode.cpp, 333 [ Patched ]), pid=21352, tid=10
#
# Java VM: Java HotSpot(TM) Server VM (20061102195256.steved.main_baseline_to_c2-debug compiled mode)
#
# Error: assert(tp->base() != Type::AnyPtr,"not a bare pointer")
# 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 (0x0018bc00):  JavaThread "CompilerThread1" daemon [_thread_in_native, id=10]

Stack: [0xb5a00000,0xb5a80000),  sp=0xb5a7ca88,  free space=498k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1036820] void VMError::report_and_die() + 0x804
V  [libjvm.so+0x437070] void report_assertion_failure(const char*,int,const char*) + 0x70
V  [libjvm.so+0xb8ec70] const TypePtr*MachNode::adr_type()const + 0x5b4
V  [libjvm.so+0x4eb9e4] Block*insert_anti_dependences(Compile*,Block*,Node*,Block_Array&) + 0x54
V  [libjvm.so+0x4efcc4] void PhaseCFG::schedule_late(VectorSet&,Node_List&,GrowableArray<unsigned>&) + 0xb04
V  [libjvm.so+0x4f0fac] void PhaseCFG::GlobalCodeMotion(Matcher&,unsigned,Node_List&) + 0x4c0
V  [libjvm.so+0x3974f0] void Compile::Code_Gen() + 0x29c
V  [libjvm.so+0x39034c] Compile::Compile(ciEnv*,C2Compiler*,ciMethod*,int,bool)+ 0x1eb8
V  [libjvm.so+0x20287c] void C2Compiler::compile_method(ciEnv*,ciMethod*,int) +0x6c
V  [libjvm.so+0x3ab5f8] void CompileBroker::invoke_compiler_on_method(CompileTask*) + 0x1e38
V  [libjvm.so+0x3a89c8] void CompileBroker::compiler_thread_loop() + 0x15b0
V  [libjvm.so+0xeefefc] void JavaThread::thread_main_inner() + 0x238
V  [libjvm.so+0xeefcac] void JavaThread::run() + 0x598
V  [libjvm.so+0xcb7094] java_start + 0x17c


Current CompileTask:
C2: 62  !b  nsk.serial.Unsafe.getByte_l.getbytel001.run([Ljava/lang/String;Ljava/io/PrintStream;)I (406 bytes)

                                    

Comments
SUGGESTED FIX

Fix TypePtr::singleton() and empty() methods to check _offset.
Remove duplicated singleton() and empty() methods.
Restore AddP conversion of rawptr(NULL+x) to rawptr(x)
for unsafe accesses to remove NULL_PRT.

Webrev:                 http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2006/20061110113531.kvn.6490942/workspace/webrevs/webrev-2006.11.10/index.html
                                     
2006-11-10
EVALUATION

My fix for 6479927 exposed the existing problem.
We can have an address subgraph which looks like this:

 99     CallStaticJava  ===  105  70  29  8  1 ( 113  97  1  1  11  23  1  1  1 24  1  113  72  95  1 ) [[ 114  115  116  118 ]] # Static  sun.misc.Unsafe::allocateMemory long/half ( sun/misc/Unsafe:NotNull:exact *, long, half ) putbytelb001::run @ bci:49 !jvms: putbytelb001::run @ bci:49
 118    Proj    ===  99  [[ 461  360  471  579  461  208  342  183  860  882 ]]#5 !orig=[173],[254] !jvms: putbytelb001::run @ bci:49
 471    ConvL2I === _  118  [[ 472  952  912 ]]  !orig=[774] !jvms: putbytelb001::run @ bci:248
 95     ConP    ===  0  [[ 579  100  108  99  342  128  461  208  360  912 ]]  #NULL
 912    AddP    === _  1  95  471  [[ 908 ]]  !orig=779,[305] !jvms: putbytelb001::run @ bci:140

AddP::Value() gives the type "NULL+bot" for it which is
interpreted as singleton since _ptr is NULL.
So the full expression replaced with
 1042   ConP    ===  0  [[ 908 ]]  #NULL+bot

And this causes the assert.
                                     
2006-11-08



Hardware and Software, Engineered to Work Together