-
Enhancement
-
Resolution: Fixed
-
P4
-
11, 15
-
b15
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8242768 | 11.0.8-oracle | Douglas Simon | P4 | Resolved | Fixed | b03 |
The way TranslatedExceptions are currently printed can be very confusing. For example:
Caused by: jdk.vm.ci.hotspot.TranslatedException: [java.lang.ClassNotFoundException: java.security.AccessControlException] access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
means that when translating an AccessControlException from the HotSpot heap to the libgraal heap, an AccessControlException instance could not be created in the libgraal heap as Class.forName("java.security.AccessControlException") failed (libgraal has very limited reflection). If this exception is raised while loading some other class, the ClassNotFoundException part of the exception trace can be very confusing.
There's no need to show the reason a translation failed; only the name of original, non-instantiable exception class needs to be shown:
Caused by: jdk.vm.ci.hotspot.TranslatedException[java.security.AccessControlException]: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
By putting the original exception class name to the left of the ":" makes it clearer what is going on.
https://github.com/graalvm/labs-openjdk-11/commit/79940e44f174601b3df0afcd992725ffea63f247
Caused by: jdk.vm.ci.hotspot.TranslatedException: [java.lang.ClassNotFoundException: java.security.AccessControlException] access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
means that when translating an AccessControlException from the HotSpot heap to the libgraal heap, an AccessControlException instance could not be created in the libgraal heap as Class.forName("java.security.AccessControlException") failed (libgraal has very limited reflection). If this exception is raised while loading some other class, the ClassNotFoundException part of the exception trace can be very confusing.
There's no need to show the reason a translation failed; only the name of original, non-instantiable exception class needs to be shown:
Caused by: jdk.vm.ci.hotspot.TranslatedException[java.security.AccessControlException]: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.misc")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
By putting the original exception class name to the left of the ":" makes it clearer what is going on.
https://github.com/graalvm/labs-openjdk-11/commit/79940e44f174601b3df0afcd992725ffea63f247
- backported by
-
JDK-8242768 [JVMCI] improve TranslatedException traces
- Resolved