18

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?

3 Answers 3

39

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.

3
  • 7
    +1 for suggesting an exception logger. That's the #1 most useful debugging tool I've found aside from the debugger itself. Commented Feb 19, 2013 at 6:43
  • 1
    @Remy Do you know of other Windows exception loggers not specific to Delphi & C++BUilder? You know for generic windows applications built using C++?
    – KeyC0de
    Commented Sep 30, 2019 at 13:53
  • Most of time you get a firstchance exception so you have to found units with an initialization section and try to comment out such things like getmem or memset of memory allocation stuff. Debuged also maXbox4 with non referenced units but with init or finalize sections. Commented Aug 27, 2023 at 15:10
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.

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.

1
  • Looks like Oracle used Delphi to build their Java SE 8 JRE ;)
    – mjn
    Commented Jul 21, 2015 at 12:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.