Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-38631: Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() #18258

Merged
merged 1 commit into from Jan 30, 2020

Conversation

@vstinner
Copy link
Member

vstinner commented Jan 29, 2020

Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() in
object.c and typeobject.c to also dump the involved Python object on
a fatal error. It should ease debug when such fatal error occurs.

https://bugs.python.org/issue38631

Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() in
object.c and typeobject.c to also dump the involved Python object on
a fatal error. It should ease debug when such fatal error occurs.

If the double linked list is inconsistent, _Py_ForgetReference() no
longer dumps previous and next objects in the fatal error, it now
only dumps the current object. It should prevent to get a crash when
dumping an invalid object, before writing the error message.

Enhance _Py_ForgetReference() error messages;
_PyObject_ASSERT_FAILED_MSG() logs the "_Py_ForgetReference" function
name.
@vstinner vstinner force-pushed the vstinner:assert_failed branch from a829924 to 1c790d8 Jan 29, 2020
@vstinner vstinner changed the title Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() bpo-38631: Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() Jan 29, 2020
@vstinner vstinner removed the skip issue label Jan 29, 2020
@vstinner vstinner merged commit 5eb8bff into python:master Jan 30, 2020
8 checks passed
8 checks passed
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20200129.52 succeeded
Details
bedevere/issue-number Issue number 38631 found
Details
bedevere/news "skip news" label found
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vstinner vstinner deleted the vstinner:assert_failed branch Jan 30, 2020
shihai1991 added a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
…pythonGH-18258)

Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() in
object.c and typeobject.c to also dump the involved Python object on
a fatal error. It should ease debug when such fatal error occurs.

If the double linked list is inconsistent, _Py_ForgetReference() no
longer dumps previous and next objects in the fatal error, it now
only dumps the current object. It ensures that the error message
is displayed even if dumping the object does crash Python.

Enhance _Py_ForgetReference() error messages;
_PyObject_ASSERT_FAILED_MSG() logs the "_Py_ForgetReference" function
name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.