Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8352422

[ubsan] Out-of-range reported in ciMethod.cpp:917:20: runtime error: 2.68435e+09 is outside the range of representable values of type 'int'

XMLWordPrintable

    • aarch64
    • os_x

      When running on macOS aarch64 (XCode15) with ubsan-enabled binaries, the test
      compiler/profiling/TestProfileCounterOverflow.java
      generates this error :

      /priv/jenkins/client-home/workspace/openjdk-jdk-weekly-macos_aarch64-opt/jdk/src/hotspot/share/ci/ciMethod.cpp:917:20: runtime error: 2.68435e+09 is outside the range of representable values of type 'int'
          #0 0x106fb10ac in ciMethod::scale_count(int, float) ciMethod.cpp:917
          #1 0x1073e77e0 in Compile::call_generator(ciMethod*, int, bool, JVMState*, bool, float, ciKlass*, bool) doCall.cpp:187
          #2 0x1073ea468 in Parse::do_call() doCall.cpp:645
          #3 0x107c6e100 in Parse::do_one_block() parse1.cpp:1586
          #4 0x107c6c414 in Parse::do_all_blocks() parse1.cpp:724
          #5 0x107c69d98 in Parse::Parse(JVMState*, ciMethod*, float) parse1.cpp:628
          #6 0x107c6d6f4 in Parse::Parse(JVMState*, ciMethod*, float) parse1.cpp:404
          #7 0x106f347d0 in ParseGenerator::generate(JVMState*) callGenerator.cpp:97
          #8 0x1070a50f8 in Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*) compile.cpp:803
          #9 0x1070a8554 in Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*) compile.cpp:693
          #10 0x106f32334 in C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*) c2compiler.cpp:141
          #11 0x1070cb888 in CompileBroker::invoke_compiler_on_method(CompileTask*) compileBroker.cpp:2331
          #12 0x1070cae70 in CompileBroker::compiler_thread_loop() compileBroker.cpp:1975
          #13 0x1076cc254 in JavaThread::thread_main_inner() javaThread.cpp:776
          #14 0x107f08d68 in Thread::call_run() thread.cpp:231
          #15 0x107c2dc44 in thread_native_entry(Thread*) os_bsd.cpp:601
          #16 0x1936fef90 in _pthread_start+0x84 (libsystem_pthread.dylib:arm64e+0x6f90)
          #17 0x1936f9d30 in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x1d30)


      The out of range happens here :

      909 int ciMethod::scale_count(int count, float prof_factor) {
      ......
      916 if (counter_life > 0) {
      917 count = (int)((double)count * prof_factor * method_life / counter_life + 0.5);

            Unassigned Unassigned
            mbaesken Matthias Baesken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: