JDK-6448792 : C2 assert during CTW when CodeCache is near full
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2006-07-13
  • Updated: 2010-04-03
  • Resolved: 2006-11-14
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
6u4Fixed 7Fixed hs10Fixed
Description
During CTW testing on amd64 (-d64) I got the next assert which is reproduced 
with current c2_baseline:

foundation% /tmp/kvn/jdk1.6.0/fastdebug/bin/java -d64 -Xss4m -verify -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=8193 -Xbootclasspath/p:/net/vmsqe.sfbay/export/backup/testbase/CompileTheWorld/jarfiles/weblogicbig.jar
...
CompileTheWorld (10929) : weblogic/management/internal/RemoteRealmManagerImpl
CompileTheWorld (10930) : weblogic/management/internal/RemoteRealmManagerImpl_WLSkel
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/assembler.cpp:108]
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (/net/prt-solamd64-q1-2/PrtBuildDir/workspace/src/share/vm/asm/assembler.cpp, 108), pid=24021, tid=11
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20060710121006.kvn.main_to_c2_baseline-debug mixed mode)
#
# Error: assert(_code_section == code()->consts(),"not in consts?")
# An error report file with more information is saved as hs_err_pid24021.log
#

It passed with -XX:ReservedCodeCacheSize=50m (default 48m).

Comments
SUGGESTED FIX PRT webrev: http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2006/20061006160603.rasbold.c2_baseline/workspace/webrevs/webrev-2006.10.06/index.html
09-10-2006

EVALUATION The VM detects a full code cache on a call to start_a_const(), which returns NULL. The caller adds no constant data, but still mistakenly calls end_a_const(). End_a_const() asserts because the failing start_a_const() never switched over to the const section.
19-07-2006

SUGGESTED FIX Fix end_of_const() call sites to only be reached if the matching start_a_const() returns a non-NULL value.
19-07-2006