JDK-8066292 : Test java/nio/file/Files/CheckPermissions.java triggers stack overflow with -server -Xcomp
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2014-12-01
  • Updated: 2021-09-22
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
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Apparently because of its use of a custom SecurityManager, the nio CheckPermissions test causes
infinite recursion and eventually a StackOverflowError when run with -Xcomp.

% b40/fastdebug/bin/java -server -XX:-TieredCompilation -Xcomp -XX:+TraceExceptions -cp classes/ CheckPermissions >& L
% egrep StackOverflowError L | wc
     14     146    1799

This problem showed up previously with C1, and something in C1 was fixed, but the problem still shows up with C2, and test has not been fixed.  We should check if the test is making bad assumptions about class loading, or if -Xcomp is changing the semantics.  In other words, even if the test passes, the infinite recursion causes the test to run longer than necessary, and could be causing it to short-circuit some checks.
Comments
ROFL! I can't even remember what my question was ;-)
12-02-2016

[~twisti] Yup
12-02-2016

Is Method::load_signature_classes() called before the method is queued?
02-02-2015

Narrowed it down to one method: -server -XX:-TieredCompilation -Xcomp -XX:+TraceExceptions '-XX:CompileCommand=compileonly,CheckPermissions$1.initialValue' -cp classes/ CheckPermissions In Method::load_signature_classes(), we ignore LinkageError and ClassNotFoundException, but StackOverflowError still causes a problem. The StackOverflowError is because C2 does eager classloading, so we end up calling CompileBroker::compile_method() --> Method::load_signature_classes() --> [...] --> CompileBroker::compile_method() recursively for the same method, until eventually we get a stack overflow. Would it be reasonable for CompileBroker::compile_method() to return immediately for recursive calls on the same method?
02-02-2015

ILW=SOE;C2, haven't seen in our testing -- unclear which enviroment is needed to reproduce;none=MLH=>P4
02-12-2014

[~dlong], I'm not able to reproduce it. can you please provide your log file?
02-12-2014