Reason for termination of service

I am using a service application created in Delphi. My problem is that it sometimes ends with the operating system, and I do not know why this is happening.

When I go to system events, I can find information such as this:

Event ID: 7034 , the service [...] stopped unexpectedly. He made it [...] time (s).

I know that you cannot give me an answer why this is happening, but could you please let me know what to look for in order to find the reason for this behavior? For example, what exceptions can cause the OS to close the application.

Thanks in advance.

+4
source share
2 answers

Make a debug version with Eurekalog or MadExcept and it will tell you where it exploded, what the stack, memory, etc. looked like.

They can also automatically restart the application. Not sure if this can be done in the service, but for regular applications this is possible. They can also email you a dump or even send messages directly to an error tracker like FogBugz or Mantis. These measures will be useful if you do not immediately find a smoking gun and you need to continue troubleshooting and debugging as a long-term solution. that is, even if something happens only once a month or even once a year, it’s easier to tell your boss “I look at magazines” than “I really don’t know.”

+8
source

Make sure you get all exceptions from the Execute method for all of your threads. Assuming you are using descendants of TThread). If any access to the OS can lead to its termination, follow these steps.

+3
source

Source: https://habr.com/ru/post/1306356/


All Articles