[issue38437] Set GC_DEBUG for debug builds of the interpreter

Pablo Galindo Salgado report at bugs.python.org
Thu Oct 10 16:56:23 EDT 2019


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

> Under which condition can such list be corrupted?

If someone is adding/modifiying the gc and calls any of the functions that set the gc flags like (PREV_MASK_COLLECTING).

One example is that after calling move_unreachable(), the unreachable set has NEXT_MASK_UNREACHABLE and therefore is an invalid list (until move_legacy_finalizers removes the flag and makes it valid again). If you mess the order or violate any of the contract, the lists will be invalid. It helps a lot to know that you are not leaving the lists in invalid state by mistake or on the other hand, to check that they are valid when they are supposed to be valid.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38437>
_______________________________________


More information about the Python-bugs-list mailing list