如果调试运行正常,但发布崩溃怎么办? [英] what to do if debug runs fine, but release crashes

查看:152
本文介绍了如果调试运行正常,但发布崩溃怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序在调试版本中运行正常,但是当我在发布版本中启动它时,我得到一个

 未处理在myapp.exe 0x0043b134中的异常:0xC0000005:
读取位置0x004bd96c时访问冲突

如果我点击休息,它会告诉我没有加载符号,源代码无法显示。



我可以做什么这样一种情况来追踪问题?

解决方案

这种问题往往是由于统一化的变量。我会从那里开始寻找你的问题。



调试模式更为宽容,因为它通常配置为初始化尚未显式初始化的变量。



也许你正在删除一个统一化的指针。在调试模式下,它的工作原理是指针为空,并且删除ptr将为NULL。在释放它是一些垃圾,然后删除ptr实际上会导致问题。


I have an application that runs just fine in the debug build, but when I start it in the release build, I get a

unhandled Exception at 0x0043b134 in myapp.exe: 0xC0000005:
Access violation while reading at position 0x004bd96c

If I click on 'break' it tells me that there are no symbols loaded and the source code can't be displayed.

What can I do in such a situation to track down the problem?

解决方案

This kind of problem is often due to unitialized variables. I'd start there looking for your problem.

Debug mode is more forgiving because it is often configured to initialize variables that have not been explicitly initialized.

Perhaps you're deleting an unitialized pointer. In debug mode it works because pointer was nulled and delete ptr will be ok on NULL. On release it's some rubbish, then delete ptr will actually cause a problem.

这篇关于如果调试运行正常,但发布崩溃怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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