RFR: 8318462: [GenShen] Prevent unsafe access to displaced mark-word [v3]
Kelvin Nilsen
kdnilsen at openjdk.org
Thu Oct 26 16:28:35 UTC 2023
On Thu, 26 Oct 2023 16:03:12 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:
>> Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>>
>> - Fix inflating check with LW locking
>> - Merge branch 'master' into JDK-8318462
>> - Accept all-zero header with LW locking
>> - Handle forwarded headers
>> - Assert that no inflation happens
>> - 8318462: [Shenandoah] Prevent unsafe access to displaced mark-word
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 544:
>
>> 542: // is thread-local and therefore safe to access. However, when the mark is
>> 543: // displaced (i.e. stack-locked or monitor-locked), then it must be considered
>> 544: //a shared memory location. It can/ be accessed by other threads.
>
> Minor formatting issues in this line of comment.
and below.
> src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp line 123:
>
>> 121: assert(region->is_young(), "Only for young objects");
>> 122: uint age = ShenandoahHeap::get_object_age(obj);
>> 123: CENSUS_NOISE(heap->age_census()->add(age, region->age(), region->youth(), size, worker_id);)
>
> I'm thinking if get_object_age() returns max_age+1, the CENSUS_NOISE macros might end up with invalid data. Don't we need a check here?
I think the safe thing to do is treat max_age+1 as if it were 0, insofar as promotion semantics is concerned. We may delay promotion that way.
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/343#discussion_r1373431845
PR Review Comment: https://git.openjdk.org/shenandoah/pull/343#discussion_r1373436928
More information about the shenandoah-dev
mailing list