本文介绍了访问冲突“0xc0000005”的范围究竟是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道异常0xc0000005以及它的含义。

I was wondering about exception 0xc0000005 and what it acctually encompasses.

I.e。我认为这是发生在应用程序试图访问释放的内存/内存属于另一个进程。

但是,例如,为硬件映射的地址呢?或者有效范围之外的地址?尝试使用相同的代码尝试访问这些故障,还是有自己的?
这是否包含对进程拥有的有效地址的读取失败?

I.e. I take it this occurs if an application tries to access freed memory/memory belonging to another process.
But what about, for example, an address mapped for hardware? Or an address outside the valid range? Do attempted accesses to these fault with the same code or do they have their own?Does this include failed reads to valid addresses owned by the process?

本质上,我想知道应用程序何时失败,出现这种异常,可能出错了;这是一个狭隘的错误,只能来自应用程序。代码或我看着什么,包括硬件问题?

Essentially I want to know when an application fails with this exception, what may have gone wrong; is this a narrow fault that could only have come from the apps. code or am I looking at anything up and including hardware problems?

(我知道必须有一个MSDN页面,但搜索Google或MSDN提出预期的100页排除随机应用程序;))

(I know there must be an MSDN page on this but searching Google or MSDN brings up the expected 100 pages of troubleshooting random applications ;))

谢谢!

推荐答案

需要阅读处理器手册才能向下钻取。它由陷阱触发,最好被描述为处理器中的异常。陷阱中断代码执行,并允许操作系统捕获处理程序处理故障。当处理器尝试从RAM中读取尚未映射的数据时,一个非常常见的良性是页面错误。这就是虚拟内存的实现方式。

You need to read the processor manual to drill this down. It is triggered by a "trap", best described as an exception in the processor. A trap interrupts code execution and lets an operating system "catch" handler deal with the fault. A very common benign one is a page fault, raised when the processor tries to read data from RAM that isn't mapped yet. That's how virtual memory is implemented.

AccessViolation属于一组陷阱,这些陷阱是操作系统不知道如何处理的硬故障。在处理器手册中称为一般保护故障。这是一个抓包,有很多方法来触发GPF。到目前为止,最常见的是尝试读取未映射的内存,通常是由堆内存损坏引起的。其次是尝试执行无效的机器代码指令,或只能由特权代码执行,通常由堆栈内存损坏引起。

An AccessViolation belongs to a group of traps that are hard faults that the operating system doesn't know how to handle. It is called "General Protection Fault" in the processor manual. It's a bit of a grab-bag, there are lots of ways to trigger a GPF. By far the most common one is trying to read memory that isn't mapped, usually caused by heap memory corruption. Followed by trying to execute a machine code instruction that isn't valid or can only be executed by privileged code, usually caused by stack memory corruption.

这些陷阱是令人讨厌的当它们来时,处理器根本无法继续执行程序。操作系统当然不知道如何处理它,它引发了一个AccessViolation异常,给程序一个打击处理器回到已知的好代码。可以通过在代码中使用 __ try / __ except 关键字。不是一个好主意btw,除了自定义错误报告,你没有真正的想法,你的程序的状态如何突变之前,它死亡,因此没有办法恢复它。

These traps are as nasty as they come, the processor simply cannot continue executing the program. The operating system certainly doesn't know how to handle it, it raises an AccessViolation exception to give the program a shot at jerking the processor back to known-good code. Possible by using the __try/__except keywords in your code. Not a great idea btw, other than for custom error reporting, you have no real idea how the state of your program got mutated before it died and thus no way to restore it back.

没有这样一个SEH处理程序,这将结束于Windows提供的一个backstop。您可以提供自己的,有助于自定义崩溃报告。系统提供的一个通过触发WER(Windows错误报告)组件来终止它。这最终终止了这个过程。

Without such an SEH handler, this ends up in a backstop that Windows provides. You can provide your own with SetUnhandledExceptionFilter(), useful to customize the crash report. The system-provided one puts an end to it by triggering WER, the Windows Error Reporting component. Which ultimately terminates the process.

这篇关于访问冲突“0xc0000005”的范围究竟是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 01:35