由于堆损坏,我通过系统环境变量启用了 gcUnmanagedToManaged MDA。不幸的是,我无法再运行我的应用程序了。我总是得到类似以下的东西:
(a78.1150): Unknown exception - code e053534f (first chance)
eax=00000000 ebx=00dff8ac ecx=00000000 edx=00000000 esi=00000003 edi=00000000
eip=7779013d esp=00dff85c ebp=00dff8f8 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246
ntdll!NtWaitForMultipleObjects+0x15:
7779013d 83c404 add esp,4
我所有的线程似乎都被杀死了(XXXX):
0:002> !threads
ThreadCount: 5
UnstartedThread: 1
BackgroundThread: 3
PendingThread: 0
DeadThread: 0
Hosted Runtime: no
PreEmptive GC Alloc Lock
ID OSID ThreadOBJ State GC Context Domain Count APT Exception
XXXX 1 c98 00401568 6020 Enabled 00000000:00000000 003c7698 4 STA
XXXX 2 4cc 0040be80 b220 Enabled 00000000:00000000 003c7698 0 MTA (Finalizer)
XXXX 3 1150 05525948 7220 Disabled 00000000:00000000 003c7698 0 STA System.StackOverflowException (0265106c)
XXXX 4 e2c 055778c0 200b220 Enabled 00000000:00000000 003c7698 1 MTA
XXXX 5 0 055b4a28 1600 Enabled 00000000:00000000 003c7698 0 Ukn
一旦我摆脱COMPLUS_MDA=gcUnmanagedToManaged
它,它就会按预期工作。我的系统是带有 .net 3.5 SP1 的 x86。
有什么提示吗?
更新:我也尝试调试它:
0:002> k 0xffff
ChildEBP RetAddr
00eef8cc 757015e9 ntdll!NtWaitForMultipleObjects+0x15
00eef968 75091a2c KERNELBASE!WaitForMultipleObjectsEx+0x100
00eef9b0 75094220 KERNEL32!WaitForMultipleObjectsExImplementation+0xe0
00eef9cc 724a7821 KERNEL32!WaitForMultipleObjects+0x18
00eefa2c 724a777e mscorwks!DebuggerRCThread::MainLoop+0xe9
00eefa5c 724a76a5 mscorwks!DebuggerRCThread::ThreadProc+0xe5
00eefa8c 750933aa mscorwks!DebuggerRCThread::ThreadProcStatic+0x9c
00eefa98 777a9ef2 KERNEL32!BaseThreadInitThunk+0xe
00eefad8 777a9ec5 ntdll!__RtlUserThreadStart+0x70
00eefaf0 00000000 ntdll!_RtlUserThreadStart+0x1b