[jdk8u-dev] RFR: 8186787: clang-4.0 SIGSEGV in Unsafe_PutByte
Andrew Dinn
adinn at openjdk.org
Wed Feb 26 12:12:02 UTC 2025
On Wed, 26 Feb 2025 11:38:21 GMT, Zdenek Zambersky <zzambers at openjdk.org> wrote:
>> @zzambers @jerboaa
>>
>> Suggestion:
>>
>> I'd really prefer it if we could rename the parameters `jboolean` and `Boolean` in macro `DEFINE_GETSETOOP` to something like `ctypename` and `javatypename` (or maybe just `ctype and javatype`). That makes what is going on much clearer than with the current version -- where, somewhat bizarrely, the parameters are named using the arguments passed at the first call.
>>
>> However, that's not a necessary change and the policy is not to change things that ain't broke. So, I'm not going to push this point. Whatever you feel is appropriate.
>
> @adinn I think passing `volatile` as part of `type_name` would be problematic, because it is also used in `SET_FIELD` macro to derive name of another macro `truncate_##type_name(x)`. Comment sound like a good idea.
Ah, yeah -- that's a shame but I cannot see a way round it.
Ok, so then just place the following comment above the definitions of `GET_FIELD` and `SET_FIELD`
// Note that GET_FIELD and SET_FIELD cast the object field's C type to
// volatile at the point of access. That is needed in order to ensure
// that the C compiler does not reorder the object field access wrt to
// preceding and succeeding volatile accesses to the thread flag field
// (made by UnsafeWrapper) which safeguard the field access. See
// JDK-8186787 for details.
-------------
PR Review Comment: https://git.openjdk.org/jdk8u-dev/pull/553#discussion_r1971474674
More information about the jdk8u-dev
mailing list