What do I do when my program crashes with exception 0xc0000005 at address 0?

12

My Delphi program runs as an NT service and has been running fine for more than 2 months and then it stops suddenly and generates a crash dump:

Faulting application name: tca_shctisvc_ip.exe, version: 7.1.0.1843, time stamp: 0x2a425e19 Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0xc0000005 Fault offset: 0x00000000

There were no real addresses to work from based on information in the Windows event log. I was able to load the mini dump into WinDbg and it said there was an exception but found problems with the stack frames. A different tool (Viewminidump) was able to show me stacks of the running threads.

Where do I begin to resolve this issue?

delphi
debugging
crash
asked on Stack Overflow Feb 19, 2013 by samanne • edited Feb 19, 2013 by Rob Kennedy

3 Answers

30

Exception code 0xc0000005 is an Access Violation. An AV at fault offset 0x00000000 means that something in your service's code is accessing a nil pointer. You will just have to debug the service while it is running to find out what it is accessing. If you cannot run it inside a debugger, then at least install a third-party exception logger framework, such as EurekaLog or MadExcept, to find out what your service was doing at the time of the AV.

answered on Stack Overflow Feb 19, 2013 by Remy Lebeau
0

Problems with the stack frames could indicate stack corruption (a truely horrible beast), optimisation, or mixing frameworks such as C/C++/C#/Delphi and other craziness as that - there is no absolute standard with respect to stack frames. (Some languages do not even have them!).

So, I suggest getting slightly annoyed with the stack frame issues, ignoring it, and then just use Remy's answer.

answered on Stack Overflow Feb 19, 2013 by Arafangion
0

I was getting the same issue with a different application,

Faulting application name: javaw.exe, version: 8.0.51.16, time stamp: 0x55763d32
Faulting module name: mscorwks.dll, version: 2.0.50727.5485, time stamp: 0x53a11d6c
Exception code: 0xc0000005
Fault offset: 0x0000000000501090
Faulting process id: 0x2960
Faulting application start time: 0x01d0c39a93c695f2
Faulting application path: C:\Program Files\Java\jre1.8.0_51\bin\javaw.exe
Faulting module path:C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll

I was using the The Enhanced Mitigation Experience Toolkit (EMET) from Microsoft and I found by disabling the EMET features on javaw.exe in my case as this was the faulting application, it enabled my application to run successfully. Make sure you don't have any similar software with security protections on memory.

answered on Stack Overflow Jul 21, 2015 by Lismore

User contributions licensed under CC BY-SA 3.0