RFR: 8222895: StackOverflowError in custom security manager that relies on ClassSpecializer
claes.redestad at oracle.com
Wed Apr 24 12:49:13 UTC 2019
recent changes to the String concatenation bootstrap sequence
accidentally uncovered an issue introduced earlier by changing the
ClassSpecializer to use Lookup.defineClass.
The issue with this is the introduction of a call to SM.checkPermission
deep inside the ClassSpecializer code used when bootstrapping certain
String concatenation expressions. When triggered, this causes a
recursive bootstrap cycle and a crash with a StackOverflowError.
This is related to earlier bootstrapping issues in the area, and
would have been caught by the regression test added then if not for the
fact that we've been rather successful in avoiding the use of
ClassSpecializer during bootstrap of commonly used concatenation shapes.
Providing a more contorted concatenation shape in the test ensures we
drop into the ClassSpecializer code path where the recursive
checkPermission call happens. The updated test passes before
JDK-8181443, fails since, and passes with the changes proposed in this
Testing: tier1-3 (still in-flight), local verification
More information about the core-libs-dev