This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Leak in _PyTraceback_Add
Type: resource usage Stage: resolved
Components: Interpreter Core Versions: Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: georg.brandl, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2015-03-26 10:25 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_PyTraceback_Add_leak.patch serhiy.storchaka, 2016-06-19 17:09 review
_PyTraceback_Add_leak2.patch serhiy.storchaka, 2016-10-09 12:59 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft, 2017-03-31 16:36
Messages (5)
msg239319 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-03-26 10:25
There is a leak of fetched exception in _PyTraceback_Add() (Python/traceback.c:146).
msg239321 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-03-26 11:16
If a new exception is raised by _PyTraceback_Add(), the original exception is lost. It's sad because _PyTraceback_Add() is supposed to enhance the current exception, not to drop it.

In the draft of my PEP 490, I propose to chain the two exceptions.
msg268857 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-06-19 17:09
Proposed patch fixes a leak.
msg278358 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-10-09 12:59
More refactoring.
msg278852 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-10-18 10:28
New changeset 6b3be9f38f2a by Serhiy Storchaka in branch '3.5':
Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception
https://hg.python.org/cpython/rev/6b3be9f38f2a

New changeset 2d352bf2b228 by Serhiy Storchaka in branch '3.6':
Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception
https://hg.python.org/cpython/rev/2d352bf2b228

New changeset 83877018ef97 by Serhiy Storchaka in branch 'default':
Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception
https://hg.python.org/cpython/rev/83877018ef97
History
Date User Action Args
2022-04-11 14:58:14adminsetgithub: 67970
2017-03-31 16:36:21dstufftsetpull_requests: + pull_request951
2016-10-18 10:32:08serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.7
2016-10-18 10:28:39python-devsetnosy: + python-dev
messages: + msg278852
2016-10-09 12:59:10serhiy.storchakasetfiles: + _PyTraceback_Add_leak2.patch

messages: + msg278358
2016-07-17 10:05:33serhiy.storchakasetassignee: serhiy.storchaka
2016-06-19 17:09:19serhiy.storchakasetfiles: + _PyTraceback_Add_leak.patch
versions: + Python 3.5, Python 3.6
messages: + msg268857

components: + Interpreter Core
keywords: + patch
stage: patch review
2015-03-26 11:16:32vstinnersetmessages: + msg239321
2015-03-26 10:25:02serhiy.storchakacreate