RFR: 8262092: vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t001/TestDescription.java SIGSEGV in memmove_ssse3
Alex Menkov
amenkov at openjdk.java.net
Wed May 5 22:14:52 UTC 2021
On Wed, 5 May 2021 21:01:11 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
>> Class loading can happen on different threads, but HotSwap agent is not ready to this - classCount variable is used without any synchronization.
>> The fix adds synchronization for ClassFileLoadHook.
>
> test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/hotswap/HotSwap.cpp line 110:
>
>> 108: }
>> 109: // use while instead of if to exit the block on error
>> 110: while (classCount < max_classes) {
>
> Could you please explain why this while is executed only once. It is not obvious.
I tried to explain it in the comment :)
it should be "if (classCount < max_classes)",
but inside the if we have return statements and we need to do cleanup (exit monitor).
So I used well-known pattern with 1-pass cycle (note that "return"s are replaced with "break"s)
-------------
PR: https://git.openjdk.java.net/jdk/pull/3889
More information about the serviceability-dev
mailing list