bpo-38070: Py_FatalError() logs runtime state by vstinner · Pull Request #16246 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation1 Commits3 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

vstinner

@vstinner

@vstinner

Examples with this change:

$ PYTHONMALLOC=x ./python 
Fatal Python error: preconfig_init_allocator: PYTHONMALLOC: unknown allocator
Python runtime state: preinitializing


$ PYTHONHOME=/ ./python 
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f81b7dfb740 (most recent call first):
<no Python frame>

without:

$ PYTHONMALLOC=x ./python 
Fatal Python error: preconfig_init_allocator: PYTHONMALLOC: unknown allocator


$ PYTHONHOME=/ ./python 
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f5a5136f740 (most recent call first):
<no Python frame>

The change adds the Python runtime state line.

@vstinner

@vstinner

vstinner added a commit that referenced this pull request

Sep 18, 2019

@vstinner

When a Python thread has no frame, _Py_DumpTraceback() and _Py_DumpTracebackThreads() now write "", rather than writing nothing.

(cherry picked from commit 8fa3e17)

_PyObject_Dump() now dumps the object address for freed objects and objects with ob_type=NULL.

(cherry picked from commit b39afb7)

Add _PyRuntimeState.preinitializing field: set to 1 while Py_PreInitialize() is running.

_PyRuntimeState: rename also pre_initialized field to preinitialized.

(cherry picked from commit d3b9041)

(cherry picked from commit 1ce16fb)