RFR: 7903519 : jtreg/jtharness is missing features for basic crash testing [v4]
Vladimir Sitnikov
vsitnikov at openjdk.org
Thu Dec 14 08:23:58 UTC 2023
On Thu, 14 Dec 2023 08:13:46 GMT, andrlos <duke at openjdk.org> wrote:
>> src/com/sun/javatest/Script.java line 493:
>>
>>> 491: */
>>> 492: private Status tryModifyStatus(Status originalStatus, TestDescription td){
>>> 493: if (statusModifier == null) {
>>
>> `statusModifier` is not `volatile`, so reading the field without synchronization is unsafe
>
> would adding a `volatile` keyword to the atribute be sufficient? I am hesitant to make the tagged method synchronized as that would potentially create a bottleneck
Please check https://shipilev.net/blog/2014/safe-public-construction/#_safe_publication
The code reads `statusModifier` without synchronization, and it might observe uninitialized object. In other words, a `non-null` value does not mean it was fully initialized.
-------------
PR Review Comment: https://git.openjdk.org/jtharness/pull/57#discussion_r1426386063
More information about the jtharness-dev
mailing list