Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8014577 | 8 | Calvin Cheung | P3 | Closed | Fixed | b90 |
In src/share/vm/prims/perf.cpp, Perf_CreateLong creates a perf counter of an incorrect type. As defined in perfData.hpp:
enum Variability {
V_Constant = 1,
V_Monotonic = 2,
V_Variable = 3,
V_last = V_Variable
};
Perf_CreateLong incorrectly creates a V_Variable perf long counter if variability == 2 and V_Monotonic if variability == 3.
The bug is in the switch statement:
switch(variability) {
case 1: /* V_Constant */
pl = PerfDataManager::create_long_constant(NULL_NS, (char *)name_utf,
(PerfData::Units)units, value,
CHECK_NULL);
break;
case 2: /* V_Variable */
pl = PerfDataManager::create_long_variable(NULL_NS, (char *)name_utf,
(PerfData::Units)units, value,
CHECK_NULL);
break;
case 3: /* V_Monotonic Counter */
pl = PerfDataManager::create_long_counter(NULL_NS, (char *)name_utf,
(PerfData::Units)units, value,
CHECK_NULL);
break;
default: /* Illegal Argument */
debug_only(warning("unexpected variability value: %d", variability));
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
break;
}
enum Variability {
V_Constant = 1,
V_Monotonic = 2,
V_Variable = 3,
V_last = V_Variable
};
Perf_CreateLong incorrectly creates a V_Variable perf long counter if variability == 2 and V_Monotonic if variability == 3.
The bug is in the switch statement:
switch(variability) {
case 1: /* V_Constant */
pl = PerfDataManager::create_long_constant(NULL_NS, (char *)name_utf,
(PerfData::Units)units, value,
CHECK_NULL);
break;
case 2: /* V_Variable */
pl = PerfDataManager::create_long_variable(NULL_NS, (char *)name_utf,
(PerfData::Units)units, value,
CHECK_NULL);
break;
case 3: /* V_Monotonic Counter */
pl = PerfDataManager::create_long_counter(NULL_NS, (char *)name_utf,
(PerfData::Units)units, value,
CHECK_NULL);
break;
default: /* Illegal Argument */
debug_only(warning("unexpected variability value: %d", variability));
THROW_0(vmSymbols::java_lang_IllegalArgumentException());
break;
}
- backported by
-
JDK-8014577 Perf_CreateLong creates perf counter of incorrect type
-
- Closed
-
- relates to
-
JDK-8011934 sun.misc.PerfCounter calls Perf.createLong with incorrect parameters
-
- Resolved
-