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: Missing Py_DECREF in task_step_impl() in _asynciomodule.c
Type: resource usage Stage: resolved
Components: asyncio Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, chris.jerdonek, miss-islington, yselivanov
Priority: normal Keywords: patch

Created on 2020-05-08 07:40 by chris.jerdonek, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19990 merged chris.jerdonek, 2020-05-08 08:01
PR 19995 merged miss-islington, 2020-05-08 10:54
PR 19996 merged miss-islington, 2020-05-08 10:55
Messages (5)
msg368425 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2020-05-08 07:40
There is a missing Py_DECREF in task_step_impl() in _asynciomodule.c:
https://github.com/python/cpython/blob/02fa0ea9c1073e4476c9bde3d7112f5dd964aa57/Modules/_asynciomodule.c#L2641

It should have the form:

    if (clear_exc) {
        Py_DECREF(exc);
    }

This was introduced here in 3.7:
https://github.com/python/cpython/commit/bca4939d806170c3ca5d05f23710d11a8f1669cf

I'm not sure of the likelihood of this ever getting triggered (it appears to be unlikely), but it should still be addressed.

I will file a patch shortly.
msg368426 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2020-05-08 07:54
Here is the original issue: https://bugs.python.org/issue31185
msg368432 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2020-05-08 10:54
New changeset d2c349b190bcba21a4a38e6520a48ad97a9f1529 by Chris Jerdonek in branch 'master':
bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
https://github.com/python/cpython/commit/d2c349b190bcba21a4a38e6520a48ad97a9f1529
msg368433 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2020-05-08 11:28
New changeset 0e4a5e96f011989736bde824ab817146bd7c9cfc by Miss Islington (bot) in branch '3.8':
[3.8] bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
https://github.com/python/cpython/commit/0e4a5e96f011989736bde824ab817146bd7c9cfc
msg368434 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2020-05-08 11:30
New changeset 25014289887cb521c1041df4773c839d3fbf784e by Miss Islington (bot) in branch '3.7':
[3.7] bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
https://github.com/python/cpython/commit/25014289887cb521c1041df4773c839d3fbf784e
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84739
2020-05-08 11:47:23chris.jerdoneksetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-05-08 11:30:34chris.jerdoneksetmessages: + msg368434
2020-05-08 11:28:42chris.jerdoneksetmessages: + msg368433
2020-05-08 10:55:07miss-islingtonsetpull_requests: + pull_request19311
2020-05-08 10:54:59miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request19310
2020-05-08 10:54:42chris.jerdoneksetmessages: + msg368432
2020-05-08 08:01:58chris.jerdoneksetkeywords: + patch
stage: patch review
pull_requests: + pull_request19306
2020-05-08 07:54:28chris.jerdoneksetmessages: + msg368426
2020-05-08 07:40:03chris.jerdonekcreate