In a ubsan enabled build, the test runtime/CommandLine/OptionsValidation/TestOptionsWithRannges_id7.java fails with error:
TEST FAILED: Error processing option SharedBaseAddress with valid value '-server -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=TestOptionsWithRanges.jsa -Xshare:dump -XX:SharedBaseAddress=0'! JVM exited with unexpected error code = 134 [0x86]
stdout content[]
stderr content[/Users/afshin/ubsan_2025-08-11/src/hotspot/share/cds/archiveBuilder.cpp:383:66: runtime error: applying non-zero offset 1073741824 to null pointer
#0 0x10822bf2c in ArchiveBuilder::reserve_buffer() archiveBuilder.cpp:383
#1 0x1095d30cc in VM_PopulateDumpSharedSpace::doit() metaspaceShared.cpp:657
#2 0x109c21d2c in VM_Operation::evaluate() vmOperations.cpp:74
#3 0x109c4c5fc in VMThread::evaluate_operation(VM_Operation*) vmThread.cpp:284
#4 0x109c4d2c0 in VMThread::inner_execute(VM_Operation*) vmThread.cpp:421
#5 0x109c4c234 in VMThread::loop() vmThread.cpp:487
#6 0x109c4be30 in VMThread::run() vmThread.cpp:177
#7 0x109afb1ac in Thread::call_run() thread.cpp:243
#8 0x10970946c in thread_native_entry(Thread*) os_bsd.cpp:599
#9 0x18d15fc08 in _pthread_start+0x84 (libsystem_pthread.dylib:arm64e+0x6c08)
#10 0x18d15ab7c in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1b7c)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/afshin/ubsan_2025-08-11/src/hotspot/share/cds/archiveBuilder.cpp:383:66 in
]
TEST FAILED: Error processing option SharedBaseAddress with valid value '-server -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:SharedArchiveFile=TestOptionsWithRanges.jsa -Xshare:dump -XX:SharedBaseAddress=0'! JVM exited with unexpected error code = 134 [0x86]
stdout content[]
stderr content[/Users/afshin/ubsan_2025-08-11/src/hotspot/share/cds/archiveBuilder.cpp:383:66: runtime error: applying non-zero offset 1073741824 to null pointer
#0 0x10822bf2c in ArchiveBuilder::reserve_buffer() archiveBuilder.cpp:383
#1 0x1095d30cc in VM_PopulateDumpSharedSpace::doit() metaspaceShared.cpp:657
#2 0x109c21d2c in VM_Operation::evaluate() vmOperations.cpp:74
#3 0x109c4c5fc in VMThread::evaluate_operation(VM_Operation*) vmThread.cpp:284
#4 0x109c4d2c0 in VMThread::inner_execute(VM_Operation*) vmThread.cpp:421
#5 0x109c4c234 in VMThread::loop() vmThread.cpp:487
#6 0x109c4be30 in VMThread::run() vmThread.cpp:177
#7 0x109afb1ac in Thread::call_run() thread.cpp:243
#8 0x10970946c in thread_native_entry(Thread*) os_bsd.cpp:599
#9 0x18d15fc08 in _pthread_start+0x84 (libsystem_pthread.dylib:arm64e+0x6c08)
#10 0x18d15ab7c in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1b7c)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/afshin/ubsan_2025-08-11/src/hotspot/share/cds/archiveBuilder.cpp:383:66 in
]