diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 2bf3268a2c7a9a..e082b24b456021 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -44531,8 +44531,6 @@ Object * GCHeap::NextObj (Object * object) #else unsigned int g = hp->object_gennum ((uint8_t*)object); #endif - if ((g == 0) && hp->settings.demotion) - return NULL;//could be racing with another core allocating. int align_const = get_alignment_constant (!large_object_p); uint8_t* nextobj = o + Align (size (o), align_const); if (nextobj <= o) // either overflow or 0 sized object. diff --git a/src/coreclr/vm/object.cpp b/src/coreclr/vm/object.cpp index be228446be88bb..0e1bf133986c44 100644 --- a/src/coreclr/vm/object.cpp +++ b/src/coreclr/vm/object.cpp @@ -572,6 +572,7 @@ VOID Object::ValidateInner(BOOL bDeep, BOOL bVerifyNextHeader, BOOL bVerifySyncB { Object * nextObj = GCHeapUtilities::GetGCHeap ()->NextObj (this); if ((nextObj != NULL) && + (nextObj->GetGCSafeMethodTable() != nullptr) && (nextObj->GetGCSafeMethodTable() != g_pFreeObjectMethodTable)) { // we need a read barrier here - to make sure we read the object header _after_ diff --git a/src/coreclr/vm/syncblk.cpp b/src/coreclr/vm/syncblk.cpp index 5b0a5ed6647c7c..36176c3c11594a 100644 --- a/src/coreclr/vm/syncblk.cpp +++ b/src/coreclr/vm/syncblk.cpp @@ -2950,8 +2950,7 @@ void ObjHeader::IllegalAlignPad() WRAPPER_NO_CONTRACT; #ifdef LOGGING void** object = ((void**) this) + 1; - LogSpewAlways("\n\n******** Illegal ObjHeader m_alignpad not 0, object" FMT_ADDR "\n\n", - DBG_ADDR(object)); + STRESS_LOG1(LF_ASSERT, LL_ALWAYS, "\n\n******** Illegal ObjHeader m_alignpad not 0, m_alignpad value: %d\n", m_alignpad); #endif _ASSERTE(m_alignpad == 0); }