RFR: 8308429: jvmti/StopThread/stopthrd007 failed with "NoClassDefFoundError: Could not initialize class jdk.internal.misc.VirtualThreads" [v2]
David Holmes
dholmes at openjdk.org
Fri Sep 29 01:17:09 UTC 2023
On Thu, 28 Sep 2023 21:04:58 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
>> The test fails because ThreadDeath is raised during class jdk.internal.misc.VirtualThreads initialization. The proposed fix is to pre-initialize this step to avoid such failures. See more details in the bug.
>> I reproduced the original problem and verified that it is not reproduced after fix.
>> Tested with tier5 and running nsk/jvmti tests with and without virtual test thread factory.
>>
>> I don't think that more complex fix is needed. There is a plan to review nsk/jvmti stopThread tests and see if
>> ./serviceability/jvmti/vthread/StopThreadTest/StopThreadTest.java
>> might be improved to cover them.
>
> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
>
> missed import added.
This is a reasonable workaround but I think there is a problem with the VirtualThread code that should be changed as well (or even instead). That code should be balanced in park/unpark paths such that any classloading happens on the park path IMO.
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/15966#pullrequestreview-1649889077
More information about the serviceability-dev
mailing list