Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / March 2007

Tip: Looking for answers? Try searching our database.

My entire process freezes. - Help.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
esafran - 19 Mar 2007 11:26 GMT
Hi,

I experience a process freeze on my MultiThreaded console application.
(none of the threads are working)
When the process freeze occurs, I take a hang dump and I always see 2
of my threads in the same place.
Each thread is in a constructor, (different .ctor in each thread),
there is no locking or synchronization mechanism between those 2
threads.

The problem is, I can run the process number of times and in some
cases these threads will pass the code section where they usually hang
the entire process and in that case, everything will work fine.
But, sometimes, they will get stuck in the .ctors and the entire
process will hang.

I've taken a !dumpstack of one of the hanged threads (thread 57), and
I'm attaching it here from the part where I last seen my code
involvement.

i really would like to know on what handle my thread is waiting
(WaitForSingleObject):

Thread 57
Current frame: ntdll!KiFastSystemCallRet
 ChildEBP RetAddr    Caller,Callee
0dd9d4f4 7c90e9c0 ntdll!ZwWaitForSingleObject+0xc
0dd9d4f8 7c91901b ntdll!RtlpWaitForCriticalSection+0x132, calling
ntdll!NtWaitForSingleObject
0dd9d518 7c911970 ntdll!RtlpFreeDebugInfo+0x6a, calling ntdll!
_SEH_epilog
0dd9d52c 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9d538 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9d540 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9d56c 009f15bb fusion!operator delete+0x1b, calling ntdll!
RtlFreeHeap
0dd9d580 7c90104b ntdll!RtlEnterCriticalSection+0x46, calling ntdll!
RtlpWaitForCriticalSection
0dd9d588 7c917332 ntdll!LdrUnloadDll+0x38, calling ntdll!
RtlEnterCriticalSection
0dd9d5a8 009f1c26 fusion!CAssemblyName::`scalar deleting
destructor'+0x17, calling fusion!operator delete
0dd9d5cc 792017ea mscorwks!AssemblySpec::LowLevelLoadManifestFile
+0x3b5, calling msvcr71!free
0dd9d5d0 79217931 mscorwks!AssemblySpec::LowLevelLoadManifestFile
+0x3d1, calling mscorwks!__security_check_cookie
0dd9d600 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9d604 7c80995a kernel32!LocalFree+0x27, calling ntdll!RtlFreeHeap
0dd9d610 7c80996d kernel32!LocalFree+0x108, calling kernel32!
_SEH_epilog
0dd9d628 7c910e91 ntdll!RtlFreeHeap+0x4fc, calling ntdll!
RtlLeaveCriticalSection
0dd9d648 7c80996d kernel32!LocalFree+0x108, calling kernel32!
_SEH_epilog
0dd9d64c 7921a391 mscorwks!EEUnicodeHashTableHelper::DeleteEntry+0xc,
calling kernel32!LocalFree
0dd9d674 7c80abf7 kernel32!FreeLibrary+0x3f, calling ntdll!
LdrUnloadDll
0dd9d688 7925cbdf mscorwks!CorMap::ReleaseHandleResources+0x70,
calling kernel32!FreeLibrary
0dd9d6a0 7921a380 mscorwks!CorMapInfo::Release+0x63, calling mscorwks!
CorMap::ReleaseHandleResources
0dd9d6b8 791c592e mscorwks!CorMap::ReleaseHandle+0xe, calling mscorwks!
CorMapInfo::Release
0dd9d6c0 791c6328 mscorwks!PEFile::~PEFile+0x37, calling mscorwks!
CorMap::ReleaseHandle
0dd9d6cc 791c6335 mscorwks!PEFile::`scalar deleting destructor'+0xb,
calling mscorwks!PEFile::~PEFile
0dd9d6d8 79218410 mscorwks!BaseDomain::LoadAssembly+0x28b, calling
mscorwks!PEFile::`scalar deleting destructor'
0dd9d6f0 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9d6f4 7c34218a msvcr71!free+0xc3, calling ntdll!RtlFreeHeap
0dd9d700 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9d738 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9d73c 791e9ccb mscorwks!EEClass::_GetFullyQualifiedNameForClass
+0xc3, calling msvcr71!free
0dd9d74c 791e9ce3 mscorwks!EEClass::_GetFullyQualifiedNameForClass
+0xdb, calling mscorwks!__security_check_cookie
0dd9d760 793852c5 mscorwks!MDInternalRW::GetFieldDefProps+0x51,
calling mscorwks!CMDSemReadWrite::~CMDSemReadWrite
0dd9d78c 791e909a mscorwks!CEEInfo::getFieldAttribs+0xd0, calling
mscorwks!FieldDesc::IsSpecialStatic
0dd9d7a0 79431a6d mscorjit!Compiler::impAppendStmt+0xae, calling
mscorjit!Compiler::impCurStmtOffsSet
0dd9d7b8 79431a8f mscorjit!Compiler::impAppendTree+0x1b, calling
mscorjit!Compiler::impAppendStmt
0dd9d7c8 79431daf mscorjit!Compiler::impImportBlockCode+0x3b8f,
calling mscorjit!Compiler::impAppendTree
0dd9d7ec 791b2fa2 mscorwks!AutoCooperativeGC::AutoCooperativeGC+0x18,
calling mscorwks.pdb not exist
Use alternate method which may not work.
00a71e90
0dd9d7f8 791b5655 mscorwks!HashMap::LookupValue+0x22, calling mscorwks!
AutoCooperativeGC::AutoCooperativeGC
0dd9d7fc 791b56ce mscorwks!HashMap::LookupValue+0xbb, calling mscorwks!
AutoCooperativeGC::~AutoCooperativeGC
0dd9d84c 792176e6 mscorwks!AssemblySpec::LoadAssembly+0x4da, calling
mscorwks!BaseDomain::LoadAssembly
0dd9d880 791e9411 mscorwks!EEClassHashTable::ConstructKeyFromData+0x43
0dd9d8b4 791e3aee mscorwks!EEClassHashTable::CompareKeys+0x5c, calling
mscorwks!EEClassHashTable::ConstructKeyFromData
0dd9d8b8 791e3b4c mscorwks!EEClassHashTable::CompareKeys+0x8c, calling
msvcr71!strcmp
0dd9d92c 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9d930 7c34218a msvcr71!free+0xc3, calling ntdll!RtlFreeHeap
0dd9d93c 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9d974 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9d978 791e9b81 mscorwks!
MarshalInfo::OutputCustomerCheckedBuildMarshalInfo+0x41a, calling
msvcr71!free
0dd9d984 791e9bac mscorwks!
MarshalInfo::OutputCustomerCheckedBuildMarshalInfo+0x44d, calling
mscorwks!__security_check_cookie
0dd9d98c 51a92309 diasymreader!SymCachePdb::mapModIdToGlobalId+0x67,
calling diasymreader!__security_check_cookie
0dd9d9a8 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9d9d4 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9d9e0 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9da10 7c911596 ntdll!RtlAllocateHeap+0x43d, calling ntdll!
RtlLeaveCriticalSection
0dd9da14 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9da24 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9da50 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9da54 7c9106ab ntdll!RtlAllocateHeap+0x1c2, calling ntdll!
RtlpAllocateFromHeapLookaside
0dd9da58 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9da70 794369ca mscorjit!Compiler::genCodeForTree_DONE+0xd, calling
mscorjit!Compiler::genUpdateLife
0dd9da80 7943e103 mscorjit!Compiler::genCodeForTree_REG_VAR1+0x24,
calling mscorjit!Compiler::genCodeForTree_DONE
0dd9da90 79440b77 mscorjit!emitter::emitNewInstrTiny+0xd, calling
mscorjit!emitter::emitAllocInstr
0dd9daa0 79440ba9 mscorjit!emitter::emitIns_R_R+0x33, calling mscorjit!
emitter::emitNewInstrTiny
0dd9dab4 7943a4bb mscorjit!Compiler::inst_RV_RV+0x26, calling mscorjit!
emitter::emitIns_R_R
0dd9dabc 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9dac8 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9daf4 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9daf8 7c9106ab ntdll!RtlAllocateHeap+0x1c2, calling ntdll!
RtlpAllocateFromHeapLookaside
0dd9dafc 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9db38 7c911596 ntdll!RtlAllocateHeap+0x43d, calling ntdll!
RtlLeaveCriticalSection
0dd9db3c 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9db4c 791e399d mscorwks!EEClassHashTable::GetValue+0x23, calling
mscorwks!EEClassHashTable::GetValue
0dd9db64 791e3bd3 mscorwks!ClassLoader::GetClassValue+0x10e, calling
mscorwks!EEClassHashTable::GetValue
0dd9db88 791e3bf6 mscorwks!ClassLoader::FindClassModule+0x147, calling
mscorwks!ClassLoader::GetClassValue
0dd9dbec 791b95db mscorwks!ClassLoader::LookupTypeHandle+0x81, calling
mscorwks!ClassLoader::FindClassModule
0dd9dc14 791b9724 mscorwks!ClassLoader::LookupTypeHandle+0x3a8,
calling mscorwks!__security_check_cookie
0dd9dc20 791b3170 mscorwks!EE_LeaveCriticalSection+0xc, calling ntdll!
RtlLeaveCriticalSection
0dd9dc24 791b3176 mscorwks!EE_LeaveCriticalSection+0x12, calling
mscorwks.pdb not exist
Use alternate method which may not work.
00a71e90
0dd9dc2c 7939e81b mscorwks!Debugger::UnlockJITInfoMutex+0x12, calling
mscorwks!EE_LeaveCriticalSection
0dd9dc34 793a4596 mscorwks!Debugger::GetJitInfo+0x1cc
0dd9dc70 51a97d02 diasymreader!pdb_internal::Map<unsigned
long,NMTNI::SZO,pdb_internal::HashClass<unsigned long,0>,void>::find
+0x28, calling diasymreader!pdb_internal::ISet::contains
0dd9dc98 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9dca4 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9dca8 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9dcb0 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9dcc4 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9dd00 009f2ebb fusion!CLoadContext::Lock+0x2c, calling ntdll!
RtlEnterCriticalSection
0dd9dd04 009f2ec6 fusion!CLoadContext::Lock+0x37, calling fusion!
_SEH_epilog
0dd9dd24 009f2e24 fusion!CLoadContext::AddRef+0x10, calling kernel32!
InterlockedIncrement
0dd9dd30 009f2e3a fusion!CLoadContext::Release+0x12, calling kernel32!
InterlockedDecrement
0dd9dd44 791e3112 mscorwks!CodeBaseInfo::SetParentAssembly+0x4a
0dd9dd68 79217588 mscorwks!Assembly::LoadExternalAssembly+0x1a8,
calling mscorwks!AssemblySpec::LoadAssembly
0dd9de30 51a935f9 diasymreader!pdb_internal::Map<unsigned
long,unsigned short *,pdb_internal::HashClass<unsigned long,
0>,void>::add+0x58, calling diasymreader!pdb_internal::Map<unsigned
long,unsigned short *,pdb_internal::HashClass<unsigned long,
0>,void>::grow
0dd9de44 51a93688 diasymreader!NMP::StringCache::add+0x3c, calling
diasymreader!pdb_internal::Map<unsigned long,unsigned short
*,pdb_internal::HashClass<unsigned long,0>,void>::add
0dd9de5c 51a936f8 diasymreader!NMP::getNameW2+0x8b, calling
diasymreader!NMP::StringCache::add
0dd9de68 51a93711 diasymreader!NMP::getNameW2+0xa0, calling
diasymreader!SafeStackAllocator<1024>::Free
0dd9de70 51a9ae4b diasymreader!NMP::getNameW2+0xc2, calling
diasymreader!__security_check_cookie
0dd9ded8 006f0069 mscorwks.pdb not exist
Use alternate method which may not work.
006f0069, calling mscorwks.pdb not exist
Use alternate method which may not work.
012b6d6f
0dd9def8 006f0069 mscorwks.pdb not exist
Use alternate method which may not work.
006f0069, calling mscorwks.pdb not exist
Use alternate method which may not work.
012b6d6f
0dd9df28 791e308e mscorwks!Module::LookupAssemblyRef+0x18, calling
mscorwks!Module::GetFromRidMap
0dd9df38 791e30a9 mscorwks!Assembly::FindExternalAssembly+0x17,
calling mscorwks!Module::LookupAssemblyRef
0dd9df50 791e37e5 mscorwks!Assembly::FindAssemblyByTypeRef+0xbe,
calling mscorwks!Assembly::FindExternalAssembly
0dd9df84 791f4631 mscorwks!CompareTypeTokens+0x242, calling mscorwks!
Assembly::FindAssemblyByTypeRef
0dd9df8c 791b5eaa mscorwks!Module::LookupTypeDef+0x18, calling
mscorwks!Module::GetFromRidMap
0dd9df9c 791b5ce6 mscorwks!ClassLoader::LookupInModule+0x35, calling
mscorwks!Module::LookupTypeDef
0dd9dfa4 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9dfb4 791b5d20 mscorwks!ClassLoader::LoadTypeHandle+0x2f, calling
mscorwks!TypeHandle::IsRestored
0dd9dfc4 791db614 mscorwks!Module::LookupTypeRef+0x18, calling
mscorwks!Module::GetFromRidMap
0dd9dfe0 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9dfe4 791bc803 mscorwks!CMiniMdBase::getIX+0x21, calling mscorwks!
MetaDataTracker::NoteAccess
0dd9dffc 792175d8 mscorwks!Assembly::FindExternalAssembly+0x3c,
calling mscorwks!Assembly::LoadExternalAssembly
0dd9e024 791e37e5 mscorwks!Assembly::FindAssemblyByTypeRef+0xbe,
calling mscorwks!Assembly::FindExternalAssembly
0dd9e058 791e389a mscorwks!ClassLoader::LoadTypeHandle+0x8c, calling
mscorwks!Assembly::FindAssemblyByTypeRef
0dd9e07c 791e8ce5 mscorwks!MetaSig::CompareMethodSigs+0x17c, calling
mscorwks!MetaSig::CompareMethodSigs
0dd9e08c 791b5e2e mscorwks!SigPointer::GetTypeHandle+0x189, calling
mscorwks!ClassLoader::LoadTypeHandle
0dd9e0e0 791df24c mscorwks!EEClass::GetDescFromMemberRef+0x7e, calling
mscorwks!Module::LookupMemberRef
0dd9e0e8 791de15f mscorwks!EEClass::GetDescFromMemberRef+0x7d3,
calling mscorwks!__security_check_cookie
0dd9e104 791e8d04 mscorwks!Module::StoreMemberRef+0x1b, calling
mscorwks!Module::AddToRidMap
0dd9e118 791e8e2d mscorwks!EEClass::GetDescFromMemberRef+0x30c,
calling mscorwks!Module::StoreMemberRef
0dd9e120 791de15f mscorwks!EEClass::GetDescFromMemberRef+0x7d3,
calling mscorwks!__security_check_cookie
0dd9e134 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e144 791df4a2 mscorwks!Module::LookupFieldDef+0x18, calling
mscorwks!Module::GetFromRidMap
0dd9e154 791de119 mscorwks!EEClass::GetDescFromMemberRef+0x419,
calling mscorwks!Module::LookupFieldDef
0dd9e158 791de15f mscorwks!EEClass::GetDescFromMemberRef+0x7d3,
calling mscorwks!__security_check_cookie
0dd9e178 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e17c 7c9106ab ntdll!RtlAllocateHeap+0x1c2, calling ntdll!
RtlpAllocateFromHeapLookaside
0dd9e180 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9e1b0 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e1b4 7c9106ab ntdll!RtlAllocateHeap+0x1c2, calling ntdll!
RtlpAllocateFromHeapLookaside
0dd9e1b8 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9e228 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9e22c 51a97d1d diasymreader!pdb_internal::Map<unsigned
long,NMTNI::SZO,pdb_internal::HashClass<unsigned long,0>,void>::find
+0x53, calling diasymreader!pdb_internal::ISet::contains
0dd9e248 51a9824e diasymreader!pdb_internal::Map<unsigned
long,unsigned short *,pdb_internal::HashClass<unsigned long,
0>,void>::map+0x12, calling diasymreader!pdb_internal::Map<unsigned
long,unsigned short *,pdb_internal::HashClass<unsigned long,
0>,void>::find
0dd9e26c 51a98379 diasymreader!NMT::getNewNIForOld+0x13, calling
diasymreader!pdb_internal::Map<unsigned long,unsigned short
*,pdb_internal::HashClass<unsigned long,0>,void>::map
0dd9e280 51a9839e diasymreader!NMT::szForNi+0x17, calling diasymreader!
NMT::fLoadString
0dd9e290 51a982d2 diasymreader!NMT::find+0x2a, calling diasymreader!
NMT::szForNi
0dd9e2b4 51a9aee1 diasymreader!NMP::containsUTF8+0x14, calling
diasymreader!NMT::find
0dd9e2c8 51a9238a diasymreader!NMP::containsW+0x4c
0dd9e2d0 51a9239d diasymreader!NMP::containsW+0x5f, calling
diasymreader!SafeStackAllocator<1024>::Free
0dd9e2d8 51a923a9 diasymreader!NMP::containsW+0x6b, calling
diasymreader!__security_check_cookie
0dd9e340 7c911bff ntdll!RtlpInsertFreeBlock+0x118, calling ntdll!
RtlpUpdateIndexInsertBlock
0dd9e364 7c91825d ntdll!RtlpExtendHeap+0x2aa, calling ntdll!
RtlpInsertFreeBlock
0dd9e3a0 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e3b0 791b555f mscorwks!MetaDataTracker::LogHeapAccess+0x1c3,
calling mscorwks!_SEH_epilog
0dd9e3c8 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9e3e8 791b6256 mscorwks!DomainLocalBlock::IsClassInitialized+0x10,
calling mscorwks!DomainLocalBlock::EnsureIndex
0dd9e3fc 791e904a mscorwks!CEEInfo::getClassAttribs+0xf7, calling
mscorwks!DomainLocalBlock::IsClassInitialized
0dd9e400 791de825 mscorwks!CEEInfo::getClassAttribs+0x309, calling
mscorwks!_SEH_epilog
0dd9e45c 791b5eaa mscorwks!Module::LookupTypeDef+0x18, calling
mscorwks!Module::GetFromRidMap
0dd9e468 791ded5e mscorwks!ClassLoader::CheckAccess+0x18, calling
mscorwks!ClassLoader::CanAccessClass
0dd9e470 791b4b81 mscorwks!MetaDataTracker::NoteAccess+0xc2, calling
mscorwks!_SEH_epilog
0dd9e48c 792032fa mscorwks!StgBlobPool::IsValidOffset+0x32, calling
mscorwks!CPackedLen::GetLength
0dd9e4a0 7920333f mscorwks!StgBlobPool::GetBlob+0x28, calling mscorwks!
CPackedLen::GetData
0dd9e4b4 79206fb0 mscorwks!
CMiniMdTemplate<CMiniMdRW>::getSignatureOfField+0x3b
0dd9e4d0 79386b61 mscorwks!MDInternalRW::GetSigOfFieldDef+0x2b,
calling mscorwks!CMiniMdTemplate<CMiniMdRW>::getSignatureOfField
0dd9e4d8 791b5941 mscorwks!GCFrame::GCFrame+0x23, calling mscorwks!
GCFrame::Init
0dd9e4e4 791df548 mscorwks!CEEInfo::getFieldType+0x94, calling
mscorwks!SigPointer::GetTypeHandle
0dd9e548 79453a73 mscorjit!Compiler::impImportBlockCode+0x2919
0dd9e570 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e58c 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e598 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e5a0 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e5b8 7c912270 ntdll!RtlAllocateHeap+0x677, calling ntdll!
RtlpUpdateIndexRemoveBlock
0dd9e5bc 7c911596 ntdll!RtlAllocateHeap+0x43d, calling ntdll!
RtlLeaveCriticalSection
0dd9e5c0 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9e5d0 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e5fc 7c3416b3 msvcr71!_heap_alloc+0xe0, calling ntdll!
RtlAllocateHeap
0dd9e608 7c3416b8 msvcr71!_heap_alloc+0xe5, calling msvcr71!
_SEH_epilog
0dd9e660 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e664 7c34218a msvcr71!free+0xc3, calling ntdll!RtlFreeHeap
0dd9e670 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9e68c 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9e6a8 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9e6ac 51a8f7c8 diasymreader!CDebugSSectionReader::`scalar deleting
destructor'+0x1d, calling msvcr71!free
0dd9e6b8 51a98075 diasymreader!CDiaBase::Release+0x23
0dd9e6c8 51a92280 diasymreader!Mod1::QueryFileNameInfo+0x168
0dd9e6f8 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e710 51a92309 diasymreader!SymCachePdb::mapModIdToGlobalId+0x67,
calling diasymreader!__security_check_cookie
0dd9e72c 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e758 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e75c 7c9106ab ntdll!RtlAllocateHeap+0x1c2, calling ntdll!
RtlpAllocateFromHeapLookaside
0dd9e760 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9e774 006f0069 mscorwks.pdb not exist
Use alternate method which may not work.
006f0069, calling mscorwks.pdb not exist
Use alternate method which may not work.
012b6d6f
0dd9e794 006f0069 mscorwks.pdb not exist
Use alternate method which may not work.
006f0069, calling mscorwks.pdb not exist
Use alternate method which may not work.
012b6d6f
0dd9e7d4 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e800 7c910732 ntdll!RtlpAllocateFromHeapLookaside+0x42, calling
ntdll!_SEH_epilog
0dd9e804 7c9106ab ntdll!RtlAllocateHeap+0x1c2, calling ntdll!
RtlpAllocateFromHeapLookaside
0dd9e808 7c9106eb ntdll!RtlAllocateHeap+0xeac, calling ntdll!
_SEH_epilog
0dd9e820 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e82c 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e834 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e840 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e84c 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e868 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e870 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e888 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e894 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e89c 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e8ac 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e8b8 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e8c0 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e8d8 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e8e4 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e8ec 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e908 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9e914 7c910551 ntdll!RtlFreeHeap+0x1e9, calling ntdll!
RtlpFreeToHeapLookaside
0dd9e91c 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e930 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e934 7c34218a msvcr71!free+0xc3, calling ntdll!RtlFreeHeap
0dd9e95c 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e96c 7c34218f msvcr71!free+0xc8, calling msvcr71!_SEH_epilog
0dd9e980 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e984 7c34218a msvcr71!free+0xc3, calling ntdll!RtlFreeHeap
0dd9e9ac 7c91056d ntdll!RtlFreeHeap+0x647, calling ntdll!_SEH_epilog
0dd9e9b0 7c34218a msvcr71!free+0xc3, calling ntdll!RtlFreeHeap
0dd9ea14 7c9105c8 ntdll!RtlpFreeToHeapLookaside+0x22, calling ntdll!
RtlpInterlockedPushEntrySList
0dd9ea44 79296a38 mscorwks!EEDbgInterfaceImpl::DisablePreemptiveGC
+0x6, calling mscorwks.pdb not exist
Use alternate method which may not work.
00a71e90
0dd9ea64 7943465a mscorjit!Compiler::impImportBlock+0x24a, calling
mscorjit!Compiler::impImportBlockCode
0dd9ea84 7943172e mscorjit!Compiler::bbNewBasicBlock+0x17, calling
mscorjit!norls_allocator::nraAlloc
0dd9ea90 79442d7b mscorjit!Compiler::fgInitBBLookup+0x2d, calling
mscorjit!norls_allocator::nraAlloc
0dd9eab0 79442b06 mscorjit!Compiler::fgMakeBasicBlocks+0x373, calling
mscorjit!Compiler::fgLinkBasicBlocks
0dd9eac0 79436b7e mscorjit!Compiler::fgSetStmtSeq+0x2c, calling
mscorjit!Compiler::fgSetTreeSeq
0dd9eb0c 794345fe mscorjit!Compiler::impImport+0xe8, calling mscorjit!
Compiler::impImportBlock
0dd9eb24 79434535 mscorjit!Compiler::fgImport+0x41, calling mscorjit!
Compiler::impImport
0dd9eb30 794311e5 mscorjit!Compiler::compCompile+0xb, calling mscorjit!
Compiler::fgImport
0dd9eb3c 794314e1 mscorjit!Compiler::compCompile+0x1e8, calling
mscorjit!Compiler::compCompile
0dd9eb88 79431582 mscorjit!jitNativeCode+0x95, calling mscorjit!
Compiler::compCompile
0dd9ebb0 05b5ea60  (stub for
DVTel.Logger.MotionDetection.MotionRenderer..ctor), calling
mscorwks.pdb not exist
Use alternate method which may not work.

Thanks in advance,

Eyal Safran.
Willy Denoyette [MVP] - 19 Mar 2007 20:42 GMT
> Hi,
>
[quoted text clipped - 474 lines]
>
> Eyal Safran.

What makes you think these two threads are the culprit, when there are at least 57 threads
in the process?
Also, why are you so sure your process freezes? Anyway, without seeing some code (for
instance your constructors) it's impossible to tell what's happening here. Note also that
while it's possible that you don't hold explicit locks, the called code or the runtime can
hold locks, such that you are deadlocking because some other threads hold the same lock.

Willy.
esafran - 20 Mar 2007 06:06 GMT
On Mar 19, 9:42 pm, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.be> wrote:

> What makes you think these two threads are the culprit, when there are at least 57 threads
> in the process?
[quoted text clipped - 4 lines]
>
> Willy.

Hi,

> What makes you think these two threads are the culprit, when there are at least 57 threads
> in the process?

You have to admit that it is very suspicious that with every run of
the process, when it hangs, I make a hang dump, and I see those
threads in the same place.
Besides, the run of these threads can be disabled by configuration,
and when the process launches with these threads disabled, the process
NEVER hangs:

Thread 57
ESP         EIP
0x0dd9e520  0x7c90eb94 [FRAME: GCFrame]
0x0dd9efb4  0x7c90eb94 [FRAME: GCFrame]
0x0dd9f060  0x7c90eb94 [FRAME: PrestubMethodFrame] [DEFAULT] [hasThis]
Void DVTel.Logger.MotionDetection.MotionRenderer..ctor(String)
0x0dd9f070  0x03d6f40f [DEFAULT] [hasThis] Class
DVTel.Logger.Common.IMotionDetector
DVTel.Logger.MotionDetection.CapabilityMotionDetector.Start(Class
DVTel.API.Entities.Physical.IMotionDetectionProfileEntity,Class
DVTel.API.Entities.Physical.IRoiEntity)
 at [+0x87] [+0x1e]
...

public MotionRenderer(string strName)
{
    m_strname = strName;
    ThreadName = string.Format("Motion Renderer {0}", Name);
    m_rcCounter = new RefCounter();
    m_rcCounter.FinalRelease += new EventHandler(FinalReleaseCallback);
    m_rcCounter.FirstAddRef += new EventHandler(FirstAddRefCallback);
}

Thread 62
ESP         EIP
0x1022e58c  0x7c90eb94 [FRAME: GCFrame]
0x1022f020  0x7c90eb94 [FRAME: GCFrame]
0x1022f0cc  0x7c90eb94 [FRAME: PrestubMethodFrame] [DEFAULT] [hasThis]
Void DVTel.Common.Streamer.SinkDecode_Video..ctor()
...

public SinkDecode_Video()
{
    m_dehIFrameReady = new ThreadStart(IFrameReadyCallback);
    m_dehDecodeFailure = new ThreadStart(OnDecodeFailure);
}

> Also, why are you so sure your process freezes?

1) if you  look at the process using: "Process explorer NT", then
there is no activity in ANY of the threads
2) if you try to attach to the process with Visual Studio, you don't
see the IDE loading any of the assemblies in the "Output" window.
3) if you try to pause the process, after you attached to it, the IDE
tells you that it still didn't load the assemblies and that it
couldn't determine the location of each thread ( or a similar message)
4) we have a console window which logs everything out, and it too
stops displaying new logs

Moreover, you can see in the !dumpstack i sent, that Thread 57 is
waiting: "ZwWaitForSingleObject" and the stack from that point, down
to my code, is pretty big and it contains calls for loading assemlies.
I suspect that there is an OS lock in loading assemblies, I just can't
figure out where.
The only difference with these 2 threads from all other threads, is
that each thread of those 2, is running in an assembly which have a
reference to a Managed c++ assembly.
They are not located in the same assembly, and they do not reference
to the same Managed c++ assembly, but they do reference to a Managed c+
+ assembly.
maybe the OS lock is something to do with the Managed c++.

I hope the information i gave here will help.
Looking forward to hear from you.

Eyal Safran.
Ismo Salonen - 20 Mar 2007 09:12 GMT
--snip--

By any chance these are global objects initialized by from Dllmain ?
This looks like loader lock but I'm not sure, just a guess.

ismo
esafran - 20 Mar 2007 13:39 GMT
> --snip--
>
> By any chance these are global objects initialized by from Dllmain ?
> This looks like loader lock but I'm not sure, just a guess.
>
> ismo

I've made !locks command:

0:057> !locks

CritSec ntdll!LdrpLoaderLock+0 at 7C97C0D8
LockCount          2
RecursionCount     2
OwningThread       1b88
EntryCount         23
ContentionCount    23
*** Locked

CritSec mscorwks!CorMap::m_pCorMapCrst+0 at 793DF9B0
LockCount          0
RecursionCount     1
OwningThread       1b1c
EntryCount         0
ContentionCount    0
*** Locked

CritSec +1422d0 at 001422D0
LockCount          0
RecursionCount     1
OwningThread       1f50
EntryCount         4
ContentionCount    4
*** Locked

CritSec +5992ec4 at 05992EC4
LockCount          0
RecursionCount     1
OwningThread       1b1c
EntryCount         0
ContentionCount    0
*** Locked

CritSec +5a43244 at 05A43244
LockCount          0
RecursionCount     1
OwningThread       1b88
EntryCount         0
ContentionCount    0
*** Locked

Scanned 1971 critical sections

Thread 1b88 = Thread 62
Thread 1b1c = Thread 57

It appears to be a loader lock

Eyal Safran.
Ben Voigt - 20 Mar 2007 14:00 GMT
> It appears to be a loader lock

Which version of C++.NET are your assemblies?  Managed Extensions for C++
(VC2003) has known loader lock bugs that microsoft won't fix.  Use C++/CLI
(VC2005) instead.

> Eyal Safran.
esafran - 20 Mar 2007 15:42 GMT
> > It appears to be a loader lock
>
[quoted text clipped - 5 lines]
>
> - Show quoted text -

Do you happen to know the link to this article of microsoft where they
state they won't fix it?

Eyal Safran.
Ben Voigt - 20 Mar 2007 17:40 GMT
>> > It appears to be a loader lock
>>
[quoted text clipped - 9 lines]
> Do you happen to know the link to this article of microsoft where they
> state they won't fix it?

http://msdn2.microsoft.com/en-us/library/ms173266(vs.80).aspx

The solution is definitely stated as: use .NET 2.0, the .NET 1.1 runtime
(not actually a VS2003 vs VS2005 issue) causes random loader lock.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/ht
ml/vcconmixeddllloadingproblem.asp


See also here, support for Managed Extensions for C++ will be removed
because C++/CLI replaces it.
http://msdn2.microsoft.com/en-us/library/b23b94s7(vs.80).aspx

> Eyal Safran.
esafran - 20 Mar 2007 15:50 GMT
> > It appears to be a loader lock
>
[quoted text clipped - 5 lines]
>
> - Show quoted text -

Do you know if by compiling my Managed C++ dlls in VC2005, but still
in .NET framework 1.1, will solve my loader lock problem?

Eyal Safran.
Ben Voigt - 20 Mar 2007 17:29 GMT
>> > It appears to be a loader lock
>>
[quoted text clipped - 9 lines]
> Do you know if by compiling my Managed C++ dlls in VC2005, but still
> in .NET framework 1.1, will solve my loader lock problem?

While all of .NET 1.1 is available in VC2005, I don't think you can target
the old metadata format.  Therefore, the Framework 1.x runtime won't be able
to load VC2005 dlls even if they only use the 1.x BCL.

I'm looking for the Microsoft note that loader lock won't be fixed for
VC2003.

> Eyal Safran.
Willy Denoyette [MVP] - 21 Mar 2007 10:16 GMT
>> > It appears to be a loader lock
>>
[quoted text clipped - 10 lines]
>
> Eyal Safran.

No, this won't work, if you can't fix the "OS loader lock" issue by one of the resolutions
as mentioned in the article (Initialization of Mixed Assemblies ) pointed to by Ben, then
you are out of luck and you will have to move forward.

Willy.
esafran - 21 Mar 2007 14:38 GMT
On Mar 21, 11:16 am, "Willy Denoyette [MVP]"
<willy.denoye...@telenet.be> wrote:

> >> > It appears to be a loader lock
>
[quoted text clipped - 18 lines]
>
> - Show quoted text -

I've found out a scenario where it always hang, and so, i've found a
workaround to it.
The problem is in the order DLLs are being loaded.

Example:
I have a Managed class MBuffer which references to its Unmanaged class
CBuffer

I also have a Managed class MDecoder which references to its Unmanaged
class CDecoder and it references to the unmanaged CBuffer.

MBuffer -> CBuffer
MDecoder -> CDecoder
CDecoder -> CBuffer

now, if the process have loaded the DLLs in the following order, the
process will get stuck:

1) MBuffer
2) CBuffer
3) MDecoder
4) CDecoder

however, if the loading order of the DLLs would have been:
1) MDecoder
2) CDecoder
3) CBuffer
4) MBuffer

the process will never get stuck.

I really don't know why it acts like that.

If you have any idea on how to solve / debug that, that would be
great.
Currently I'm forcing synchronization between the 2 threads with a
static ManualResetEvent, so that the MBuffer DLL will not load untill
its CBuffer  DLL will load.

Eyal Safran.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.