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

org.openjdk.bench.java.util.TreeMapUpdate.compute fails with "java.lang.IllegalArgumentException: key out of range"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • performance
    • None
    • b12

      org.openjdk.bench.java.util.TreeMapUpdate.compute benchmarks fails with

      # JMH version: 1.37
      # VM version: JDK 25-internal, Java HotSpot(TM) 64-Bit Server VM, 25-internal-LTS-2025-02-20-1841260.katya...
      # VM invoker: /home/katya/work/JavaSE/Hotspot/ws/git/jdk.jdk.master/build/linux-x64/images/jdk/bin/java
      # VM options: <none>
      # Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
      # Warmup: 3 iterations, 500 ms each
      # Measurement: 3 iterations, 500 ms each
      # Timeout: 10 min per iteration
      # Threads: 1 thread, will synchronize iterations
      # Benchmark mode: Average time, time/op
      # Benchmark: org.openjdk.bench.java.util.TreeMapUpdate.compute
      # Parameters: (comparator = true, mode = tailMap, preFill = true, seed = 0, size = 10)

      # Run progress: 33.33% complete, ETA 00:02:11
      # Fork: 1 of 1
      WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
      WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.openjdk.jmh.util.Utils (file:/home/katya/work/JavaSE/Hotspot/ws/git/jdk.jdk.master/build/linux-x64/images/test/micro/benchmarks.jar)
      WARNING: Please consider reporting this to the maintainers of class org.openjdk.jmh.util.Utils
      WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
      # Warmup Iteration 1: <failure>

      java.lang.IllegalArgumentException: key out of range
              at java.base/java.util.TreeMap$NavigableSubMap.compute(TreeMap.java:1865)
              at org.openjdk.bench.java.util.TreeMapUpdate.compute(TreeMapUpdate.java:147)
              at org.openjdk.bench.java.util.jmh_generated.TreeMapUpdate_compute_jmhTest.compute_avgt_jmhStub(TreeMapUpdate_compute_jmhTest.java:190)
              at org.openjdk.bench.java.util.jmh_generated.TreeMapUpdate_compute_jmhTest.compute_AverageTime(TreeMapUpdate_compute_jmhTest.java:153)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
              at java.base/java.lang.reflect.Method.invoke(Method.java:565)
              at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:527)
              at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:504)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
              at java.base/java.lang.Thread.run(Thread.java:1447)


      Is it expected?

      Sergey [~skuksenko], I see you were co-author of this benchmark, could you please have a look?

            tvaleev Tagir Valeev
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: