JDK-8024008 : Nashorn V8 (Crypto) benchmark crashes with small CodeCache size
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2013-08-29
  • Updated: 2013-11-21
  • Resolved: 2013-10-23
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.
Other
tbd_minorResolved
Related Reports
Relates :  
Relates :  
Description
Here are the error logs. The crash appears quite reliably.  In 50 runs of the entire V8 suite, there is a high probability that the crash appears.

Here is the run script:

#!/bin/bash
JAVA_HOME=/java/re/jdk/8/promoted/latest/binaries/linux-amd64/fastdebug
NASHORN=${JAVA_HOME}/jre/lib/ext/nashorn.jar
CC=-XX:ReservedCodeCacheSize=24m
for i in {1..50}
do
  echo $i: $JAVA_HOME $CC >&2
  $JAVA_HOME/bin/java $CC -XX:+TieredCompilation -Dengine=nashorn -XX:+TieredCompilation -jar $NASHORN run.js   
done

Comments
If we generate code for all methods that "must be compiled" (comment argument in CompileBroker::compile_method(..)) the bug does not occur.
11-10-2013

With the change above, the following line reproduces the bug. java -XX:-TieredCompilation -XX:-ShowMessageBoxOnError -XX:-BackgroundCompilation -XX:CICompilerCount=1 -jar nashorn.jar run.js
11-10-2013

The bug can be easily triggered by commenting out the following line in CompileBroker::compile_method(...) // (void) AdapterHandlerLibrary::create_native_wrapper(method, compile_id);
11-10-2013

The bug does not seem to be related to sweeping, The bug occurs only if we disable compilation and a certain wrapper is not generated. I could not reproduce the bug when TieredCompilation is disabled.
10-10-2013

ILW=HLL=P4 8-defer-request: This happens only with a small code cache which is not the default mode of running Nashorn or the JVM. Work around is to increase the code cache. Defer to JDK8 update
09-10-2013

Running nashorn with the above configuration and -XX:+UnlockDiagnosticVMOptions -XX:+VerifyAdapterCalls results in the following error:" i2c adapter must return to an interpreter frame
01-10-2013

The sweeping process seems to be broken. If we comment the following line in process_compile(TRAPS) in ciReplay.cpp the crash goes away. // Make sure the existence of a prior compile doesn't stop this one nmethod* nm = (entry_bci != InvocationEntryBci) ? method->lookup_osr_nmethod_for(entry_bci, comp_level, true) : method->code(); if (nm != NULL) { //nm->make_not_entrant(); } Not yet quite sure why.
09-09-2013