-
Notifications
You must be signed in to change notification settings - Fork 776
Postpone registering for exception events #22886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Update to better adhere to our coding standards; no functional changes. Signed-off-by: Keith W. Campbell <[email protected]>
It's not safe to handle exception-related events before JCL initialization has completed. The VM must be capable of properly handling exception dump filters (internally, the offset of Throwable.walkback is required for use by J9VMJAVALANGTHROWABLE_WALKBACK(), etc.), so those hooks are not registered until then. Signed-off-by: Keith W. Campbell <[email protected]>
In Java 25+, jdk.internal.misc.Unsafe.INVALID_FIELD_OFFSET has type long, not int, so a NoSuchFieldError is thrown by GetStaticFieldID(). This occurs before the VM is capable of properly handling exception dump filters (internally, the offset of Throwable.walkback has not been captured for use by J9VMJAVALANGTHROWABLE_WALKBACK(), etc.). If the field exists, it is assigned the value -1, but, in all Java versions, the field would already have that value. This removes the code that is problematic in Java 25+ and just useless in general. Signed-off-by: Keith W. Campbell <[email protected]>
|
jenkins test sanity plinux,amac jdk25 |
|
Pls check out the internal RAS failures http://vmfarm.rtp.raleigh.ibm.com/jobs_by_status.php?build_id=105877&status=FAILED Some of these may be expected, but there are many more failures than usually occur. You can compare against the ibuild. |
|
I expect the failures are related to https://github.com/eclipse-openj9/openj9/blob/master/runtime/rasdump/dmpsup.c#L544-L547 which seems to be negatively affected by the delay installing the exception-related hooks. |
|
I do note that the failures in |
|
I think I'll improve the cleanup part of this and deliver it separately. In draft mode until after that. |
In Java 25+,
jdk.internal.misc.Unsafe.INVALID_FIELD_OFFSEThas typelong, notint, so aNoSuchFieldErroris thrown byGetStaticFieldID()called withinsun.misc.Unsafe.registerNatives(). Normally that error is just ignored, but if a user supplies an-Xdumpoption which requires checking the call stack, that check fails because the offset ofThrowable.walkbackhas not been captured for use byJ9VMJAVALANGTHROWABLE_WALKBACK(), etc. The result is that the lock word (at offset zero after the header) is read and interpreted as a heap reference. On must platforms, the initial lock word is zero which behaves likenullwhichiterateStackTraceImpl()handles as an unavailablewalkbackobject. On POWER, however, the initial lock is normally non-zero (but not a valid heap reference), resulting in a crash.This change avoids problems like this early in the lifetime of a JVM by not registering dump hooks for exception events until after all the known classes, fields and methods have been resolved (including the offset of
Throwable.walkback).The change is organized into three commits:
trigger.c, but no functional changestrigger.cto delay installing hooks for exception-related eventssun.misc.Unsafe.registerNatives()