JDK-8306331 : assert((cnt > 0.0f) && (prob > 0.0f)) failed: Bad frequency assignment in if
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,17,20,21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-04-18
  • Updated: 2023-05-04
  • Resolved: 2023-04-28
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.
JDK 21
21 b21Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Stress test fails on macos-aarch64 with following assertion:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S51573/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/159b6237-164a-4e8d-a87f-f88590cdae30/runs/904b9cec-69cc-4bc7-a2ab-7d271c913c2d/workspace/open/src/hotspot/share/opto/parse2.cpp:1263), pid=53696, tid=31235
#  assert((cnt > 0.0f) && (prob > 0.0f)) failed: Bad frequency assignment in if
#
# JRE version: Java(TM) SE Runtime Environment (21.0) (fastdebug build 21-internal-LTS-2023-04-14-2311181.mikael.vidstedt.jdk)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-internal-LTS-2023-04-14-2311181.mikael.vidstedt.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Core dump will be written. Default location: core.53696
#
# JFR recording file will be written. Location: /System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S51570/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8fa68a2f-160a-484c-b2b3-b77677871c79/runs/0c72859c-a20c-4951-abed-001d8b9ce7af/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink8H_java/scratch/0/hs_err_pid53696.jfr
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: -Xbootclasspath/a:/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S51570/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8fa68a2f-160a-484c-b2b3-b77677871c79/runs/0c72859c-a20c-4951-abed-001d8b9ce7af/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink8H_java/scratch/0/wb.jar -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Djava.security.manager=allow -XX:MaxRAMPercentage=6.25 -Dtest.boot.jdk=/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk/19/36/bundles/macos-aarch64/jdk-19_macos-aarch64_bin.tar.gz/jdk-19.jdk/Contents/Home -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S51570/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8fa68a2f-160a-484c-b2b3-b77677871c79/runs/0c72859c-a20c-4951-abed-001d8b9ce7af/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink8H_java/tmp -XX:MaxRAMPercentage=50 -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError -Djava.net.preferIPv6Addresses=false -XX:+DisplayVMOutputToStderr -Xlog:gc*,gc+heap=debug:gc.log:uptime,timemillis,level,tags -XX:+DisableExplicitGC -XX:+StartAttachListener --enable-preview --add-exports=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED -Djava.io.tmpdir=/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S51570/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8fa68a2f-160a-484c-b2b3-b77677871c79/runs/0c72859c-a20c-4951-abed-001d8b9ce7af/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink8H_java/scratch/0/java.io.tmpdir -Duser.home=/System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S51570/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8fa68a2f-160a-484c-b2b3-b77677871c79/runs/0c72859c-a20c-4951-abed-001d8b9ce7af/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink8H_java/scratch/0/user.home -agentpath:/System/Volumes/Data/mesos/work_dir/jib-master/install/2023-04-14-2311181.mikael.vidstedt.jdk/macosx-aarch64-debug.test/hotspot/jtreg/native/libJvmtiStressModule.dylib -XX:NativeMemoryTracking=detail -Djdk.test.lib.random.seed=3881510280439331251 applications.kitchensink.process.stress.Main /System/Volumes/Data/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S51570/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8fa68a2f-160a-484c-b2b3-b77677871c79/runs/0c72859c-a20c-4951-abed-001d8b9ce7af/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink8H_java/scratch/0/kitchensink.final.properties

Host: "Mac14,3" arm64, 8 cores, 16G, Darwin 22.3.0, macOS 13.2.1 (22D68)
Time: Tue Apr 18 05:54:54 2023 GMT elapsed time: 27686.480167 seconds (0d 7h 41m 26s)

---------------  T H R E A D  ---------------

Current thread (0x000000013d00de10):  JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=31235, stack(0x0000000170cc4000,0x0000000170ec7000)]


Current CompileTask:
C2:27686480 5257314 %     4       spec.benchmarks.xml.transform.BaseOutputStream::write @ 3 (36 bytes)

Stack: [0x0000000170cc4000,0x0000000170ec7000],  sp=0x0000000170ec4680,  free space=2049k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x102d678]  VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x564  (parse2.cpp:1263)
V  [libjvm.dylib+0x102de94]  VMError::report_and_die(Thread*, char const*, int, unsigned long, VMErrorType, char const*, char*)+0x0
V  [libjvm.dylib+0x523198]  print_error_for_unit_test(char const*, char const*, char*)+0x0
V  [libjvm.dylib+0xd90170]  Parse::branch_prediction(float&, BoolTest::mask, int, Node*)+0x0
V  [libjvm.dylib+0xd90198]  Parse::branch_prediction(float&, BoolTest::mask, int, Node*)+0x28
V  [libjvm.dylib+0xd90ef4]  Parse::do_if(BoolTest::mask, Node*)+0x7c
V  [libjvm.dylib+0xd9437c]  Parse::do_one_bytecode()+0x1c50
V  [libjvm.dylib+0xd848e0]  Parse::do_one_block()+0x428
V  [libjvm.dylib+0xd82a34]  Parse::do_all_blocks()+0x474
V  [libjvm.dylib+0xd7f450]  Parse::Parse(JVMState*, ciMethod*, float)+0x9d4
V  [libjvm.dylib+0x379aa4]  ParseGenerator::generate(JVMState*)+0x120
V  [libjvm.dylib+0x493d3c]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0xd3c
V  [libjvm.dylib+0x3781d8]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x188
V  [libjvm.dylib+0x4b097c]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x6e4
V  [libjvm.dylib+0x4aff40]  CompileBroker::compiler_thread_loop()+0x2bc
V  [libjvm.dylib+0x846384]  JavaThread::thread_main_inner()+0x18c
V  [libjvm.dylib+0xf8124c]  Thread::call_run()+0xf4
V  [libjvm.dylib+0xd51e24]  thread_native_entry(Thread*)+0x120
C  [libsystem_pthread.dylib+0x706c]  _pthread_start+0x94

---------------  P R O C E S S  ---------------

uid  : 502 euid : 502 gid  : 10668 egid : 10668

umask: 0022 (----w--w-)

Threads class SMR info:
_java_thread_list=0x00006000278b4950, length=54, elements={
0x000000014e808210, 0x000000014e889610, 0x000000014e88ce10, 0x000000014e88da10,
0x000000013d009810, 0x000000013d00a410, 0x000000013d00d210, 0x000000013d00de10,
0x000000014d00e010, 0x000000014e887610, 0x000000014e887e10, 0x000000014d0d7810,
0x000000014d0cb010, 0x000000014d0d6210, 0x000000014d181210, 0x000000014d181a10,
0x000000013d0aa610, 0x000000013d0a9610, 0x000000013d0aae10, 0x000000014d81e210,
0x000000014d8cd010, 0x000000013d0a9e10, 0x000000013d0ab610, 0x000000014d183a10,
0x000000014d184210, 0x000000014d184a10, 0x000000013d0ac210, 0x000000013d0aca10,
0x000000013d0ad610, 0x000000013d0ae210, 0x000000014d187410, 0x0000000126809a10,
0x000000012d823810, 0x000000013d00c810, 0x000000014d941e10, 0x0000000126841610,
0x000000012d032010, 0x000000014d340210, 0x000000014d715c10, 0x000000012d55ca10,
0x0000000139871210, 0x0000000139998010, 0x000000013f61aa10, 0x0000000138407a10,
0x0000000126d8ac10, 0x000000012db62a10, 0x0000000138511e10, 0x000000013f32ba10,
0x000000012684c610, 0x00000001397dd610, 0x000000012db74410, 0x00000001268ec010,
0x000000013f614a10, 0x000000012dad2610
}
_java_thread_list_alloc_cnt=239723, _java_thread_list_free_cnt=239721, _java_thread_list_max=75, _nested_thread_list_max=1
_tlh_cnt=78635749, _tlh_times=2552406, avg_tlh_time=0.03, _tlh_time_max=7687
_deleted_thread_cnt=119834, _deleted_thread_times=45997, avg_deleted_thread_time=0.38, _deleted_thread_time_max=1759
_delete_lock_wait_cnt=0, _delete_lock_wait_max=8
_to_delete_list_cnt=0, _to_delete_list_max=3

Java Threads: ( => current thread )
  0x000000014e808210 JavaThread "main" [_thread_blocked, id=5379, stack(0x000000016f19c000,0x000000016f39f000)]
  0x000000014e889610 JavaThread "Reference Handler" daemon [_thread_blocked, id=21763, stack(0x000000017007c000,0x000000017027f000)]
  0x000000014e88ce10 JavaThread "Finalizer" daemon [_thread_blocked, id=22019, stack(0x0000000170288000,0x000000017048b000)]
  0x000000014e88da10 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=22531, stack(0x0000000170494000,0x0000000170697000)]
  0x000000013d009810 JavaThread "Attach Listener" daemon [_thread_blocked, id=32003, stack(0x00000001706a0000,0x00000001708a3000)]
  0x000000013d00a410 JavaThread "Service Thread" daemon [_thread_blocked, id=23043, stack(0x00000001708ac000,0x0000000170aaf000)]
  0x000000013d00d210 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=31491, stack(0x0000000170ab8000,0x0000000170cbb000)]
=>0x000000013d00de10 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=31235, stack(0x0000000170cc4000,0x0000000170ec7000)]
  0x000000014d00e010 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=23555, stack(0x0000000170ed0000,0x00000001710d3000)]
  0x000000014e887610 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=30467, stack(0x00000001710dc000,0x00000001712df000)]
  0x000000014e887e10 JavaThread "Notification Thread" daemon [_thread_blocked, id=30211, stack(0x00000001712e8000,0x00000001714eb000)]
  0x000000014d0d7810 JavaThread "ModuleShudownListenerThread" daemon [_thread_in_native, id=28675, stack(0x000000017190c000,0x0000000171b0f000)]
  0x000000014d0cb010 JavaThread "AllocatorStressModule" [_thread_in_Java, id=24323, stack(0x0000000171b18000,0x0000000171d1b000)]
  0x000000014d0d6210 JavaThread "ExceptionStressModule" [_thread_in_vm, id=28163, stack(0x0000000171d24000,0x0000000171f27000)]
  0x000000014d181210 JavaThread "JcmdStressModule" [_thread_blocked, id=27907, stack(0x0000000171f30000,0x0000000172133000)]
  0x000000014d181a10 JavaThread "JfrStressModule" [_thread_blocked, id=24835, stack(0x000000017213c000,0x000000017233f000)]
  0x000000013d0aa610 JavaThread "JniStressModule" [_thread_in_native, id=25347, stack(0x0000000172348000,0x000000017254b000)]
  0x000000013d0a9610 JavaThread "JstatStressModule" [_thread_blocked, id=27395, stack(0x0000000172554000,0x0000000172757000)]
  0x000000013d0aae10 JavaThread "JvmtiStressModule" [_thread_blocked, id=25859, stack(0x0000000172760000,0x0000000172963000)]
  0x000000014d81e210 JavaThread "InflaterStressModule" [_thread_in_native, id=26115, stack(0x000000017296c000,0x0000000172b6f000)]
  0x000000014d8cd010 JavaThread "LockDeflationStressModule" [_thread_blocked, id=26371, stack(0x0000000172b78000,0x0000000172d7b000)]
  0x000000013d0a9e10 JavaThread "MBeanStressModule" [_thread_blocked, id=43267, stack(0x0000000172d84000,0x0000000172f87000)]
  0x000000013d0ab610 JavaThread "MemAccessStressModule" [_thread_in_native, id=33027, stack(0x0000000172f90000,0x0000000173193000)]
  0x000000014d183a10 JavaThread "MonitorStressModule" [_thread_blocked, id=42755, stack(0x000000017319c000,0x000000017339f000)]
  0x000000014d184210 JavaThread "NMTStressModule" [_thread_blocked, id=33795, stack(0x00000001733a8000,0x00000001735ab000)]
  0x000000014d184a10 JavaThread "PerfmonStressModule" [_thread_blocked, id=42243, stack(0x00000001735b4000,0x00000001737b7000)]
  0x000000013d0ac210 JavaThread "ReferenceStressModule" [_thread_blocked, id=34307, stack(0x00000001737c0000,0x00000001739c3000)]
  0x000000013d0aca10 JavaThread "SpecJbb2005StressModule" [_thread_blocked, id=34563, stack(0x00000001739cc000,0x0000000173bcf000)]
  0x000000013d0ad610 JavaThread "SpecJvm2008BatchStressModule" [_thread_blocked, id=35075, stack(0x0000000173bd8000,0x0000000173ddb000)]
  0x000000013d0ae210 JavaThread "ThreadDumperStressModule" [_thread_blocked, id=41731, stack(0x0000000173de4000,0x0000000173fe7000)]
  0x000000014d187410 JavaThread "Jvmti-AgentSampler" daemon [_thread_in_native, id=41475, stack(0x0000000173ff0000,0x00000001741f3000)]
  0x0000000126809a10 JavaThread "pool-1-thread-1" [_thread_blocked, id=39171, stack(0x000000017525c000,0x000000017545f000)]
  0x000000012d823810 JavaThread "pool-1-thread-2" [_thread_blocked, id=38915, stack(0x0000000175468000,0x000000017566b000)]
  0x000000013d00c810 JavaThread "pool-1-thread-3" [_thread_blocked, id=38403, stack(0x0000000175674000,0x0000000175877000)]
  0x000000014d941e10 JavaThread "pool-1-thread-4" [_thread_blocked, id=65283, stack(0x0000000175880000,0x0000000175a83000)]
  0x0000000126841610 JavaThread "JFR Recorder Thread" daemon [_thread_in_native, id=63491, stack(0x00000001762bc000,0x00000001764bf000)]
  0x000000012d032010 JavaThread "VirtualThread-unparker" daemon [_thread_blocked, id=61699, stack(0x0000000177734000,0x0000000177937000)]
  0x000000014d340210 JavaThread "JFR Periodic Tasks" daemon [_thread_blocked, id=61187, stack(0x0000000177940000,0x0000000177b43000)]
  0x000000014d715c10 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=59411, stack(0x0000000171700000,0x0000000171903000)]
  0x000000012d55ca10 JavaThread "JFR Event Stream 19" [_thread_blocked, id=50287, stack(0x0000000291688000,0x000000029188b000)]
  0x0000000139871210 JavaThread "Thread-67551" [_thread_blocked, id=45627, stack(0x0000000175c98000,0x0000000175e9b000)]
  0x0000000139998010 JavaThread "Thread-67552" [_thread_blocked, id=58679, stack(0x0000000175ea4000,0x00000001760a7000)]
  0x000000013f61aa10 JavaThread "Program Runner for xml.transform" [_thread_blocked, id=45391, stack(0x00000001741fc000,0x00000001743ff000)]
  0x0000000138407a10 JavaThread "BenchmarkThread xml.transform 1" [_thread_in_vm, id=48931, stack(0x0000000176cf8000,0x0000000176efb000)]
  0x0000000126d8ac10 JavaThread "BenchmarkThread xml.transform 2" [_thread_in_Java, id=63239, stack(0x0000000176f04000,0x0000000177107000)]
  0x000000012db62a10 JavaThread "pool-184-thread-1" [_thread_blocked, id=56771, stack(0x00000001768e0000,0x0000000176ae3000)]
  0x0000000138511e10 JavaThread "ForkJoinPool-1-worker-729" daemon [_thread_blocked, id=62991, stack(0x0000000176aec000,0x0000000176cef000)]
  0x000000013f32ba10 JavaThread "ForkJoinPool-1-worker-730" daemon [_thread_in_Java, id=28951, stack(0x0000000177110000,0x0000000177313000)]
  0x000000012684c610 JavaThread "ForkJoinPool-1-worker-731" daemon [_thread_in_vm, id=49339, stack(0x000000017731c000,0x000000017751f000)]
  0x00000001397dd610 JavaThread "ForkJoinPool-1-worker-732" daemon [_thread_blocked, id=53203, stack(0x0000000177528000,0x000000017772b000)]
  0x000000012db74410 JavaThread "ForkJoinPool-1-worker-733" daemon [_thread_blocked, id=46499, stack(0x0000000177b4c000,0x0000000177d4f000)]
  0x00000001268ec010 JavaThread "ForkJoinPool-1-worker-734" daemon [_thread_in_Java, id=62127, stack(0x0000000290004000,0x0000000290207000)]
  0x000000013f614a10 JavaThread "ForkJoinPool-1-worker-735" daemon [_thread_in_vm, id=57095, stack(0x0000000290210000,0x0000000290413000)]
  0x000000012dad2610 JavaThread "ForkJoinPool-1-worker-736" daemon [_thread_in_vm, id=46975, stack(0x000000029041c000,0x000000029061f000)]

Other Threads:
  0x000000014e10f510 VMThread "VM Thread" [stack: 0x000000016fde4000,0x000000016ffe7000] [id=19715]
  0x000000014e115190 WatcherThread "VM Periodic Task Thread" [stack: 0x00000001714f4000,0x00000001716f7000] [id=29699]
  0x000000014e106e10 WorkerThread "GC Thread#0" [stack: 0x000000016f3a8000,0x000000016f5ab000] [id=12803]
  0x000000014e00e8b0 WorkerThread "GC Thread#1" [stack: 0x0000000174408000,0x000000017460b000] [id=36099]
  0x000000014e00edb0 WorkerThread "GC Thread#2" [stack: 0x0000000174614000,0x0000000174817000] [id=36355]
  0x000000014e123f50 WorkerThread "GC Thread#3" [stack: 0x0000000174820000,0x0000000174a23000] [id=36611]
  0x000000014e124560 WorkerThread "GC Thread#4" [stack: 0x0000000174a2c000,0x0000000174c2f000] [id=40195]
  0x000000014e124b70 WorkerThread "GC Thread#5" [stack: 0x0000000174c38000,0x0000000174e3b000] [id=39683]
  0x000000014e125180 WorkerThread "GC Thread#6" [stack: 0x0000000174e44000,0x0000000175047000] [id=37379]
  0x000000014e125790 WorkerThread "GC Thread#7" [stack: 0x0000000175050000,0x0000000175253000] [id=39427]
  0x000000014e107670 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000016f5b4000,0x000000016f7b7000] [id=13315]
  0x000000014e107c90 WorkerThread "G1 Conc#0" [stack: 0x000000016f7c0000,0x000000016f9c3000] [id=13827]
  0x000000014e1284d0 WorkerThread "G1 Conc#1" [stack: 0x0000000175a8c000,0x0000000175c8f000] [id=64771]
  0x000000014e109d20 ConcurrentGCThread "G1 Refine#0" [stack: 0x000000016f9cc000,0x000000016fbcf000] [id=16387]
  0x000000013ce27b00 ConcurrentGCThread "G1 Refine#1" [stack: 0x00000001760b0000,0x00000001762b3000] [id=49687]
  0x000000013d882b30 ConcurrentGCThread "G1 Refine#2" [stack: 0x00000001764c8000,0x00000001766cb000] [id=41007]
  0x000000013ce60110 ConcurrentGCThread "G1 Refine#3" [stack: 0x0000000290e58000,0x000000029105b000] [id=52563]
  0x000000013cffda10 ConcurrentGCThread "G1 Refine#4" [stack: 0x0000000291064000,0x0000000291267000] [id=63803]
  0x000000013ce6e270 ConcurrentGCThread "G1 Refine#5" [stack: 0x00000001766d4000,0x00000001768d7000] [id=44099]
  0x000000014e10a3b0 ConcurrentGCThread "G1 Service" [stack: 0x000000016fbd8000,0x000000016fddb000] [id=16643]

Threads with active compile tasks:
C2 CompilerThread0  27686484 5257314 %     4       spec.benchmarks.xml.transform.BaseOutputStream::write @ 3 (36 bytes)

VM state: not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0x0000000103bae528] JvmtiThreadState_lock - owner thread: 0x0000000000000000

Heap address: 0x0000000600000000, size: 8192 MB, Compressed Oops mode: Zero based, Oop shift amount: 3

CDS archive(s) mapped at: [0x0000000800000000-0x0000000800d08000-0x0000000800d08000), size 13664256, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 0.
Compressed class space mapped at: 0x0000000801000000-0x000000081b000000, reserved size: 436207616
Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x100000000

GC Precious Log:
 CardTable entry size: 512
 Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 32 size 80 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192
 CPUs: 8 total, 8 available
 Memory: 16384M
 Large Page Support: Disabled
 NUMA Support: Disabled
 Compressed Oops: Enabled (Zero based)
 Heap Region Size: 4M
 Heap Min Capacity: 8M
 Heap Initial Capacity: 256M
 Heap Max Capacity: 8G
 Pre-touch: Disabled
 Parallel Workers: 8
 Concurrent Workers: 2
 Concurrent Refinement Workers: 8
 Periodic GC: Disabled

Heap:
 garbage-first heap   total 7512064K, used 3246060K [0x0000000600000000, 0x0000000800000000)
  region size 4096K, 68 young (278528K), 12 survivors (49152K)
 Metaspace       used 42614K, committed 49664K, reserved 491520K
  class space    used 3955K, committed 6400K, reserved 425984K
Comments
Changeset: a177152f Author: Dean Long <dlong@openjdk.org> Date: 2023-04-28 15:48:39 +0000 URL: https://git.openjdk.org/jdk/commit/a177152f224cdaa3ef24a90baa57f1b42c0cc220
28-04-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13551 Date: 2023-04-20 02:44:00 +0000
20-04-2023

Besides the signed overflow problem, this code could handle saturated values better. The BranchData and JumpData counters are stored as uint and saturate at 0xffffffff, while scale_count() counters and return value use int and saturate at 0x7fffffff. We should be able to make a meaningful comparison between "taken" and "not_taken" paths with raw counter values up to 0xfffffffe, but the current code loses information converting to int. Also, the current code limits the sum of taken + not_taken to <= 0x7fffffff even if neither value is saturated. Finally, it seems like we should be able to compare 0 on one path to "saturated" on the other path, but again the current code doesn't allow that because a raw 0xffffffff saturated value becomes negative and is rejected.
19-04-2023

I think we should not build with `-fwrapv` even for some limited scope. That option (or equivalent) might not even be available for some compilers. Conversion to unsigned to perform the overflow checking is one option. One of the values involved (2147483647) is INT_MAX, which looks like a "saturated" value. So another option might be to change the saturation limit to something like INT_MAX/2. Then the sum of two values that don't exceed the saturation limit won't exceed INT_MAX and so invoke UB. That also might make saturation clipping a little simpler.
19-04-2023

Building with -fwrapv is a work-around. The problem can be detected by -fsanitize=signed-integer-overflow or -fsanitize=undefined, but only if an actual overflow happens. UBSan doesn't detect potential overflow.
19-04-2023

From the core file: (int) not_taken = 2147483647 (int) taken = 1296570 So according to this code: float sum = taken + not_taken; ... cnt = sum / FreqCountInvocations; "taken + not_taken" will caused a signed overflow, resulting in a negative "cnt". There is a bail-out earlier: 1234 if (taken < 0 || not_taken < 0 || taken + not_taken < 40) { but since "taken + not_taken" is UB, the new toolchain has some freedom in what in generates: 0x103447e2c <+600>: add w8, w22, w21 0x103447e30 <+604>: cmp w8, #0x27 0x103447e34 <+608>: b.hi 0x103447e68 (notice that "b.hi" is unsigned).
19-04-2023

ILW = assert in debug build; new toolchain + stress test + macos arm64; no workaround = MLH = P4
18-04-2023