-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed as duplicate of#116502
Closed as duplicate of#116502
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Whenever _Py_FatalErrorFormat() is called for whatever reason on Windows, we crash. In Python/pylifecycle.c, it calls fatal_error() like this:
Line 3612 in 18aec59
| fatal_error(fd, 0, NULL, NULL, -1); |
Notice that the fourth argument of this call,
msg, is being passed a NULL pointer. Then at line 3563 inside fatal_error(), we have the following call to fatal_output_debug() that is guarded by #ifdef MS_WINDOWS:Line 3563 in 18aec59
| fatal_output_debug(msg); |
This then goes into
fatal_output_debug() where at line 3275, we dereference the NULL msg pointer and crash:Line 3275 in 18aec59
| msglen = strlen(msg); |
I'm guessing that we should guard against msg != NULL either before calling fatal_output_debug(), or perhaps inside fatal_output_debug() itself.
CPython versions tested on:
3.13 (but code remains the same in main as of writing)
Operating systems tested on:
Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error