I use a service application I created in Delphi. My problem is that it is sometimes terminated by the operating system and I don't know why this happens.
When I go the the system events, I can find a piece of information like this one:
Event ID: 7034, The [...] service terminated unexpectedly. It has done this [...] time(s).
I know you can't give me an answer why this happens, but could you please give me a clue what to pay attention to to find the reason of that behaviour? For instance what kind of exceptions could make the OS close an application.
Thank you in advance.
Make a debug version with Eurekalog or MadExcept, and it'll tell you where it's blowing up, what the stack looked like, memory, etc..
They can also auto-restart your app. Not sure if that can be done on a service, but for regular apps, it can. They can also send you the dump via e-mail, or even post directly to a bug tracker like FogBugz or Mantis. These measures will be helpful in the event that you don't find a smoking gun right away, and need to keep troubleshooting/debugging in place as a long-term solution. i.e. even if something only crashes once a month or even once a year, it's easier to tell your boss "I'm looking at the logs" than "I really have no idea".
Make sure you are capturing all exceptions within the Execute method of all your threads Assuming your are using TThread descendants). If any get through to the OS this might cause it to terminate your service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With