Search in sources :

Example 11 with PointerPointer

use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.

the class CheckVMThreadStacks method print.

@Override
public void print() {
    try {
        GCVMThreadListIterator vmThreadListIterator = GCVMThreadListIterator.from();
        final ScanFormatter formatter = new ScanFormatter(this, "thread stacks");
        while (vmThreadListIterator.hasNext()) {
            J9VMThreadPointer walkThread = vmThreadListIterator.next();
            formatter.section("thread slots", walkThread);
            WalkState walkState = new WalkState();
            walkState.walkThread = walkThread;
            walkState.flags = J9_STACKWALK_ITERATE_O_SLOTS | J9_STACKWALK_DO_NOT_SNIFF_AND_WHACK | J9_STACKWALK_SKIP_INLINES;
            walkState.callBacks = new BaseStackWalkerCallbacks() {

                public void objectSlotWalkFunction(J9VMThreadPointer walkThread, WalkState walkState, PointerPointer objectSlot, VoidPointer stackAddress) {
                    try {
                        formatter.entry(objectSlot.at(0));
                    } catch (CorruptDataException e) {
                    }
                }
            };
            StackWalker.walkStackFrames(walkState);
            formatter.endSection();
            formatter.section("thread stack", walkThread);
            dumpStackTrace(walkThread);
            formatter.endSection();
        }
        formatter.end("thread stacks");
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : GCVMThreadListIterator(com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator) BaseStackWalkerCallbacks(com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) WalkState(com.ibm.j9ddr.vm29.j9.stackwalker.WalkState) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 12 with PointerPointer

use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.

the class CheckJNIGlobalReferences method check.

@Override
public void check() {
    try {
        VoidPointer globalRefs = VoidPointer.cast(getJavaVM().jniGlobalReferences());
        GCJNIGlobalReferenceIterator jniGlobalReferenceIterator = GCJNIGlobalReferenceIterator.from();
        while (jniGlobalReferenceIterator.hasNext()) {
            PointerPointer slot = PointerPointer.cast(jniGlobalReferenceIterator.nextAddress());
            if (slot.notNull()) {
                if (_engine.checkSlotPool(slot, globalRefs) != J9MODRON_SLOT_ITERATOR_OK) {
                    return;
                }
            }
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : GCJNIGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 13 with PointerPointer

use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.

the class CheckMonitorTable method check.

@Override
public void check() {
    try {
        GCMonitorReferenceIterator monitorReferenceIterator = GCMonitorReferenceIterator.from();
        while (monitorReferenceIterator.hasNext()) {
            J9ObjectMonitorPointer objectMonitor = monitorReferenceIterator.next();
            J9ThreadAbstractMonitorPointer monitor = J9ThreadAbstractMonitorPointer.cast(objectMonitor.monitor());
            PointerPointer slot = PointerPointer.cast(monitor.userDataEA());
            if (_engine.checkSlotPool(slot, VoidPointer.cast(monitorReferenceIterator.currentMonitorTable().getJ9HashTablePointer())) != J9MODRON_SLOT_ITERATOR_OK) {
                return;
            }
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9ObjectMonitorPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectMonitorPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) GCMonitorReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCMonitorReferenceIterator) J9ThreadAbstractMonitorPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ThreadAbstractMonitorPointer)

Example 14 with PointerPointer

use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.

the class CheckEngine method checkSlotStack.

public int checkSlotStack(PointerPointer objectIndirect, J9VMThreadPointer vmThread, VoidPointer stackLocation) {
    J9ObjectPointer object;
    try {
        object = J9ObjectPointer.cast(objectIndirect.at(0));
        int result = checkObjectIndirect(object);
        if (J9MODRON_GCCHK_RC_STACK_OBJECT == result) {
            result = checkStackObject(object);
        }
        if (J9MODRON_GCCHK_RC_OK != result) {
            CheckError error = new CheckError(vmThread, objectIndirect, stackLocation, _cycle, _currentCheck, result, _cycle.nextErrorCount());
            _reporter.report(error);
            return J9MODRON_SLOT_ITERATOR_RECOVERABLE_ERROR;
        }
    } catch (CorruptDataException e) {
        // TODO : cde should be part of the error
        CheckError error = new CheckError(vmThread, objectIndirect, stackLocation, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount());
        _reporter.report(error);
        return J9MODRON_SLOT_ITERATOR_RECOVERABLE_ERROR;
    }
    return J9MODRON_SLOT_ITERATOR_OK;
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 15 with PointerPointer

use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.

the class CheckEngine method checkSlotVMThread.

public int checkSlotVMThread(PointerPointer objectIndirect, VoidPointer objectIndirectBase, int objectType, int iteratorState) {
    J9ObjectPointer object;
    try {
        object = J9ObjectPointer.cast(objectIndirect.at(0));
        int result = checkObjectIndirect(object);
        if ((GCVMThreadIterator.state_monitor_records == iteratorState) && (J9MODRON_GCCHK_RC_STACK_OBJECT == result)) {
            result = checkStackObject(object);
        }
        if (J9MODRON_GCCHK_RC_OK != result) {
            CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, result, _cycle.nextErrorCount(), objectType);
            _reporter.report(error);
        }
    } catch (CorruptDataException e) {
        // TODO : cde should be part of the error
        CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount(), objectType);
        _reporter.report(error);
    }
    return J9MODRON_SLOT_ITERATOR_OK;
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Aggregations

PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)31 CorruptDataException (com.ibm.j9ddr.CorruptDataException)22 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)10 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)9 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)6 UDATA (com.ibm.j9ddr.vm29.types.UDATA)5 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)4 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)3 J9HashTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer)3 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)3 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)3 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)3 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2 WalkState (com.ibm.j9ddr.vm29.j9.stackwalker.WalkState)2 AbstractPointer (com.ibm.j9ddr.vm29.pointer.AbstractPointer)2 J9ConstantPoolPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ConstantPoolPointer)2 J9RAMClassRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMClassRefPointer)2 J9RAMMethodHandleRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMMethodHandleRefPointer)2 J9RAMMethodTypeRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMMethodTypeRefPointer)2