C ++完整系统崩溃,仅发布模式 [英] C++ full system crash, release mode only

查看:53
本文介绍了C ++完整系统崩溃,仅发布模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为光线跟踪应用程序实现了专门的树数据结构.我在树的每个节点中使用std :: list来存储数据项.我在运行使用此数据结构的应用程序时遇到问题,不仅使应用程序崩溃,而且冻结了整个操作系统(Windows 7).这仅在发布模式下发生;在调试模式下,它花费的时间更长(如预期的那样),但效果很好.我使用的是Visual Studio2010.在发布模式下运行(Ctrl + F5)或调试(F5)都会导致整个系统崩溃.

I've implemented a specialised tree data structure for a ray tracing application. I'm using an std::list in each of the tree's nodes to store data items. I have a problem where running the application, with this data structure in use, crashes not only the application, but freezes the whole OS (Windows 7). This occurs in release mode only; in debug mode it takes longer (as is expected) but works fine. I'm using Visual Studio 2010. Running (Ctrl+F5) or debugging (F5) in release mode both caused the full system crash.

根据到目前为止的发现,释放和调试模式之间的不同行为似乎是由于内存泄漏引起的,因为调试模式(据我所了解)更加宽容.但是,我没有发现有关C ++应用程序使操作系统崩溃的任何信息.

From what I've found so far, different behaviour between release and debug mode seems to be attributed to memory leaks, as debug mode (from what I've understood) is a little more forgiving. However I've found nothing about a C++ application crashing the OS.

我只想知道在什么情况下会发生这种行为,所以我知道在哪里看.很难将问题简化为简单的问题并进行跟踪,因为射线跟踪的本质是高度平行并处理大量数据.

I'd just like to know under what circumstances such behaviour can occur, so I know where to look. It's difficult to reduce the problem to something simple and trace the issue, because it's in the nature of ray tracing to be highly parallel and work with a lot of data.

哦,问题出在不是,这是导致堆栈溢出的无限递归.我有意做到这一点,并且没有使操作系统崩溃.

Oh, and the problem is not an infinite recursion causing a stack overflow. I made that happen intentionally and it did not crash the OS.

推荐答案

您是否在调试模式下检查了内存使用情况?过多的内存使用和溢出交换将使系统变慢,就像地狱一样-您的系统在技术上可能没有崩溃-只是变得超级慢.在发布模式下,所有这些分配都将以相当快的速度进行-因此,您可能需要查看内存使用情况.

Did you check the memory usage in the debug mode ? Excessive memory usage and spilling over to swap would slow down the system like hell - your system might not have technically crashed - just become super slow. And in release mode, all that allocation would be happening at quite some speed - so you might want to look at the memory usage.

正如您所说,无限递归不会导致OS崩溃-它始终会导致分段错误.

And as you said, a infinite recursion will not cause he OS to crash - it always leads to a segmentation fault.

这篇关于C ++完整系统崩溃,仅发布模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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