How to find out who's causing an access violation error?

14,329

Solution 1

My suggestion would be to try either MadExcept link text or Eurekalog link text . These capture the unhandled exception and produce a stack dump at the point where the problem occurs.

No link to these other than as a satisfied customer. MadExcept has enabled me to track down and eliminate some very rare problems in my programs.

Solution 2

I would recommand some kind of Exception-hook, like Eurekalog or madExcept that gives you a nice callstack when exceptions occurs.

Now this want help you much now, of cource...

I have not had any luck with the 'Find error' dialog. Generaly, a consistent failing case and a lot of stepping is the only/fastest/easiest solution. If it is a case of uninitialized pointer or freed object, FastMM4 may help you with the right settings.

Solution 3

Install Debug Diag and monitor your app, he generate DUMP file for you and have analyze to.

Solution 4

When the program crashes Windows should save a crash dump. You can then load this in WinDbg or, at a pinch, Visual Studio. There are various ways to analyze the dump to find out what went wrong. To get you started:

Share:
14,329

Related videos on Youtube

Grace Note
Author by

Grace Note

I am a Technical Success Manager (part of our Support Team, formerly a member of the Community Growth Team) on the Stack Exchange Network. Pleased to meet you! Programmer/designer with a Computer Science degree and an electronic media degree. Enjoys gaming and does designwork as a hobby. "Being an Alice in the world of computing can be a very problematic position."

Updated on April 17, 2022

Comments

  • Grace Note
    Grace Note about 2 years

    I'm getting reports that my app is causing a GPF on some Vista machines. The error message is something like this:

    access violation at 0x75784062 ( tried to write to 0x00000006)

    In order to fix this, I first need to know exactly who is causing this GPF: my main exe, some third party component, one of my own activex components, a dll, etc...

    How can I find this out? What tools can pinpoint the exact module that caused this mess?

    Any help would be greatly appreciated.

    PS My app is coded in VB6 and my activex controls are written in Delphi 2007.

  • Vegar
    Vegar about 15 years
    Bah! Beaten at the goal line ;-)
  • Nick
    Nick about 15 years
    Great suggestion, although I wonder if it works in this case. The application is VB6 and only the ActiveX control used in the application is written in Delphi.
  • Peter McMinn
    Peter McMinn about 15 years
    From the rough outline of the error message, it does not sound like the VB6 part that is causing the error. The guy in my office who does the VB6 work says it's quite tricky (but not impossible) to create this error. Anyway, I think it's always better to try to trap/handle as much as possible.
  • Server Overflow
    Server Overflow over 5 years
    and use them how?
  • Server Overflow
    Server Overflow over 5 years
    eurekalog is buggy itself :) go for madshi