JDK-8214583 : AccessController.getContext may return wrong value after JDK-8212605
Type:Bug
Component:security-libs
Sub-Component:java.security
Affected Version:12
Priority:P2
Status:Closed
Resolution:Fixed
Submitted:2018-12-01
Updated:2024-04-15
Resolved:2018-12-19
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.
The immediate cause is that C2 and Graal can eliminate allocations if it can be determined that they do not "escape". However, getContext relies on there being a concrete context object to retrieve.
C2 workaround: -XX:-EliminateAllocations
Graal workaround: -Dgraal.PartialEscapeAnalysis=false