-
Bug
-
Resolution: Fixed
-
P5
-
18, 19
-
b12
ObjectMonitor mon;
while (i.hasNext()) {
mon = (ObjectMonitor)i.next();
if (mon.contentions() != 0 || mon.waiters() != 0 || mon.owner() != null) {
OopHandle object = mon.object();
if (object == null) {
dumpMonitor(tty, mon, true);
} else {
dumpMonitor(tty, mon, false);
}
}
}
So not only can mon.object() be null, but the code is also checking for it. However, dumpMonitor() is not handling it right. It executes the following code unconditionally:
OopHandle obj = mon.object();
Oop oop = heap.newOop(obj);
tty.println(" _object: " + obj + ", a " + oop.getKlass().getName().asString());
This code will NPE if mon.object() is NULL.
- relates to
-
JDK-8259008 ArithmeticException was thrown at "Monitor Cache Dump" on HSDB
- Resolved
-
JDK-8280555 serviceability/sa/TestObjectMonitorIterate.java is failing due to ObjectMonitor referencing a null Object
- Resolved