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 16:15:39 UTC 2024
On Wed, 27 Nov 2024 08:33:16 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> Seems we miss initialization of _last_freeze_fail_result in the JavaThread constructor, this should be added.
>> Causes otherwise ubsan issues in the test java/lang/Thread/virtual/MonitorEnterExit.java#Xcomp-TieredStopAtLevel1-LM_LEGACY
>>
>> /priv/jenkins/client-home/workspace/openjdk-jdk-weekly-linux_x86_64-opt/jdk/src/hotspot/share/runtime/javaThread.hpp:1241:52: runtime error: load of value 9831830, which is not a valid value for type 'freeze_result'
>> #0 0x7f5edef378eb in JavaThread::last_freeze_fail_result() src/hotspot/share/runtime/javaThread.hpp:1241
>> #1 0x7f5edef378eb in JVM_VirtualThreadPinnedEvent src/hotspot/share/prims/jvm.cpp:3805
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> add parenthesis, rename variables
@pchilano whould you mind reviewing this small fix?
While it is true that `JavaThread::_last_freeze_fail_result` is not initialized the real problem is that it is not always set when freezing fails. This is fixed and 2 new assertions make sure that result of `freeze_internal` was stored to `JavaThread::_last_freeze_fail_result`.
Might be even better to move setting `JavaThread::_last_freeze_fail_result` up in the call hierarchy and replace the assertions we've added. Let us know what you think.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22361#issuecomment-2511981547
More information about the hotspot-runtime-dev
mailing list