Search in sources :

Example 31 with PointerPointer

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

the class CheckEngine method checkSlotRememberedSet.

public int checkSlotRememberedSet(PointerPointer objectIndirect, MM_SublistPuddlePointer puddle) {
    J9ObjectPointer object;
    try {
        object = J9ObjectPointer.cast(objectIndirect.at(0));
        if (isMidscavengeFlagSet()) {
            /* during a scavenge, some RS entries may be tagged -- remove the tag */
            if (object.anyBitsIn(DEFERRED_RS_REMOVE_FLAG)) {
                object = object.untag(DEFERRED_RS_REMOVE_FLAG);
            }
        }
        int result = checkObjectIndirect(object);
        if (J9MODRON_GCCHK_RC_OK != result) {
            CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, result, _cycle.nextErrorCount());
            _reporter.report(error);
            return J9MODRON_SLOT_ITERATOR_OK;
        }
        /* Additional checks for the remembered set */
        if (object.notNull()) {
            GCHeapRegionDescriptor objectRegion = findRegionForPointer(object, null);
            if (objectRegion == null) {
                /* shouldn't happen, since checkObjectIndirect() already verified this object */
                CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_NOT_FOUND, _cycle.nextErrorCount());
                _reporter.report(error);
                return J9MODRON_SLOT_ITERATOR_OK;
            }
            /* we shouldn't have newspace references in the remembered set */
            if (objectRegion.getTypeFlags().allBitsIn(MEMORY_TYPE_NEW)) {
                CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_REMEMBERED_SET_WRONG_SEGMENT, _cycle.nextErrorCount());
                _reporter.report(error);
                return J9MODRON_SLOT_ITERATOR_OK;
            }
            boolean skipObject = false;
            if (isScavengerBackoutFlagSet()) {
                GCScavengerForwardedHeader scavengerForwardedHeader = GCScavengerForwardedHeader.fromJ9Object(object);
                if (scavengerForwardedHeader.isReverseForwardedPointer()) {
                    /* There is no reason to check object - is gone */
                    skipObject = true;
                }
            }
            if (!skipObject) {
                /* content of Remembered Set should be Old and Remembered */
                if (!ObjectModel.isOld(object) || !ObjectModel.isRemembered(object)) {
                    CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_REMEMBERED_SET_FLAGS, _cycle.nextErrorCount());
                    _reporter.report(error);
                    _reporter.reportObjectHeader(error, object, null);
                    return J9MODRON_SLOT_ITERATOR_OK;
                }
            }
        }
    } catch (CorruptDataException e) {
        // TODO : cde should be part of the error
        CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount());
        _reporter.report(error);
    }
    return J9MODRON_SLOT_ITERATOR_OK;
}
Also used : GCHeapRegionDescriptor(com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor) GCScavengerForwardedHeader(com.ibm.j9ddr.vm29.j9.gc.GCScavengerForwardedHeader) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 32 with PointerPointer

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

the class CheckEngine method checkSlot.

public int checkSlot(PointerPointer objectIndirect, VoidPointer objectIndirectBase, int objectType) {
    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(), 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)

Example 33 with PointerPointer

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

the class CheckRememberedSet method check.

@Override
public void check() {
    try {
        /* no point checking if the scavenger wasn't turned on */
        if (!J9BuildFlags.gc_modronScavenger || !_extensions.scavengerEnabled()) {
            return;
        }
        GCRememberedSetIterator remSetIterator = GCRememberedSetIterator.from();
        while (remSetIterator.hasNext()) {
            MM_SublistPuddlePointer puddle = remSetIterator.next();
            GCRememberedSetSlotIterator remSetSlotIterator = GCRememberedSetSlotIterator.fromSublistPuddle(puddle);
            while (remSetSlotIterator.hasNext()) {
                PointerPointer objectIndirect = PointerPointer.cast(remSetSlotIterator.nextAddress());
                if (_engine.checkSlotRememberedSet(objectIndirect, puddle) != J9MODRON_SLOT_ITERATOR_OK) {
                    return;
                }
            }
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) GCRememberedSetSlotIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetSlotIterator) GCRememberedSetIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetIterator) MM_SublistPuddlePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 34 with PointerPointer

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

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

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