Search in sources :

Example 26 with VoidPointer

use of com.ibm.j9ddr.vm29.pointer.VoidPointer 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 27 with VoidPointer

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

the class CheckJNIGlobalReferences method print.

@Override
public void print() {
    try {
        VoidPointer globalRefs = VoidPointer.cast(getJavaVM().jniGlobalReferences());
        GCJNIGlobalReferenceIterator jniGlobalReferenceIterator = GCJNIGlobalReferenceIterator.from();
        ScanFormatter formatter = new ScanFormatter(this, "jniGlobalReferences", globalRefs);
        while (jniGlobalReferenceIterator.hasNext()) {
            J9ObjectPointer slot = jniGlobalReferenceIterator.next();
            if (slot.notNull()) {
                formatter.entry(slot);
            }
        }
        formatter.end("jniGlobalReferences", globalRefs);
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : GCJNIGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 28 with VoidPointer

use of com.ibm.j9ddr.vm29.pointer.VoidPointer 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 29 with VoidPointer

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

the class CheckJNIWeakGlobalReferences method print.

@Override
public void print() {
    try {
        VoidPointer weakRefs = VoidPointer.cast(getJavaVM().jniWeakGlobalReferences());
        GCJNIWeakGlobalReferenceIterator jniWeakGlobalReferenceIterator = GCJNIWeakGlobalReferenceIterator.from();
        ScanFormatter formatter = new ScanFormatter(this, "jniWeakGlobalReferences", weakRefs);
        while (jniWeakGlobalReferenceIterator.hasNext()) {
            J9ObjectPointer slot = jniWeakGlobalReferenceIterator.next();
            if (slot.notNull()) {
                formatter.entry(slot);
            }
        }
        formatter.end("jniWeakGlobalReferences", weakRefs);
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) GCJNIWeakGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 30 with VoidPointer

use of com.ibm.j9ddr.vm29.pointer.VoidPointer 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)

Aggregations

VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)48 CorruptDataException (com.ibm.j9ddr.CorruptDataException)37 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)15 NoSuchElementException (java.util.NoSuchElementException)13 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)9 UDATA (com.ibm.j9ddr.vm29.types.UDATA)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)5 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)5 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)5 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)3 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)3 CorruptData (com.ibm.dtfj.image.CorruptData)2 JavaObject (com.ibm.dtfj.java.JavaObject)2 J9DDRCorruptData (com.ibm.j9ddr.view.dtfj.image.J9DDRCorruptData)2 MonitorTable (com.ibm.j9ddr.vm29.j9.MonitorTable)2 GCJNIGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator)2 GCJNIWeakGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator)2 GCObjectIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectIterator)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2