VC++ 中的异常错误 c0000005 [英] Exception Error c0000005 in VC++

查看:87
本文介绍了VC++ 中的异常错误 c0000005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 VC++ 控制台应用程序.

Am working on VC++ Console Application.

此应用程序从 AppdataRoaming 文件夹发送一个文件一段时间.

This application sends a file from AppdataRoaming folder for a period of time.

发生的事情是我收到此崩溃错误:

What happens is am getting this Crash error :

Problem signature:
Problem Event Name: APPCRASH
Application Name:   App.exe
Application Version:    1.0.0.2
Application Timestamp:  51c02fa8
Fault Module Name:  PCMeter.exe
Fault Module Version:   1.0.0.2
Fault Module Timestamp: 51c02fa8
Exception Code: c0000005
Exception Offset:   000069eb
OS Version: 6.1.7601.2.1.0.256.48
Locale ID:  1033
Additional Information 1:   0a9e
Additional Information 2:   0a9e372d3b4ad19135b953a78882e789
Additional Information 3:   0a9e
Additional Information 4:   0a9e372d3b4ad19135b953a78882e789

谁能帮我解决这个问题

推荐答案

Exception code c0000005 是访问冲突的代码.这意味着您的程序正在访问(读取或写入)它无权访问的内存地址.最常见的原因是:

Exception code c0000005 is the code for an access violation. That means that your program is accessing (either reading or writing) a memory address to which it does not have rights. Most commonly this is caused by:

  • 访问过时的指针.那就是访问已经释放的内存.请注意,这种陈旧的指针访问并不总是会导致访问冲突.只有当内存管理器将内存返回给系统时,您才会遇到访问冲突.
  • 读取数组的末尾.这是当您有一个长度为 N 的数组并且您访问索引为 >=N 的元素时.
  • Accessing a stale pointer. That is accessing memory that has already been deallocated. Note that such stale pointer accesses do not always result in access violations. Only if the memory manager has returned the memory to the system do you get an access violation.
  • Reading off the end of an array. This is when you have an array of length N and you access elements with index >=N.

要解决此问题,您需要进行一些调试.如果您无法在开发机器上的调试器下发生故障,您应该获得故障转储文件并将其加载到您的调试器中.这将允许您查看问题发生在代码中的哪个位置,并有望引导您找到解决方案.您需要拥有与可执行文件关联的调试符号才能查看有意义的堆栈跟踪.

To solve the problem you'll need to do some debugging. If you are not in a position to get the fault to occur under your debugger on your development machine you should get a crash dump file and load it into your debugger. This will allow you to see where in the code the problem occurred and hopefully lead you to the solution. You'll need to have the debugging symbols associated with the executable in order to see meaningful stack traces.

这篇关于VC++ 中的异常错误 c0000005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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