JDK-6650373 : Assert in methodOopDesc::make_adapters().
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2008-01-15
  • Updated: 2011-04-20
  • Resolved: 2011-04-20
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 Other
6u14Fixed hs12Fixed
Description
I hit this assert when running my EA VM with CTW

#  Internal Error (src/share/vm/utilities/growableArray.hpp:173), pid=8075, tid=2
#  Error: assert(0 <= i && i < _len,"illegal index")

CodeCache is full (without EA it is full few methods further) as result
the index to growable array is -2:

address methodOopDesc::make_adapters(methodHandle mh, TRAPS) {
...
  AdapterHandlerEntry* adapter = AdapterHandlerLibrary::get_adapter(mh);
  if (adapter == NULL ) {
    THROW_0(vmSymbols::java_lang_OutOfMemoryError());
  }


class AdapterHandlerLibrary: public AllStatic {
  static GrowableArray<AdapterHandlerEntry*> * _handlers; // the corresponding handlers
...
  static AdapterHandlerEntry* get_entry( int index ) { return _handlers->at(index); }
  static AdapterHandlerEntry* get_adapter(methodHandle method)  { return get_entry(get_create_adapter_index(method)); }


int AdapterHandlerLibrary::get_create_adapter_index(methodHandle method) {
...
    B = BufferBlob::create(AdapterHandlerEntry::name, &buffer);
    if (B == NULL)  return -2;          // Out of CodeCache space

Comments
SUGGESTED FIX 1. AdapterHandlerLibrary::get_create_adapter_index() should return 0 instead of -2. Returning 0 is safe since AdapterHandlerLibrary::_handlers[0] == NULL. 2. Exit immediately if CodeCache is full in method AdapterHandlerLibrary::get_create_adapter_index(). Don't set UseCompiler to false in turn_off_compiler() method to allow VM exit in CompilerBroker::compiler_thread_loop().
25-02-2008

EVALUATION There are few problems here: 0. AdapterHandlerLibrary::get_create_adapter_index() should return 0 (instead of -2) when CodeCache is full. The NULL adaper value is stored in the first array element AdapterHandlerLibrary::_handlers[0]. 1. methodOopDesc::make_adapters() doesn't check that compilation was disabled. It is only check that VM runs with -Xint option. 2. VM doesn't exit immediately if CodeCache is full in methods AdapterHandlerLibrary::get_create_adapter_index() and turn_off_compilser() when VM runs with -XX:+CompileTheWorld or -XX:+ExitOnFullCodeCache.
15-01-2008