RFR: 8295099: vmTestbase/nsk/stress/strace/strace013.java failed with "TestFailure: wrong lengths of stack traces: strace013Thread0: NNN strace013Thread83: MMM"
David Holmes
dholmes at openjdk.org
Mon Nov 7 12:24:31 UTC 2022
On Mon, 7 Nov 2022 07:04:27 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> The test is incorrectly synchronized and may take the stack trace of a thread before it has entered the wait() and thus be three frames short of the correct stack. So I cleaned that up to ensure things are correctly synchronized.
>>
>> A number of comments in the test description etc were wrong so I also fixed those.
>>
>> These tests are stylistically awful but I refrained from embarking on a major cleanup and adopted the prevailing styles.
>>
>> Testing: local plus 50x on each platform (in progress)
>>
>> Thanks.
>
> This looks fine.
>
> About that check at Line 171ff, where the test first compares stack lengths, I wonder whether the "k>2" was wiggle room for the problem you now solve? Could not explain it otherwise. If yes, you could probable require the length to be just equal now.
>
> A CountDownLatch may make the coding a bit clearer maybe.
Thanks @tstuefe !
> I wonder whether the "k>2" was wiggle room for the problem you now solve? Could not explain it otherwise. If yes, you could probable require the length to be just equal now.
Yes I think you are right. I'll try making that change - though I'm loathe to spend too much time trying to clean this up as the more you look the more you find.
> A CountDownLatch may make the coding a bit clearer maybe.
Possibly it could avoid the sleep loop, but we still need a sync-block to guarantee the last thread is in the wait(). I'll stick with the current crude mechanism.
-------------
PR: https://git.openjdk.org/jdk/pull/11011
More information about the hotspot-runtime-dev
mailing list