Search in sources :

Example 81 with J9ObjectPointer

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

the class CheckEngine method checkSlotOwnableSynchronizerList.

public int checkSlotOwnableSynchronizerList(J9ObjectPointer object, MM_OwnableSynchronizerObjectListPointer currentList) {
    if (needVerifyOwnableSynchronizerConsistency()) {
        _ownableSynchronizerObjectCountOnList += 1;
    }
    try {
        int result = checkObjectIndirect(object);
        if (J9MODRON_GCCHK_RC_OK != result) {
            CheckError error = new CheckError(currentList, object, _cycle, _currentCheck, result, _cycle.nextErrorCount());
            _reporter.report(error);
            _reporter.reportHeapWalkError(error, _lastHeapObject1, _lastHeapObject2, _lastHeapObject3);
            return J9MODRON_SLOT_ITERATOR_UNRECOVERABLE_ERROR;
        }
        J9ClassPointer instanceClass = J9ObjectHelper.clazz(object);
        if (J9ClassHelper.classFlags(instanceClass).bitAnd(J9AccClassOwnableSynchronizer).eq(0)) {
            CheckError error = new CheckError(currentList, object, _cycle, _currentCheck, J9MODRON_GCCHK_RC_INVALID_FLAGS, _cycle.nextErrorCount());
            _reporter.report(error);
        }
    } catch (CorruptDataException e) {
        CheckError error = new CheckError(currentList, object, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount());
        _reporter.report(error);
        _reporter.reportHeapWalkError(error, _lastHeapObject1, _lastHeapObject2, _lastHeapObject3);
        return J9MODRON_SLOT_ITERATOR_UNRECOVERABLE_ERROR;
    }
    return J9MODRON_SLOT_ITERATOR_OK;
}
Also used : J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 82 with J9ObjectPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer 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 83 with J9ObjectPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer 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 84 with J9ObjectPointer

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

the class CheckOwnableSynchronizerList method print.

@Override
public void print() {
    try {
        MM_OwnableSynchronizerObjectListPointer ownableSynchronizerObjectList = getGCExtensions().ownableSynchronizerObjectLists();
        ScanFormatter formatter = new ScanFormatter(this, "ownableSynchronizerObjectList");
        while (ownableSynchronizerObjectList.notNull()) {
            formatter.section("list", ownableSynchronizerObjectList);
            J9ObjectPointer object = ownableSynchronizerObjectList._head();
            while (object.notNull()) {
                formatter.entry(object);
                object = ObjectAccessBarrier.getOwnableSynchronizerLink(object);
            }
            formatter.endSection();
            ownableSynchronizerObjectList = ownableSynchronizerObjectList._nextList();
        }
        formatter.end("ownableSynchronizerObjectList");
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) MM_OwnableSynchronizerObjectListPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer)

Example 85 with J9ObjectPointer

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

the class CheckOwnableSynchronizerList method check.

@Override
public void check() {
    try {
        MM_HeapRegionManagerPointer heapRegionManager = getGCExtensions().heapRegionManager();
        long maximumOwnableSynchronizerCountOnHeap = heapRegionManager._totalHeapSize().longValue() / J9Consts.J9_GC_MINIMUM_OBJECT_SIZE;
        MM_OwnableSynchronizerObjectListPointer ownableSynchronizerObjectList = getGCExtensions().ownableSynchronizerObjectLists();
        while (ownableSynchronizerObjectList.notNull()) {
            J9ObjectPointer object = ownableSynchronizerObjectList._head();
            long ownableSynchronizerCount = 0;
            _engine.clearPreviousObjects();
            while (object.notNull()) {
                if (_engine.checkSlotOwnableSynchronizerList(object, ownableSynchronizerObjectList) != CheckBase.J9MODRON_SLOT_ITERATOR_OK) {
                    break;
                }
                ownableSynchronizerCount += 1;
                if (ownableSynchronizerCount > maximumOwnableSynchronizerCountOnHeap) {
                    _engine.reportOwnableSynchronizerCircularReferenceError(object, ownableSynchronizerObjectList);
                    break;
                }
                _engine.pushPreviousObject(object);
                object = ObjectAccessBarrier.getOwnableSynchronizerLink(object);
            }
            ownableSynchronizerObjectList = ownableSynchronizerObjectList._nextList();
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
    if (_engine.needVerifyOwnableSynchronizerConsistency()) {
        /* call verifyOwnableSynchronizerObjectCounts() only at the end of CheckOwnableSynchronizerList,
			 * verifyOwnableSynchronizerObjectCounts need both the count calculated in CheckObjectHeap and in CheckOwnableSynchronizerList
			 * assumption: CheckOwnableSynchronizerList always happens after CheckObjectHeap in CheckCycle  
			 */
        _engine.verifyOwnableSynchronizerObjectCounts();
    }
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) MM_OwnableSynchronizerObjectListPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer)

Aggregations

J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)76 CorruptDataException (com.ibm.j9ddr.CorruptDataException)48 UDATA (com.ibm.j9ddr.vm29.types.UDATA)22 NoSuchElementException (java.util.NoSuchElementException)18 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)17 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)16 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)12 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)7 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)6 ObjectMonitor (com.ibm.j9ddr.vm29.j9.ObjectMonitor)5 MarkedObject (com.ibm.j9ddr.vm29.j9.gc.GCHeapMap.MarkedObject)5 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)5 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)5 GCObjectHeapIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectHeapIterator)4 GCObjectIterator (com.ibm.j9ddr.vm29.j9.gc.GCObjectIterator)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)4 ArrayList (java.util.ArrayList)4 J9ObjectFieldOffset (com.ibm.j9ddr.vm29.j9.J9ObjectFieldOffset)3 GCHeapRegionIterator (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionIterator)3 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)3