RFR: 8344935: [ubsan]: javaThread.hpp:1241:52: runtime error: load of value 9831830, which is not a valid value for type 'freeze_result' [v4]
Richard Reingruber
rrich at openjdk.org
Mon Dec 2 21:17:40 UTC 2024
On Mon, 2 Dec 2024 17:33:21 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
>> src/hotspot/share/runtime/continuationFreezeThaw.cpp line 1686:
>>
>>> 1684: static freeze_result preempt_epilog(JavaThread* current, ContinuationWrapper& cont, freeze_result res, frame& old_last_frame) {
>>> 1685: if (UNLIKELY(res != freeze_ok)) {
>>> 1686: JFR_ONLY(current->set_last_freeze_fail_result(res);)
>>
>> Note that we don’t need to save the result when unmounting from the VM, i.e the preempt case. We return it from `Continuation::try_preempt()` so it is already available when we call `post_vthread_pinned_event()` [1][2]. When unmounting from Java we do need to save it because the call to `post_vthread_pinned_event()` will be done later in `VirtualThread.postPinnedEvent()`, where the return value from the freeze call is not available anymore.
>>
>> [1] https://github.com/openjdk/jdk/blob/30b8bbe255c1653d25961c3fe79096b2b8d62bd6/src/hotspot/share/runtime/objectMonitor.cpp#L603
>> [2] https://github.com/openjdk/jdk/blob/30b8bbe255c1653d25961c3fe79096b2b8d62bd6/src/hotspot/share/runtime/objectMonitor.cpp#L1824
>
> I see. Thanks for making us aware.
This is the complete diff when everything related to the preempt case is reverted again: https://github.com/reinrich/jdk/compare/e29b0edc9739801c8371ac601a466428916d60b4...ce3ddf652a92674c48a061a44636c702c05a35db
@MBaesken could you please check and apply this commit to do the reverting https://github.com/reinrich/jdk/commit/ce3ddf652a92674c48a061a44636c702c05a35db if you're ok with it?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22361#discussion_r1866625596
More information about the hotspot-runtime-dev
mailing list