[jdk8u-dev] RFR: 8186787: clang-4.0 SIGSEGV in Unsafe_PutByte [v2]
Andrew John Hughes
andrew at openjdk.org
Thu Mar 6 02:23:02 UTC 2025
On Wed, 26 Feb 2025 13:03:10 GMT, Zdenek Zambersky <zzambers at openjdk.org> wrote:
>> This backport fixes [failures](https://github.com/zzambers/jdk8u-dev/actions/runs/9858657012/job/27221579883) (segfaults) in following tests which appeared after [macos update](https://github.com/openjdk/jdk8u-dev/pull/544):
>>
>> sun/misc/CopyMemory.java
>> compiler/unsafe/OpaqueAccesses.java
>>
>> Backport differs from original changeset, because there were significant changes/refactoring in unsafe.
>>
>> **Notes:**
>> - [original changeset](https://github.com/openjdk/jdk11u-dev/commit/6dc1d8c06d98e127b022886172e16b90bf357c97) changes pointer returned by `addr` (`MemoryAccess` class), to volatile. Otherwise it is basically just refactoring.
>> - `MemoryAccess` is used by `Unsafe_{Set,Put}*` and `Unsafe_{Set,Put}*Volatile` functions, defined using `DEFINE_GETSETOOP` and `DEFINE_GETSETOOP_VOLATILE` macros
>> - jdk8 does not have `MemoryAccess` class, so equivalent pointers, in functions mentioned higher, are cast to volatile, to achieve same effect
>>
>> Testing:
>> Tier1: OK (fixes `sun/misc/CopyMemory.java` and `compiler/unsafe/OpaqueAccesses.java` tests on macos, 1 failure on Linux x86 is timeout - seems unrelated, macos failures explained here: https://github.com/openjdk/jdk8u-dev/pull/544#issuecomment-2250636257)
>
> Zdenek Zambersky 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 two additional commits since the last revision:
>
> - Add comment
> - Unsafe fix
With the absence of [JDK-8150921](https://bugs.openjdk.org/browse/JDK-8150921) in 8u, this is really a backport in spirit than one having much relation to the 11u patch. I appreciate the effort taken here to achieve the same goal in 8u's codebase. I also agree with Andrew Dinn about the value of the comment for explaining this change. As this is handled differently in 11 and later, it's fine to apply that only here.
-------------
Marked as reviewed by andrew (Reviewer).
PR Review: https://git.openjdk.org/jdk8u-dev/pull/553#pullrequestreview-2663070751
More information about the jdk8u-dev
mailing list