-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
17, 19, 20
-
aarch64
-
linux
we run into this error on an Ubuntu 22 Linux aarch64 machine :
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV2.getLongValueEntryFromFile(MetricsTesterCgroupV2.java:125)
at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV2.testCpuSchedulingMetrics(MetricsTesterCgroupV2.java:324)
at jdk.test.lib.containers.cgroup.MetricsTester.testAll(MetricsTester.java:59)
at TestCgroupMetrics.main(TestCgroupMetrics.java:47)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
at java.base/java.lang.Thread.run(Thread.java:1596)
(this is cgroupsv2 based).
Reason is that the cpu.stat file misses nr_periods entry.
cpu.stat has instead those entries :
usage_usec 676979
user_usec 202599
system_usec 474379
Probably the coding getLongValueEntryFromFile could be hardened so that it catches ArrayIndexOutOfBoundsException and returns NOT_AVAILABLE instead.
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV2.getLongValueEntryFromFile(MetricsTesterCgroupV2.java:125)
at jdk.test.lib.containers.cgroup.MetricsTesterCgroupV2.testCpuSchedulingMetrics(MetricsTesterCgroupV2.java:324)
at jdk.test.lib.containers.cgroup.MetricsTester.testAll(MetricsTester.java:59)
at TestCgroupMetrics.main(TestCgroupMetrics.java:47)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
at java.base/java.lang.Thread.run(Thread.java:1596)
(this is cgroupsv2 based).
Reason is that the cpu.stat file misses nr_periods entry.
cpu.stat has instead those entries :
usage_usec 676979
user_usec 202599
system_usec 474379
Probably the coding getLongValueEntryFromFile could be hardened so that it catches ArrayIndexOutOfBoundsException and returns NOT_AVAILABLE instead.
- duplicates
-
JDK-8284977 MetricsTesterCgroupV2.getLongValueEntryFromFile fails when named value doesn't exist
- Resolved