[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-10-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16368
pull_request: https://github.com/python/cpython/pull/16816

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-10-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset f82ce5b1b12873b65927149a016be6a7c65e979d by Victor Stinner in 
branch '3.8':
[3.8] bpo-36389: Backport debug enhancements from master (GH-16796)
https://github.com/python/cpython/commit/f82ce5b1b12873b65927149a016be6a7c65e979d


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4d5f94b8cd20f804c7868c5395a15aa6032f874c by Victor Stinner in 
branch 'master':
bpo-38070: Enhance visit_decref() debug trace (GH-16631)
https://github.com/python/cpython/commit/4d5f94b8cd20f804c7868c5395a15aa6032f874c


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16217
pull_request: https://github.com/python/cpython/pull/16631

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-18 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, I pushed the most important changes that I wanted to push. I close the 
issue.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 47bbab9f76735acc1991e541d12fd18be6b13b16 by Victor Stinner in 
branch '3.8':
[3.8] bpo-38070: Py_FatalError() logs runtime state (GH-16258)
https://github.com/python/cpython/commit/47bbab9f76735acc1991e541d12fd18be6b13b16


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15853
pull_request: https://github.com/python/cpython/pull/16258

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


STINNER Victor  added the comment:

msg351473 example with the new assertion and enhanced debug functions:
---
Modules/gcmodule.c:379: visit_decref: Assertion "!_PyObject_IsFreed(op)" failed

Fatal Python error: _PyObject_AssertFailed
Python runtime state: finalizing (tstate=0x1d1c9b0)

Current thread 0x7ff010841740 (most recent call first):

Aborted (core dumped)
---

* Obviously, "Modules/gcmodule.c:379: visit_decref: Assertion 
"!_PyObject_IsFreed(op)" failed" is the first most visible enhancement
* Add "Python runtime state: finalizing (tstate=0x1d1c9b0)": Python is 
finalizing (Py_Finalize)
* New "" in the traceback
* "" became "": add the object 
address

--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1ce16fb0977283ae42a9f8917bbca5f44aa69324 by Victor Stinner in 
branch 'master':
bpo-38070: Py_FatalError() logs runtime state (GH-16246)
https://github.com/python/cpython/commit/1ce16fb0977283ae42a9f8917bbca5f44aa69324


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15842
pull_request: https://github.com/python/cpython/pull/16246

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d3b904144e86e2442961de6a7dccecbe133d5c6d by Victor Stinner in 
branch 'master':
bpo-38070: Add _PyRuntimeState.preinitializing (GH-16245)
https://github.com/python/cpython/commit/d3b904144e86e2442961de6a7dccecbe133d5c6d


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15841
pull_request: https://github.com/python/cpython/pull/16245

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b39afb78768418d9405c4b528c80fa968ccc974d by Victor Stinner in 
branch 'master':
bpo-38070: Enhance _PyObject_Dump() (GH-16243)
https://github.com/python/cpython/commit/b39afb78768418d9405c4b528c80fa968ccc974d


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8fa3e1740b3f03ea65ddb68411c2238c5f98eec2 by Victor Stinner in 
branch 'master':
bpo-38070: _Py_DumpTraceback() writes  (GH-16244)
https://github.com/python/cpython/commit/8fa3e1740b3f03ea65ddb68411c2238c5f98eec2


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15840
pull_request: https://github.com/python/cpython/pull/16244

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15839
pull_request: https://github.com/python/cpython/pull/16243

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-10 Thread STINNER Victor


STINNER Victor  added the comment:

> Should this be closed now?

Please keep it open, I have a few more local changess to enhance 
Py_FatalError() :-) I would like to reuse the bpo number.

--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-10 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Should this be closed now?

--
nosy: +pablogsal

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-09 Thread miss-islington


miss-islington  added the comment:


New changeset 5731172bb1e958b1d80b18eaf88d3f2f93cfccdd by Miss Islington (bot) 
in branch '3.8':
bpo-38070: visit_decref() calls _PyObject_IsFreed() (GH-15782)
https://github.com/python/cpython/commit/5731172bb1e958b1d80b18eaf88d3f2f93cfccdd


--
nosy: +miss-islington

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-09 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15446
pull_request: https://github.com/python/cpython/pull/15793

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d91d4de31745fc1ed4c7e6c208917827c9c472b6 by Victor Stinner in 
branch 'master':
bpo-38070: visit_decref() calls _PyObject_IsFreed() (GH-15782)
https://github.com/python/cpython/commit/d91d4de31745fc1ed4c7e6c208917827c9c472b6


--

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-09 Thread STINNER Victor


STINNER Victor  added the comment:

> visit_decref() is commonly found in C traceback (ex: gdb backtrace) of bugs 
> related to the garbage collector.

Example with attached bpo-38037-bug.patch: you can apply this patch on the 
master branch to reintroduce  bpo-38037 bug.

vstinner@apu$ git apply bpo-38037-bug.patch
vstinner@apu$ make

Without PR 15782:

vstinner@apu$ ./python -c pass 
Segmentation fault (core dumped)


With PR 15782:

vstinner@apu$ ./python -c pass 
Modules/gcmodule.c:379: visit_decref: Assertion "!_PyObject_IsFreed(op)" failed

Fatal Python error: _PyObject_AssertFailed

Current thread 0x7f171a280740 (most recent call first):
Aborted (core dumped)


The bug is catched earlier. And Python provides more information.

--
Added file: https://bugs.python.org/file48602/bpo-38037-bug.patch

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-09 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38070] visit_decref(): add an assertion to check that the object is not freed

2019-09-09 Thread STINNER Victor


New submission from STINNER Victor :

This issue is related to bpo-36389 "Add gc.enable_object_debugger(): detect 
corrupted Python objects in the GC.

I propose to call _PyObject_IsFreed() in visit_decref() in debug mode, to get a 
better error message if something goes wrong.

visit_decref() is commonly found in C traceback (ex: gdb backtrace) of bugs 
related to the garbage collector.

--
components: Interpreter Core
messages: 351470
nosy: vstinner
priority: normal
severity: normal
status: open
title: visit_decref(): add an assertion to check that the object is not freed
type: enhancement
versions: Python 3.9

___
Python tracker 

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