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 Oren Milman
Recipients Oren Milman, vstinner
Date 2017-10-03.21:40:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1507066812.21.0.213398074469.issue31683@psf.upfronthosting.co.za>
In-reply-to
Content
On my 64-bit Windows 10, the echo here would print -1073741571:
python -c "import faulthandler; faulthandler._fatal_error(b'a' * 2 ** 22)"
echo %errorlevel%

This is code c00000fd, which windbg describes as 'Stack overflow'.
This happens because Py_FatalError() (in Python/pylifecycle.c) does the following
(on Windows only):
    len = strlen(msg);

    /* Convert the message to wchar_t. This uses a simple one-to-one
    conversion, assuming that the this error message actually uses ASCII
    only. If this ceases to be true, we will have to convert. */
    buffer = alloca( (len+1) * (sizeof *buffer));
    for( i=0; i<=len; ++i)
        buffer[i] = msg[i];


Note that (IIUC) running the aforementioned cmd wouldn't cause a post-mortem
debugger to pop-up, because faulthandler_fatal_error_py()
(in Modules/faulthandler.c) first calls faulthandler_suppress_crash_report(),
and then calls Py_FatalError().
History
Date User Action Args
2017-10-03 21:40:12Oren Milmansetrecipients: + Oren Milman, vstinner
2017-10-03 21:40:12Oren Milmansetmessageid: <1507066812.21.0.213398074469.issue31683@psf.upfronthosting.co.za>
2017-10-03 21:40:12Oren Milmanlinkissue31683 messages
2017-10-03 21:40:12Oren Milmancreate