目前正在测试建立在 C++ 库之上的 C# (.Net 4.5) WPF 应用程序(托管,我相信,我没有编写它)。由于各种(实际)原因,它在服务器上运行(安装了 VS2012,是的,很糟糕)。
该程序连接到相机(通过库)并显示它接收到的图像帧。
奇怪的是我遇到了缓冲区溢出(我可以理解的缓冲区溢出)。在垃圾收集期间!
A buffer overrun has occurred in App.exe which has corrupted the program's internal state.
各种其他可能有用的信息花絮:
- 提高“吞吐量”使其发生得更快(几秒钟而不是几分钟)
- 在 VS 中运行(调试或发布)完全停止它的发生(或者至少延迟它比我准备等待的时间更长)
- 我的 C# 中没有
unsafe
,我正在做的唯一“深奥”的事情是将位图(来自库)转换为BitmapSource
(像这样)。 - 这些库是为 x86 编译的,exe 也是。
调用堆栈,每次都一样:
vcr110_clr0400.dll!__crt_debugger_hook () Unknown
clr.dll!___raise_securityfailure () Unknown
clr.dll!___report_gsfailure () Unknown
clr.dll!CrawlFrame::SetCurGSCookie(unsigned long *) Unknown
clr.dll!StackFrameIterator::Init(class Thread *,class Frame *,struct _REGDISPLAY *,unsigned int) Unknown
clr.dll!Thread::StackWalkFramesEx(struct _REGDISPLAY *,enum StackWalkAction (*)(class CrawlFrame *,void *),void *,unsigned int,class Frame *) Unknown
clr.dll!Thread::StackWalkFrames(enum StackWalkAction (*)(class CrawlFrame *,void *),void *,unsigned int,class Frame *) Unknown
clr.dll!CNameSpace::GcScanRoots(void (*)(class Object * *,struct ScanContext *,unsigned long),int,int,struct ScanContext *,class GCHeap *) Unknown
clr.dll!WKS::gc_heap::mark_phase(int,int) Unknown
clr.dll!WKS::gc_heap::gc1(void) Unknown
clr.dll!WKS::gc_heap::garbage_collect(int) Unknown
clr.dll!WKS::GCHeap::GarbageCollectGeneration(unsigned int,enum WKS::gc_reason) Unknown
clr.dll!WKS::GCHeap::GarbageCollectTry(int,int,int) Unknown
clr.dll!WKS::GCHeap::GarbageCollect(int,int,int) Unknown
clr.dll!GCInterface::Collect(int,int) Unknown
mscorlib.ni.dll!6dcd33e5() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for mscorlib.ni.dll]
mscorlib.ni.dll!6dcd33e5() Unknown
064afa73() Unknown
clr.dll!MethodTable::FastBox(void * *) Unknown
clr.dll!MethodTable::CallFinalizer(class Object *) Unknown
clr.dll!SVR::CallFinalizer(class Object *) Unknown
clr.dll!SVR::CallFinalizer(class Object *) Unknown
clr.dll!SVR::CallFinalizer(class Object *) Unknown
clr.dll!WKS::GCHeap::FinalizerThreadWorker(void *) Unknown
clr.dll!Thread::DoExtraWorkForFinalizer(void) Unknown
clr.dll!Thread::DoExtraWorkForFinalizer(void) Unknown
clr.dll!Thread::DoExtraWorkForFinalizer(void) Unknown
clr.dll!WKS::GCHeap::FinalizerThreadStart(void *) Unknown
clr.dll!Thread::intermediateThreadProc(void *) Unknown
kernel32.dll!@BaseThreadInitThunk@12 () Unknown
ntdll.dll!___RtlUserThreadStart@8 () Unknown
ntdll.dll!__RtlUserThreadStart@8 () Unknown