Staging
v0.8.1
https://github.com/python/cpython
Revision f82ce5b1b12873b65927149a016be6a7c65e979d authored by Victor Stinner on 15 October 2019, 01:06:16 UTC, committed by GitHub on 15 October 2019, 01:06:16 UTC
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)

bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is
now also available in release mode. For example, it can be used to
debug a crash in the visit_decref() function of the GC.

Modify the following functions to also work in release mode:

* _PyDict_CheckConsistency()
* _PyObject_CheckConsistency()
* _PyType_CheckConsistency()
* _PyUnicode_CheckConsistency()

Other changes:

* _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL
  (equals to 0).
* _PyBytesWriter_CheckConsistency() now returns 1 and is only used
  with assert().
* Reorder _PyObject_Dump() to write safe fields first, and only
  attempt to render repr() at the end.

(cherry picked from commit 6876257eaabdb30f27ebcbd7d2557278ce2e5705)

* bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)

Fix _PyBytesWriter API when Python is built in release mode with
assertions.

(cherry picked from commit 60ec6efd96d95476fe5e38c491491add04f026e5)

* bpo-38070: Enhance visit_decref() debug trace (GH-16631)

subtract_refs() now pass the parent object to visit_decref() which
pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails,
the parent is used in debug trace, rather than the freed object. The
parent object is more likely to contain useful information. Freed
objects cannot be inspected are are displayed as "<object at xxx is
freed>" with no other detail.

(cherry picked from commit 4d5f94b8cd20f804c7868c5395a15aa6032f874c)

* Fix also a typo in PYMEM_DEADBYTE macro comment

* bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)

Add a newline between the verbose object dump and the Py_FatalError()
logs for readability.

(cherry picked from commit 7775349895088a7ae68cecf0c74cf817f15e2c74)
1 parent 42308e8
History
Tip revision: f82ce5b1b12873b65927149a016be6a7c65e979d authored by Victor Stinner on 15 October 2019, 01:06:16 UTC
[3.8] bpo-36389: Backport debug enhancements from master (GH-16796)
Tip revision: f82ce5b
File Mode Size
.azure-pipelines
.github
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
m4
.gitattributes -rw-r--r-- 1.8 KB
.gitignore -rw-r--r-- 1.7 KB
.travis.yml -rw-r--r-- 8.1 KB
CODE_OF_CONDUCT.md -rw-r--r-- 630 bytes
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 65.6 KB
README.rst -rw-r--r-- 9.7 KB
aclocal.m4 -rw-r--r-- 10.7 KB
config.guess -rwxr-xr-x 43.1 KB
config.sub -rwxr-xr-x 35.4 KB
configure -rwxr-xr-x 491.7 KB
configure.ac -rw-r--r-- 162.3 KB
install-sh -rwxr-xr-x 15.0 KB
pyconfig.h.in -rw-r--r-- 44.1 KB
setup.py -rw-r--r-- 101.7 KB

README.rst

back to top