[issue40226] Leak in tstate->interp->ceval.pending

2020-04-08 Thread STINNER Victor


STINNER Victor  added the comment:

Fixed, thanks for the bug report Stefan ;-)

--
resolution:  -> fixed
stage: patch review -> 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



[issue40226] Leak in tstate->interp->ceval.pending

2020-04-08 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset dda5d6e071c6a9d65993d45b90232565cfad2cde by Victor Stinner in 
branch 'master':
bpo-40226: PyInterpreterState_Delete() deletes pending calls (GH-19436)
https://github.com/python/cpython/commit/dda5d6e071c6a9d65993d45b90232565cfad2cde


--

___
Python tracker 

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



[issue40226] Leak in tstate->interp->ceval.pending

2020-04-08 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that I'm able to reproduce the issue on the master branch:

$ PYTHONMALLOC=malloc valgrind --leak-check=full --log-file=valgrind.log 
--num-callers=20 ./python -c pass

==44052== 32 bytes in 1 blocks are definitely lost in loss record 187 of 2,264
==44052==at 0x483980B: malloc (vg_replace_malloc.c:309)
==44052==by 0x46DA1E: _PyMem_RawMalloc (obmalloc.c:99)
==44052==by 0x46EBE1: PyMem_RawMalloc (obmalloc.c:572)
==44052==by 0x5475C7: PyThread_allocate_lock (thread_pthread.h:379)
==44052==by 0x4ED6EF: _PyEval_InitThreads (ceval.c:296)
==44052==by 0x52FE87: pycore_create_interpreter (pylifecycle.c:561)
==44052==by 0x5316B3: pyinit_config (pylifecycle.c:757)
==44052==by 0x532D38: pyinit_core (pylifecycle.c:924)
==44052==by 0x5338F5: Py_InitializeFromConfig (pylifecycle.c:1134)
==44052==by 0x41DA88: pymain_init (main.c:66)
==44052==by 0x41EAAC: pymain_main (main.c:653)
==44052==by 0x41EB39: Py_BytesMain (main.c:686)
==44052==by 0x41D6CE: main (python.c:16)

> 50e6e991781db761c496561a995541ca8d83ff87 causes or exposes a
leak. Possibly the leak was there before but showed up under
"still reachable".

Python freed pending calls at exit. It's just that Valgrind decided to complain 
about them :-)

=> Attached PR fix the issue.

Note: the GIL is still leaked at exit. See "Don't destroy the GIL at exit" 
section of 
https://vstinner.github.io/daemon-threads-python-finalization-python32.html for 
the rationale.

--

___
Python tracker 

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



[issue40226] Leak in tstate->interp->ceval.pending

2020-04-08 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +18790
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19436

___
Python tracker 

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



[issue40226] Leak in tstate->interp->ceval.pending

2020-04-08 Thread Stefan Krah


New submission from Stefan Krah :

50e6e991781db761c496561a995541ca8d83ff87 causes or exposes a
leak. Possibly the leak was there before but showed up under
"still reachable".

Now it is "definitely lost", so tstate->interp->ceval.pending
needs to be cleaned up.


==11235== 32 bytes in 1 blocks are definitely lost in loss record 186 of 1,901
==11235==at 0x483880B: malloc (vg_replace_malloc.c:309)
==11235==by 0x467061: _PyMem_RawMalloc (obmalloc.c:99)
==11235==by 0x467A24: PyMem_RawMalloc (obmalloc.c:572)
==11235==by 0x528599: PyThread_allocate_lock (thread_pthread.h:379)
==11235==by 0x4C69B3: _PyEval_InitThreads (ceval.c:231)
==11235==by 0x50F1EE: pycore_create_interpreter (pylifecycle.c:560)
==11235==by 0x50FB8A: pyinit_config (pylifecycle.c:756)
==11235==by 0x5102F7: pyinit_core (pylifecycle.c:923)
==11235==by 0x510D7A: Py_InitializeFromConfig (pylifecycle.c:1133)
==11235==by 0x41DAF1: pymain_init (main.c:66)
==11235==by 0x41EB04: pymain_main (main.c:653)
==11235==by 0x41EBAD: Py_BytesMain (main.c:686)
==11235==

--
components: Interpreter Core
messages: 365980
nosy: skrah, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Leak in tstate->interp->ceval.pending
type: behavior
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