Identify a process killer

I have a python program running as a windows service which, in my opinion, catches all exceptions. In my development environment, I cannot reproduce any situation where an exception is not logged, when the program crashes. Except in two cases: the program is killed through the task manager or the computer shuts down.

However, in the target environment (Windows 2000 with all the necessary libraries and python installed), the Windows service unexpectedly shuts down ca. 4 minutes after a reboot without registering an exception or cause of failure. The environment is definitely not disconnected.

Does anyone have a suggestion to determine what killed the python program?

EDIT: I cannot use the debugger in the target environment (as well as at the production level). Therefore, I need a way to register the cause of the failure. So, I am looking for tools or methods for recording additional information at runtime (or time of failure) that can be used for analysis after opening.

+4
source share
2 answers

You need to provide additional information, for example: "Is your program multithreaded?" Is the code dependent on the version of the Python interpreter you are using, or on any imported modules that are not used in the target environment?

If you have GDB for Windows , you can do "gdb -p pid", where "pid" is the pid of the python program, you are running. If a failure occurs, you can get backtracing.

0
source

You might also want to check out the following sysinternals.com tools (now acquired by MSFT): http://technet.microsoft.com/en-us/sysinternals/bb795533

such as ProcDump, Process Monitor, or even Process Explorer (even less adapted than the previous ones).

You can also install a lightweight debugger such as OllyDbg, or use the Moonsols tools to monitor the guest virtual machine if this happens in a virtualized environment.

0
source

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


All Articles