CINXE.COM

Issue 23782: Leak in _PyTraceback_Add - Python tracker

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title> Issue 23782: Leak in _PyTraceback_Add - Python tracker </title> <link rel="shortcut icon" href="@@file/favicon.ico" /> <link rel="stylesheet" type="text/css" href="@@file/main.css" /> <link rel="stylesheet" type="text/css" href="@@file/style.css" /> <link rel="search" type="application/opensearchdescription+xml" href="@@file/osd.xml" title="Python bug tracker search" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script nonce="b5bae739f5f3aa9e0d1ca79ce45ac67c92743579b90351d2fc1ee6a18ce684b6" type="text/javascript"> submitted = false; function submit_once() { if (submitted) { alert("Your request is being processed.\nPlease be patient."); return false; } submitted = true; return true; } function help_window(helpurl, width, height) { HelpWin = window.open('https://bugs.python.org/' + helpurl, 'RoundupHelpWindow', 'scrollbars=yes,resizable=yes,toolbar=no,height='+height+',width='+width); HelpWin.focus () } </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.js"></script> <script type="text/javascript" src="@@file/issue.item.js"></script> <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css" /> </head> <body> <!-- Logo --> <h1 id="logoheader"> <a accesskey="1" href="." id="logolink"> <img src="@@file/python-logo.gif" alt="homepage" border="0" id="logo" /></a> </h1> <div id="utility-menu"> <!-- Search Box --> <div id="searchbox"> <form name="searchform" method="get" action="issue" id="searchform"> <div id="search"> <input type="hidden" name="@columns" value="id,github,activity,title,creator,assignee,status,type" /> <input type="hidden" name="@sort" value="-activity" /> <input type="hidden" name="@filter" value="status" /> <input type="hidden" name="@action" value="searchid" /> <input type="hidden" name="ignore" value="file:content" /> <input class="input-text" id="search-text" name="@search_text" size="10" /> <input type="submit" id="submit" value="search" name="submit" class="input-button" /> <input type="radio" name="status" id="status_notresolved" value="-1,1,3" /> <label for="status_notresolved">open</label> <input type="radio" name="status" checked="checked" id="status_all" value="-1,1,2,3" /> <label for="status_all">all</label> </div> </form> </div> </div> <div id="left-hand-navigation"> <!-- Main Menu NEED LEVEL TWO HEADER AND FOOTER --> <div id="menu"> <ul class="level-one"> <li><a href="https://www.python.org/" title="Go to the Python homepage">Python Home</a></li> <li><a href="https://www.python.org/about/" title="About The Python Language">About</a></li> <li><a href="https://www.python.org/blogs/" title="">News</a></li> <li><a href="https://www.python.org/doc/" title="">Documentation</a></li> <li><a href="https://www.python.org/downloads/" title="">Downloads</a></li> <li><a href="https://www.python.org/community/" title="">Community</a></li> <li><a href="https://www.python.org/psf/" title="Python Software Foundation">Foundation</a></li> <li><a href="https://devguide.python.org/" title="Python Developer's Guide">Developer's Guide</a></li> <li class="selected"><a href="." class="selected" title="Python Issue Tracker">Issue Tracker</a> <ul class="level-two"> <li> <strong>Issues</strong> <ul class="level-three"> <li><a href="issue?@template=search&amp;status=1">Search</a></li> <li><a href="issue?@action=random">Random Issue</a></li> <li> <form method="post" action="issue23782"> <input type="submit" class="form-small" value="Show issue:" /> <input class="form-small" size="4" type="text" name="@number" /> <input type="hidden" name="@type" value="issue" /> <input type="hidden" name="@action" value="show" /> </form> </li> </ul> </li> <li> <strong>Summaries</strong> <ul class="level-three"> <li> <a href="issue?status=1&amp;@sort=-activity&amp;@columns=id%2Cgithub%2Cactivity%2Ctitle%2Ccreator%2Cstatus&amp;@dispname=Issues%20with%20patch&amp;@startwith=0&amp;@group=priority&amp;keywords=2&amp;@action=search&amp;@filter=&amp;@pagesize=50">Issues with patch</a> </li> <li> <a href="issue?status=1&amp;@sort=-activity&amp;@columns=id%2Cgithub%2Cactivity%2Ctitle%2Ccreator%2Cstatus&amp;@dispname=Easy%20issues&amp;@startwith=0&amp;@group=priority&amp;keywords=6&amp;@action=search&amp;@filter=&amp;@pagesize=50">Easy issues</a> </li> <li> <a href="issue?@template=stats">Stats</a> </li> </ul> </li> <li> <strong>User</strong> <form method="post" action="issue23782"> <ul class="level-three"> <li> Login<br /> <input size="10" name="openid_identifier" style="" /><br /> <input size="10" type="password" name="__login_password" /><br /> <input type="hidden" name="@action" value="Login" /> <input type="checkbox" name="remember" id="remember" /> <label for="remember">Remember me?</label><br /> <input class="form-small" type="submit" value="Login" /><br /> <input type="hidden" name="__came_from" value="https://bugs.python.org/issue23782?"> <input type="hidden" name="@sort" value=""/> <input type="hidden" name="@group" value=""/> <input type="hidden" name="@pagesize" value="50"/> <input type="hidden" name="@startwith" value="0"/> </li> <li> </li> <li><a href="user?@template=forgotten">Lost&nbsp;your&nbsp;login?</a></li> </ul> </form> </li> <li> <strong>Administration</strong> <ul class="level-three"> <li> <a href="user?@sort=username">User List</a></li> <li> <a href="user?iscommitter=1&amp;@action=search&amp;@sort=username&amp;@pagesize=300">Committer List</a></li> </ul> </li> <li> <strong>Help</strong> <ul class="level-three"> <li><a href="http://docs.python.org/devguide/triaging.html"> Tracker Documentation</a></li> <li><a href="http://wiki.python.org/moin/TrackerDevelopment"> Tracker Development</a></li> <li><a href="https://github.com/python/psf-infra-meta/issues"> Report Tracker Problem</a></li> </ul> </li> </ul> </li> </ul> </div> <!-- menu --> </div> <!-- left-hand-navigation --> <div id="content-body"> <div id="body-main"> <div id="content"> <div id="breadcrumb"> Issue23782 </div> <div id="migration-notice"> <div id="migration-images"> <img width="32" src="@@file/python-logo-small.png" /> ➜ <a href="https://github.com/python/cpython/issues"><img width="32" src="@@file/gh-icon.png" /></a> </div> <p>This issue tracker <b>has been migrated to <a href="https://github.com/python/cpython/issues">GitHub</a></b>, and is currently <b>read-only</b>.<br /> For more information, <a title="GitHub FAQs" href="https://devguide.python.org/gh-faq/"> see the GitHub FAQs in the Python's Developer Guide.</a></p> </div> <div> <form method="post" name="itemSynopsis" onsubmit="return submit_once()" enctype="multipart/form-data" action="issue23782"> <div id="gh-issue-link"> <a href="https://github.com/python/cpython/issues/67970"> <img width="32" src="@@file/gh-icon.png" /> <p> <span>This issue has been migrated to GitHub:</span> https://github.com/python/cpython/issues/67970 </p> </a> </div> <fieldset><legend>classification</legend> <table class="form"> <tr> <th class="required"><a href="http://docs.python.org/devguide/triaging.html#title" target="_blank">Title</a>:</th> <td colspan="3"> <span>Leak in _PyTraceback_Add</span> <input type="hidden" name="title" value="Leak in _PyTraceback_Add"> </td> </tr> <tr> <th class="required"><a href="http://docs.python.org/devguide/triaging.html#type" target="_blank">Type</a>:</th> <td>resource usage</td> <th><a href="http://docs.python.org/devguide/triaging.html#stage" target="_blank">Stage</a>:</th> <td>resolved</td> </tr> <tr> <th><a href="http://docs.python.org/devguide/triaging.html#components" target="_blank">Components</a>:</th> <td>Interpreter Core</td> <th><a href="http://docs.python.org/devguide/triaging.html#versions" target="_blank">Versions</a>:</th> <td>Python 3.7, Python 3.6, Python 3.5</td> </tr> </table> </fieldset> <fieldset><legend>process</legend> <table class="form"> <tr> <th><a href="http://docs.python.org/devguide/triaging.html#status" target="_blank">Status</a>:</th> <td>closed</td> <th><a href="http://docs.python.org/devguide/triaging.html#resolution" target="_blank">Resolution</a>:</th> <td>fixed</td> </tr> <tr> <th> <a href="http://docs.python.org/devguide/triaging.html#dependencies" target="_blank">Dependencies</a>: </th> <td> </td> <th><a href="http://docs.python.org/devguide/triaging.html#superseder" target="_blank">Superseder</a>:</th> <td> </td> </tr> <tr> <th> <a href="http://docs.python.org/devguide/triaging.html#assigned-to" target="_blank">Assigned To</a>: </th> <td> serhiy.storchaka </td> <th> <a href="http://docs.python.org/devguide/triaging.html#nosy-list" target="_blank">Nosy List</a><!-- <span tal:condition="context/nosy_count" tal:replace="python: ' (%d)' % context.nosy_count" /> -->: </th> <td> georg.brandl, python-dev, serhiy.storchaka, vstinner </td> </tr> <tr> <th> <a href="http://docs.python.org/devguide/triaging.html#priority" target="_blank">Priority</a>: </th> <td>normal</td> <th> <a href="http://docs.python.org/devguide/triaging.html#keywords" target="_blank">Keywords</a>: </th> <td>patch</td> </tr> </table> </fieldset> </form> <p>Created on <strong>2015-03-26 10:25</strong> by <strong>serhiy.storchaka</strong>, last changed <strong>2022-04-11 14:58</strong> by <strong>admin</strong>. This issue is now <strong style="color:#00F; background-color:inherit;">closed</strong>.</p> <table class="files"> <tr><th colspan="5" class="header">Files</th></tr> <tr> <th>File name</th> <th>Uploaded</th> <th>Description</th> <th>Edit</th> </tr> <tr> <td> <a href="file43473/_PyTraceback_Add_leak.patch">_PyTraceback_Add_leak.patch</a> </td> <td> <span>serhiy.storchaka</span>, <span>2016-06-19 17:09</span> </td> <td></td> <td> <a href="/review/23782/#ps17683">review</a> </td> </tr> <tr> <td> <a href="file45036/_PyTraceback_Add_leak2.patch">_PyTraceback_Add_leak2.patch</a> </td> <td> <span>serhiy.storchaka</span>, <span>2016-10-09 12:59</span> </td> <td></td> <td> <a href="/review/23782/#ps18821">review</a> </td> </tr> </table> <table class="files"> <tr><th class="header" colspan="4">Pull Requests</th></tr> <tr> <th>URL</th> <th>Status</th> <th>Linked</th> <th>Edit</th> </tr> <tr> <td><a href="https://github.com/python/cpython/pull/552" title="[Do Not Merge] Convert `Misc/NEWS` so that it is managed by towncrier">PR 552</a></td> <td>closed</td> <td> <span>dstufft</span>, <span>2017-03-31 16:36</span> </td> <td> </td> </tr> </table> <table class="messages"> <tr><th colspan="4" class="header">Messages (5)</th></tr> <tr> <th> <a href="#msg239319" id="msg239319">msg239319</a> - <a href="msg239319">(view)</a></th> <th>Author: Serhiy Storchaka (serhiy.storchaka) <span title="Contributor form received">*</span> <img src="@@file/committer.png" title="Python committer" alt="(Python committer)" /></th> <th>Date: 2015-03-26 10:25</th> </tr> <tr> <td colspan="4" class="content"> <pre>There is a leak of fetched exception in _PyTraceback_Add() (<a href="https://github.com/python/cpython/blob/master/Python/traceback.c#L146">Python/traceback.c:146</a>).</pre> </td> </tr> <tr> <th> <a href="#msg239321" id="msg239321">msg239321</a> - <a href="msg239321">(view)</a></th> <th>Author: STINNER Victor (vstinner) <span title="Contributor form received">*</span> <img src="@@file/committer.png" title="Python committer" alt="(Python committer)" /></th> <th>Date: 2015-03-26 11:16</th> </tr> <tr> <td colspan="4" class="content"> <pre>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 <a href="https://www.python.org/dev/peps/pep-0490/">PEP 490</a>, I propose to chain the two exceptions.</pre> </td> </tr> <tr> <th> <a href="#msg268857" id="msg268857">msg268857</a> - <a href="msg268857">(view)</a></th> <th>Author: Serhiy Storchaka (serhiy.storchaka) <span title="Contributor form received">*</span> <img src="@@file/committer.png" title="Python committer" alt="(Python committer)" /></th> <th>Date: 2016-06-19 17:09</th> </tr> <tr> <td colspan="4" class="content"> <pre>Proposed patch fixes a leak.</pre> </td> </tr> <tr> <th> <a href="#msg278358" id="msg278358">msg278358</a> - <a href="msg278358">(view)</a></th> <th>Author: Serhiy Storchaka (serhiy.storchaka) <span title="Contributor form received">*</span> <img src="@@file/committer.png" title="Python committer" alt="(Python committer)" /></th> <th>Date: 2016-10-09 12:59</th> </tr> <tr> <td colspan="4" class="content"> <pre>More refactoring.</pre> </td> </tr> <tr> <th> <a href="#msg278852" id="msg278852">msg278852</a> - <a href="msg278852">(view)</a></th> <th>Author: Roundup Robot (python-dev) <img src="@@file/triager.png" title="Python triager" alt="(Python triager)" /></th> <th>Date: 2016-10-18 10:28</th> </tr> <tr> <td colspan="4" class="content"> <pre>New changeset <a href="https://hg.python.org/lookup/6b3be9f38f2a">6b3be9f38f2a</a> by Serhiy Storchaka in branch '3.5': Issue <a class="closed" title="[closed] Leak in _PyTraceback_Add" href="issue23782">#23782</a>: Fixed possible memory leak in _PyTraceback_Add() and exception <a href="https://hg.python.org/cpython/rev/6b3be9f38f2a">https://hg.python.org/cpython/rev/6b3be9f38f2a</a> New changeset <a href="https://hg.python.org/lookup/2d352bf2b228">2d352bf2b228</a> by Serhiy Storchaka in branch '3.6': Issue <a class="closed" title="[closed] Leak in _PyTraceback_Add" href="issue23782">#23782</a>: Fixed possible memory leak in _PyTraceback_Add() and exception <a href="https://hg.python.org/cpython/rev/2d352bf2b228">https://hg.python.org/cpython/rev/2d352bf2b228</a> New changeset <a href="https://hg.python.org/lookup/83877018ef97">83877018ef97</a> by Serhiy Storchaka in branch 'default': Issue <a class="closed" title="[closed] Leak in _PyTraceback_Add" href="issue23782">#23782</a>: Fixed possible memory leak in _PyTraceback_Add() and exception <a href="https://hg.python.org/cpython/rev/83877018ef97">https://hg.python.org/cpython/rev/83877018ef97</a></pre> </td> </tr> </table> <table class="history table table-condensed table-striped"><tr><th colspan="4" class="header"> History </th></tr><tr> <th>Date</th> <th>User</th> <th>Action</th> <th>Args</th> </tr> <tr><td>2022-04-11&nbsp;14:58:14</td><td>admin</td><td>set</td><td>github: 67970</td></tr> <tr><td>2017-03-31&nbsp;16:36:21</td><td>dstufft</td><td>set</td><td>pull_requests: + <a rel="nofollow" href="pull_request951">pull_request951</a></td></tr> <tr><td>2016-10-18&nbsp;10:32:08</td><td>serhiy.storchaka</td><td>set</td><td>status: open -> closed<br />stage: patch review -> resolved<br />resolution: fixed<br />versions: + Python 3.7</td></tr> <tr><td>2016-10-18&nbsp;10:28:39</td><td>python-dev</td><td>set</td><td>nosy: + <a rel="nofollow" href="user13902">python-dev</a><br />messages: + <a rel="nofollow" href="msg278852">msg278852</a><br /></td></tr> <tr><td>2016-10-09&nbsp;12:59:10</td><td>serhiy.storchaka</td><td>set</td><td>files: + <a rel="nofollow" href="file45036">_PyTraceback_Add_leak2.patch</a><br /><br />messages: + <a rel="nofollow" href="msg278358">msg278358</a></td></tr> <tr><td>2016-07-17&nbsp;10:05:33</td><td>serhiy.storchaka</td><td>set</td><td>assignee: <a rel="nofollow" href="user15623">serhiy.storchaka</a></td></tr> <tr><td>2016-06-19&nbsp;17:09:19</td><td>serhiy.storchaka</td><td>set</td><td>files: + <a rel="nofollow" href="file43473">_PyTraceback_Add_leak.patch</a><br />versions: + Python 3.5, Python 3.6<br />messages: + <a rel="nofollow" href="msg268857">msg268857</a><br /><br />components: + Interpreter Core<br />keywords: + <a rel="nofollow" href="keyword2">patch</a><br />stage: patch review</td></tr> <tr><td>2015-03-26&nbsp;11:16:32</td><td>vstinner</td><td>set</td><td>messages: + <a rel="nofollow" href="msg239321">msg239321</a></td></tr> <tr><td>2015-03-26&nbsp;10:25:02</td><td>serhiy.storchaka</td><td>create</td><td></td></tr> </table> </div> </div> <!-- content-body --> <div id="footer"> <div id="credits"> Supported by <a href="https://python.org/psf-landing/" title="The Python Software Foundation">The Python Software Foundation</a>, <br> Powered by <a href="http://roundup.sourceforge.net" title="Powered by the Roundup Issue Tracker">Roundup</a> </div> <!-- credits --> Copyright &copy; 1990-2022, <a href="http://python.org/psf">Python Software Foundation</a><br /> <a href="http://python.org/about/legal">Legal Statements</a> </div> <!-- footer --> </div> <!-- body-main --> </div> <!-- content --> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10