RFR: 8354426: [ubsan] applying non-zero offset 34359738368 to null pointer in CompressedKlassPointers::encoding_range_end

Matthias Baesken mbaesken at openjdk.org
Fri Apr 11 14:17:35 UTC 2025


When running with ubsan enabled binaries on AIX, the HS jtreg test gc/epsilon/TestClasses (and some other tests too) show the following issue :


/srcdir/jdk/src/hotspot/share/oops/compressedKlass.inline.hpp:98:16: runtime error: applying non-zero offset 34359738368 to null pointer
    #0 0x90000001185d7ec in CompressedKlassPointers::encoding_range_end() make/hotspot/src/hotspot/share/oops/compressedKlass.inline.hpp:98
    #1 0x90000001185d7ec in CompressedKlassPointers::print_mode(outputStream*) make/hotspot/src/hotspot/share/oops/compressedKlass.cpp:299
    #2 0x900000012b6eb90 in Metaspace::global_initialize() make/hotspot/src/hotspot/share/memory/metaspace.cpp:847
    #3 0x900000012b6d7d8 in universe_init() make/hotspot/src/hotspot/share/memory/universe.cpp:887
    #4 0x900000012c3aa58 in init_globals() make/hotspot/src/hotspot/share/runtime/init.cpp:132
    #5 0x900000012c6af7c in Threads::create_vm(JavaVMInitArgs*, bool*) make/hotspot/src/hotspot/share/runtime/threads.cpp:576
    #6 0x900000012cb0548 in JNI_CreateJavaVM_inner(JavaVM_**, void**, void*) make/hotspot/src/hotspot/share/prims/jni.cpp:3587
    #7 0x900000012cb0548 in JNI_CreateJavaVM make/hotspot/src/hotspot/share/prims/jni.cpp:3678


Seems we add to a base (== nullptr) some offset which is reported as undefined behavior.
On other OS the base might be different so we do not see it there.

-------------

Commit messages:
 - JDK-8354426

Changes: https://git.openjdk.org/jdk/pull/24596/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24596&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354426
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/24596.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24596/head:pull/24596

PR: https://git.openjdk.org/jdk/pull/24596


More information about the hotspot-dev mailing list