use of com.ibm.dtfj.image.CorruptData in project openj9 by eclipse.
the class DTFJJavaRuntime method scanReferences.
private void scanReferences() {
references = new LinkedList<Object>();
AddCorruptionToListListener corruptionListener = new AddCorruptionToListListener(references);
register(corruptionListener);
try {
RootScanner scanner = new DTFJRootScanner();
/* We don't report stack slots here */
scanner.setScanStackSlots(false);
scanner.scanAllSlots();
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
references.add(cd);
}
unregister(corruptionListener);
}
use of com.ibm.dtfj.image.CorruptData in project openj9 by eclipse.
the class DTFJJavaRuntime method getJavaClassLoaders.
@SuppressWarnings("rawtypes")
public Iterator getJavaClassLoaders() {
if (classLoaders != null) {
// return cached set of class loaders
return classLoaders.iterator();
}
classLoaders = new LinkedList<Object>();
GCClassLoaderIterator classLoaderIterator;
try {
classLoaderIterator = GCClassLoaderIterator.from();
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
classLoaders.add(cd);
return classLoaders.iterator();
}
AddCorruptionToListListener corruptionListener = new AddCorruptionToListListener(classLoaders);
register(corruptionListener);
try {
while (!corruptionListener.fatalCorruption() && classLoaderIterator.hasNext()) {
J9ClassLoaderPointer next = classLoaderIterator.next();
if (next != null) {
classLoaders.add(new DTFJJavaClassloader(next));
}
}
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
classLoaders.add(cd);
}
unregister(corruptionListener);
return classLoaders.iterator();
}
use of com.ibm.dtfj.image.CorruptData in project openj9 by eclipse.
the class DTFJComparator method assertEqualsIfBothObjectsCorrupt.
// If one object is corrupt then both objects MUST be corrupt and both objects MUST be equal
// Returns true if both objects where corrupt, false otherwise.
private static boolean assertEqualsIfBothObjectsCorrupt(Object a, Object b) {
if (a instanceof CorruptData && b instanceof CorruptData) {
CorruptDataComparator comp = new CorruptDataComparator();
comp.testEquals(b, a, comp.getDefaultMask());
return true;
}
assertFalse("This object should have been corrupt", a instanceof CorruptData);
assertFalse("This object should have been corrupt", b instanceof CorruptData);
return false;
}
use of com.ibm.dtfj.image.CorruptData in project openj9 by eclipse.
the class PHDJavaRuntime method prepMonitors.
/**
* Remember objects associated with monitors.
* Performance optimization - we can then find these objects on a scan through the heap
* and remember them, saving a fruitless search of the heap if they only exist in a javacore.
*/
private void prepMonitors() {
if (metaJavaRuntime != null) {
final PHDJavaClassLoader boot = loaders.get(null);
for (Iterator it = metaJavaRuntime.getMonitors(); it.hasNext(); ) {
Object next = it.next();
if (next instanceof CorruptData)
continue;
JavaMonitor mon = (JavaMonitor) next;
JavaObject jo = mon.getObject();
saveExtraObject(boot, jo);
}
}
}
use of com.ibm.dtfj.image.CorruptData in project openj9 by eclipse.
the class PHDJavaRuntime method initThreads.
private void initThreads() {
if (metaJavaRuntime != null) {
for (Iterator it = metaJavaRuntime.getThreads(); it.hasNext(); ) {
Object next = it.next();
if (next instanceof CorruptData) {
JavaThread thr = new PHDCorruptJavaThread(space, (CorruptData) next);
threads.put(thr, thr);
} else {
getThread((JavaThread) next);
}
}
}
}
Aggregations