JDK-8344935 : [ubsan]: javaThread.hpp:1241:52: runtime error: load of value 9831830, which is not a valid value for type 'freeze_result'
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: generic
  • Submitted: 2024-11-25
  • Updated: 2024-11-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
The test  java/lang/Thread/virtual/MonitorEnterExit.java#Xcomp-TieredStopAtLevel1-LM_LEGACY shows this issue when running
with ubsanized binaries on Linux x86_64 :

command: junit -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
reason: User specified action: run junit/othervm -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit 
started: Mon Nov 25 01:53:28 CET 2024
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base,jdk.management --add-exports java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
finished: Mon Nov 25 01:53:33 CET 2024
elapsed time (seconds): 5.174
----------configuration:(5/147)----------
Boot Layer
  add modules: java.base jdk.management 
  add exports: java.base/java.lang ALL-UNNAMED
  add opens:   java.base/java.lang ALL-UNNAMED

----------System.out:(0/0)----------
----------System.err:(35/3476)----------
OpenJDK 64-Bit Server VM warning: Option LockingMode was deprecated in version 24.0 and will likely be removed in a future release.
STARTED    MonitorEnterExit::testParkingPermitNotOffered 'testParkingPermitNotOffered()'
SUCCESSFUL MonitorEnterExit::testParkingPermitNotOffered 'testParkingPermitNotOffered()'
STARTED    MonitorEnterExit::testEnterNoContention 'testEnterNoContention()'
SUCCESSFUL MonitorEnterExit::testEnterNoContention 'testEnterNoContention()'
SKIPPED    MonitorEnterExit::testReleaseWhenBlocked 'testReleaseWhenBlocked()' @DisabledIf("LockingMode#isLegacy") evaluated to true
STARTED    MonitorEnterExit::testContendedEnterWhenPinnedHeldByPlatformThread 'testContendedEnterWhenPinnedHeldByPlatformThread()'
SUCCESSFUL MonitorEnterExit::testContendedEnterWhenPinnedHeldByPlatformThread 'testContendedEnterWhenPinnedHeldByPlatformThread()'
STARTED    MonitorEnterExit::testContendedEnterWhenPinnedHeldByVirtualThread 'testContendedEnterWhenPinnedHeldByVirtualThread()'
SUCCESSFUL MonitorEnterExit::testContendedEnterWhenPinnedHeldByVirtualThread 'testContendedEnterWhenPinnedHeldByVirtualThread()'
STARTED    MonitorEnterExit::testEnterWhenHeldByPlatformThread 'testEnterWhenHeldByPlatformThread()'
SUCCESSFUL MonitorEnterExit::testEnterWhenHeldByPlatformThread 'testEnterWhenHeldByPlatformThread()'
STARTED    MonitorEnterExit::testReenterWhenPinned 'testReenterWhenPinned()'
SUCCESSFUL MonitorEnterExit::testReenterWhenPinned 'testReenterWhenPinned()'
STARTED    MonitorEnterExit::testEnterWhenHeldByVirtualThread 'testEnterWhenHeldByVirtualThread()'
SUCCESSFUL MonitorEnterExit::testEnterWhenHeldByVirtualThread 'testEnterWhenHeldByVirtualThread()'
STARTED    MonitorEnterExit::testUnblockingByVirtualThread 'repetition 1 of 20'
/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
    #2 0x7f5ec9039688  (<unknown module>)
    #3 0x7f5ec90392eb  (<unknown module>)
    #4 0x7f5ec90376d3  (<unknown module>)
    #5 0x7f5ec8e5c183  (<unknown module>)
    #6 0x7f5ec8e5999b  (<unknown module>)
    #7 0x7f5ee0cb6ad3 in JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) src/hotspot/share/runtime/javaCalls.cpp:421
    #8 0x7f5ee0cbae27 in JavaCalls::call(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) src/hotspot/share/runtime/javaCalls.cpp:329
    #9 0x7f5ee0cbae27 in JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) src/hotspot/share/runtime/javaCalls.cpp:185
    #10 0x7f5ee0cbae27 in JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*) src/hotspot/share/runtime/javaCalls.cpp:191
    #11 0x7f5ee0fc6f78 in thread_entry src/hotspot/share/prims/jvm.cpp:2799
    #12 0x7f5ee0d0ea1a in JavaThread::thread_main_inner() src/hotspot/share/runtime/javaThread.cpp:772
    #13 0x7f5ee261952a in Thread::call_run() src/hotspot/share/runtime/thread.cpp:232
    #14 0x7f5ee1c44672 in thread_native_entry src/hotspot/os/linux/os_linux.cpp:858
    #15 0x7f5ee73036e9 in start_thread (/lib64/libpthread.so.0+0xa6e9) (BuildId: 938e42b7e407d175ee3ef9a89c038168101d330c)
Comments
[~rrich] yes I agree there is something else amiss here.
25-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22361 Date: 2024-11-25 13:56:20 +0000
25-11-2024

> _last_freeze_fail_result is not initialized by the JavaThread constructor. That's correct and should be fixed. But shouldn't _last_freeze_fail_result have been set because the virtual thread was pinned when reaching JVM_VirtualThreadPinnedEvent src/hotspot/share/prims/jvm.cpp:380?
25-11-2024

_last_freeze_fail_result is not initialized by the JavaThread constructor.
25-11-2024

Might be related to JDK-8338383 , at least we did not see the issue before.
25-11-2024