拦截C ++运行时库缓冲区溢出 [英] Intercept C++ Runtime Library Buffer Overflow

查看:65
本文介绍了拦截C ++运行时库缓冲区溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在远程位置的无人值守嵌入式系统上运行复杂的应用程序。我们还使用了许多第三方SDK。我们正在检测到间歇性的"Microsoft Visual C ++运行时库缓冲区溢出!"错误。
我们的系统包括硬件和软件看门狗定时器,可自动重启失败的应用程序。有问题的过程包括对SetUnhandledExceptionFilter()的调用,以便在出错时我们可以记录一些最小的诊断,退出并允许自动
重启。我们遇到的(严重)问题是这个特殊错误似乎绕过了异常处理程序,它在受影响的线程上弹出一个错误对话框(我们不知道哪一个)并等待OK,而应用程序的其余部分继续一半它的大脑
缺失。结果看门狗重启无法启动。最终我们想找到并修复根本原因(或者如果它在第三方库中解决它),但与此同时我们至少希望系统自动重启。所以......

We have a complex application running on an unattended embedded system at a remote location. We also use a number of 3rd party SDKs. We are getting an intermittent "Microsoft Visual C++ Runtime Library Buffer overflow detected!" error. Our system includes hardware and software watchdog timers to automatically restart failed applications. The process in question includes a call to SetUnhandledExceptionFilter() so that on error we can record some minimal diagnostics, exit and allow an automatic restart. The (serious) problem we have is that this particular error seems to bypass the exception handler, it pops up an error dialog on the affected thread (we have no idea which one) and waits for OK while the rest of the app continues with half its brain missing. As a result the watchdog restart fails to kick in. Ultimately we want to find and fix the root cause (or work around it if its in a 3rd party library) but in the meantime we at least want the system to automatically restart. So...

我是否有一种代码可以拦截这个错误,以便(a)我至少可以记录一些最小的信息,例如线程ID和(b)中止我的程序,以便可以进行干净的重启?如上所述,我预计SetUnhandledExceptionFilter()会执行
这个,但在这种情况下它似乎不会。

Is there a way in code for me to intercept this error so that (a) I can at least record some minimal info such as the thread id and (b) abort my program so that a clean restart can happen? As mentioned I expected SetUnhandledExceptionFilter() to do this but it appears it does not in this case.

Al Chisholm

Al Chisholm

推荐答案

>我们正在检测到间歇性的"Microsoft Visual C ++运行时库缓冲区溢出!"错误。

>We are getting an intermittent "Microsoft Visual C++ Runtime Library Buffer overflow detected!" error.

听起来你正在运行调试版本。你好吗?

It sounds like you're running a debug build. Are you?

戴夫


这篇关于拦截C ++运行时库缓冲区溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆