Search in sources :

Example 56 with VoidPointer

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

the class CheckJNIWeakGlobalReferences method check.

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

Example 57 with VoidPointer

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

the class CheckJVMTIObjectTagTables method check.

@Override
public void check() {
    try {
        J9JVMTIDataPointer jvmtiData = J9JVMTIDataPointer.cast(getJavaVM().jvmtiData());
        if (jvmtiData.notNull()) {
            GCJVMTIObjectTagTableListIterator objectTagTableList = GCJVMTIObjectTagTableListIterator.fromJ9JVMTIData(jvmtiData);
            while (objectTagTableList.hasNext()) {
                J9JVMTIEnvPointer list = objectTagTableList.next();
                VoidPointer objectTagTable = VoidPointer.cast(list.objectTagTable());
                GCJVMTIObjectTagTableIterator objectTagTableIterator = GCJVMTIObjectTagTableIterator.fromJ9JVMTIEnv(list);
                while (objectTagTableIterator.hasNext()) {
                    PointerPointer slot = PointerPointer.cast(objectTagTableIterator.nextAddress());
                    if (slot.notNull()) {
                        if (_engine.checkSlotPool(slot, objectTagTable) != J9MODRON_SLOT_ITERATOR_OK) {
                            return;
                        }
                    }
                }
            }
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : GCJVMTIObjectTagTableListIterator(com.ibm.j9ddr.vm29.j9.gc.GCJVMTIObjectTagTableListIterator) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) J9JVMTIDataPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JVMTIDataPointer) J9JVMTIEnvPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JVMTIEnvPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) GCJVMTIObjectTagTableIterator(com.ibm.j9ddr.vm29.j9.gc.GCJVMTIObjectTagTableIterator)

Example 58 with VoidPointer

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

the class CheckEngine method checkSlotPool.

public int checkSlotPool(PointerPointer objectIndirect, VoidPointer objectIndirectBase) {
    J9ObjectPointer object;
    try {
        object = J9ObjectPointer.cast(objectIndirect.at(0));
        int result = checkObjectIndirect(object);
        if (J9MODRON_GCCHK_RC_OK != result) {
            CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, result, _cycle.nextErrorCount(), CheckError.check_type_other);
            _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(), CheckError.check_type_other);
        _reporter.report(error);
    }
    return J9MODRON_SLOT_ITERATOR_OK;
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 59 with VoidPointer

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

the class CheckReporterTTY method report.

@Override
public void report(CheckError error) {
    if (!shouldReport(error)) {
        return;
    }
    try {
        /* If slot is NULL, we are not scanning the slots of an object, but looking directly at an object/class on the heap. */
        if ((error._slot != null) && (error._slot.notNull())) {
            VoidPointer slot = error._slot;
            UDATA slotValue;
            switch(error._objectType) {
                case check_type_object:
                    J9ObjectPointer fieldValue = ObjectReferencePointer.cast(slot).at(0);
                    slotValue = UDATA.cast(fieldValue);
                    break;
                case check_type_thread:
                    slotValue = UDATAPointer.cast(slot).at(0);
                    slot = error._stackLocation;
                    break;
                case check_type_unfinalized:
                    // In this case, there isn't really a "slot", only the value
                    // TODO kmt : This probably shouldn't use the object(offset) format.
                    slotValue = UDATA.cast(slot);
                    slot = VoidPointer.NULL;
                    break;
                default:
                    slotValue = UDATAPointer.cast(slot).at(0);
            }
            out.println(String.format("  <gc check (%d): %s: %s: %sslot %x(%x) -> %x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), slot.getAddress(), slotValue.longValue(), getErrorType(error._errorCode)));
        } else {
            out.println(String.format("  <gc check (%d): %s: %s: %s%x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), getErrorType(error._errorCode)));
            /* If the basic checks have been made (alignment, etc.) display header info. */
            if (error._objectType == check_type_object) {
                reportObjectHeader(error, J9ObjectPointer.cast(error._object), "");
            }
        }
    } catch (CorruptDataException cde) {
        out.println(String.format("  <gc check (%d): %s: %s: %s%x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), getErrorType(error._errorCode)));
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 60 with VoidPointer

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

the class J9SRPFormatter method format.

@Override
public FormatWalkResult format(String name, String type, String declaredType, int thisTypeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
    if (thisTypeCode != typeCode) {
        return FormatWalkResult.KEEP_WALKING;
    }
    VoidPointer targetAddress = VoidPointer.NULL;
    /* Figure out the resulting address */
    if (wide) {
        WideSelfRelativePointer s = WideSelfRelativePointer.cast(address);
        targetAddress = s.get();
    } else {
        SelfRelativePointer s = SelfRelativePointer.cast(address);
        targetAddress = s.get();
    }
    if (type.contains("(")) {
        /* Strip off one layer of SRP, work out the SRP address, and re-format it */
        type = stripSRP(type);
        structureFormatter.formatField(name, type, type, targetAddress.getAddress(), out, context);
    } else {
        /* An SRP without the final type specified */
        out.print("!j9x ");
        out.print(targetAddress.getHexAddress());
    }
    return FormatWalkResult.STOP_WALKING;
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) WideSelfRelativePointer(com.ibm.j9ddr.vm29.pointer.WideSelfRelativePointer) SelfRelativePointer(com.ibm.j9ddr.vm29.pointer.SelfRelativePointer) WideSelfRelativePointer(com.ibm.j9ddr.vm29.pointer.WideSelfRelativePointer)

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