Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Windows NTSTATUS exit codes in hex #6401

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

MisterDA
Copy link
Contributor

On Windows, "negative" exit codes are probably NTSTATUS values. For example, if a program accesses an invalid memory location, Unix sends a SIGSEGV signal which, if unhandled, will terminate the process (setting some kind of non-zero exit code - for example, Linux sets the exit code to 128 + signal number to give a fairly memorable 139). In the equivalent scenario, Windows throws an EXCEPTION_ACCESS_VIOLATION which, if handled by the default exception handler, will terminate the process with exit code STATUS_ACCESS_VIOLATION. These codes are large negative numbers, which are not terribly memorable in decimal, so for negative exit codes we instead display them in hexadecimal as 0xc0000005 is slightly more memorable than -1073741819.

These exit codes can also occur if an executable is missing a DLL, which can be the case of a broken or missing Cygwin/MinGW-w64 package.

On Windows, "negative" exit codes are probably NTSTATUS values. For
example, if a program accesses an invalid memory location, Unix sends
a SIGSEGV signal which, if unhandled, will terminate the
process (setting some kind of non-zero exit code - for example, Linux
sets the exit code to 128 + signal number to give a fairly memorable
139). In the equivalent scenario, Windows throws an
EXCEPTION_ACCESS_VIOLATION which, if handled by the default exception
handler, will terminate the process with exit code
STATUS_ACCESS_VIOLATION. These codes are large negative numbers, which
are not terribly memorable in decimal, so for negative exit codes we
instead display them in hexadecimal as 0xc0000005 is slightly more
memorable than -1073741819.

Co-authored-by: David Allsopp <[email protected]>
@rjbou rjbou merged commit 4bd1a89 into ocaml:master Mar 3, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants