This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients JelleZijlstra, benjamin.peterson, corona10, db3l, eryksun, remi.lapeyre, serhiy.storchaka, stutzbach, vstinner
Date 2020-06-10.18:41:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591814482.39.0.111414199535.issue40826@roundup.psfhosted.org>
In-reply-to
Content
Why doesn't SuppressCrashReport suppress the hard error dialog (i.e. SEM_FAILCRITICALERRORS)? This dialog gets created by the NtRaiseHardError system call. For example:

    >>> NtRaiseHardError = ctypes.windll.ntdll.NtRaiseHardError
    >>> response = (ctypes.c_ulong * 1)()

With the default OS error mode, the following raises a hard error dialog for STATUS_UNSUCCESSFUL (0xC0000001), with abort/retry/ignore options:

    >>> NtRaiseHardError(0xC000_0001, 0, 0, None, 0, response)
    0
    >>> response[0]
    2

The response value is limited to abort (2), retry (7), ignore (4) -- or simply returned (0) when the process hard error mode is disabled: 

    >>> msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS)
    0
    >>> NtRaiseHardError(0xC000_0001, 0, 0, None, 0, response)
    0
    >>> response[0]
    0

NtRaiseHardError also checks for an error-mode override flag (0x1000_0000) in the status code, which is used in cases such as WinAPI FatalAppExitW. For example, the following will raise the dialog regardless of the hard error mode:

    >>> NtRaiseHardError(0xC000_0001 | 0x1000_0000, 0, 0, None, 0, response)
    0
    >>> response[0]
    2
History
Date User Action Args
2020-06-10 18:41:22eryksunsetrecipients: + eryksun, db3l, vstinner, benjamin.peterson, stutzbach, serhiy.storchaka, JelleZijlstra, corona10, remi.lapeyre
2020-06-10 18:41:22eryksunsetmessageid: <1591814482.39.0.111414199535.issue40826@roundup.psfhosted.org>
2020-06-10 18:41:22eryksunlinkissue40826 messages
2020-06-10 18:41:22eryksuncreate