[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks Victor and Tim!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 320dd504ddf65efe946e6d1e89053ed2d7ebe1e9 by Pablo Galindo in 
branch 'master':
bpo-38437: Activate GC_DEBUG when PY_DEBUG is set (GH-16707)
https://github.com/python/cpython/commit/320dd504ddf65efe946e6d1e89053ed2d7ebe1e9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Tim Peters


Tim Peters  added the comment:

+1.  This code got quite brittle when they decided to fit two pointers, a fat 
integer, and 3 flags into a struct with room for only the two pointers ;-)  
It's a mine field now.  Enabling one of the few automated mine detectors is 
thoroughly sensible.

--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread STINNER Victor


STINNER Victor  added the comment:

Under which condition can such list be corrupted?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
stage: patch review -> 
versions:  -Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +16292
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16707

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38437] Set GC_DEBUG for debug builds of the interpreter

2019-10-10 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

While working on bpo-38379 I had to manually set the GC_DEBUG macro to 1 to 
activate the extra checks that 'validate_list' does. These checks are super 
useful to make sure all the gc lists used are consistent and in the expected 
state with the expected masks.

For this reason, I propose to always activate GC_DEBUG for debug builds of the 
interpreter. It will have a performance impact, but the debugging benefits are 
substantial.

--
messages: 354401
nosy: pablogsal, vstinner
priority: normal
severity: normal
status: open
title: Set GC_DEBUG for debug builds of the interpreter
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com