You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TSCBasic: properly track abnormal exits on Windows
The process handling did not properly account for abnormal process
termination. Unlike Unix platforms, Windows does not have a concept of
signals. However, a process may be terminated abnormally by means of an
exception. The exception code is then transliterated into the exit code
for the process. In most circumstances, the exit code for the process
in such a case is either a `NTSTATUS` or `HRESULT`. Accordingly, the
way to detect the exception is to check the severity code of the
exception. The `HRESULT` and `NTSTATUS` codes are similarly structured:
~~~
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|S|R|C|N|X|F A C I L I T Y |C O D E |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
S: Severity; If set, indicates a failure result. If clear, indicates a success result.
R: Reserved; If N is clear, this bit MUST be set to 0.
C: Customer; If set, indicates that this a customer defined error code.
N: If set, indicates that the error code is a NTSTATUS value.
X: Reserved; MBZ
Facility: An indicator of the source of the error.
Code: The remainder of the error code.
~~~
We would previously only check for the top nibble being 0xC or 0xE.
However, a 0x8 value is also permissible and indicates a failure. Plumb
this through as an abnormal exit with the specified exception code.
(cherry picked from commit 4ec21b0)
0 commit comments