question

AmitMaheshwari-7885 avatar image
0 Votes"
AmitMaheshwari-7885 asked Castorix31 commented

Process Exit Monitor - Event ID 3000 - Process Exit code 3

One of our user was facing an unusual termination of our software.

From software logs we could get to know that Software was working without any error and all of sudden it just disappeared (logs has been stopped) and there was no crash recorded in event viewer.

To further investigate the reason behind such abnormal termination, we used "gflags.exe" and Enable "silent process exit monitoring" for the software.

when next such incident occurred, we found:

Event ID 3000

The process '<AppPath>/App.exe' exited with exit code 3. The creation time for the exiting process was 0x01d719ef8ef0bc2c.

From here I'm guessing that software may not have been terminated by external process But then what "exit code 3" suggests here?

By this information can we get possible reason behind the process termination ?

dotnet-csharp
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Check if your application or libraries have something like ‘Environment.Exit(3)’.

Do you intercept and log unhandled exceptions using ‘Application.ThreadException += …’, ‘AppDomain.CurrentDomain.UnhandledException += …’, etc., which can be found in various samples?

What kind of application is it?

0 Votes 0 ·
  • There is not where in the application where app exits with '3' code

  • We did subscribed the event Application.ThreadException to log error information, but no information was logged there.

  • It is winform application


0 Votes 0 ·

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered Castorix31 commented

In Windows errors,
3 = ERROR_PATH_NOT_FOUND

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Can you please provide me more information regarding this exit code, means in which conditions an application would exit with this code?

0 Votes 0 ·
Castorix31 avatar image Castorix31 AmitMaheshwari-7885 ·

It is difficult to guess without code...
For example, I can force an Exit 3 with a non-existent directory (Z:\\test) :

 try
 {
        File.Move("Z:\\test", "C:\\");
 }
 catch (System.Exception ex)
 {
     int nError = Marshal.GetLastWin32Error();
     Environment.Exit(nError);
 }
0 Votes 0 ·