-
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
Conversation
|
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. |
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]>
84c3cad to
f0fd014
Compare
|
jenkins test sanity amac jdk11 |
In Java 25+,
jdk.internal.misc.Unsafe.INVALID_FIELD_OFFSEThas typelong, notint, so aNoSuchFieldErrorwas thrown byGetStaticFieldID()called withinsun.misc.Unsafe.registerNatives()(prior to #22949). 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 underlying issue motivated these related changes:
sun.misc.Unsafe.registerNatives()(Remove useless/problematic code from sun.misc.Unsafe.registerNatives() #22949)trigger.c, with an improvement to error checking (Reserve hooks that are postponed so they can be registered later #22947)Related to RTC 153110.