Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue35720

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Memory leak in Modules/main.c:pymain_parse_cmdline_impl when using the CLI flag
Type:resource usageStage:resolved
Components:Versions:Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Lucas Cimon, miss-islington, vstinner
Priority:normalKeywords:patch, patch, patch

Created on2019-01-11 19:14 byLucas Cimon, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 11528mergedpython-dev,2019-01-11 19:16
PR 11528mergedpython-dev,2019-01-11 19:16
PR 11528mergedpython-dev,2019-01-11 19:16
PR 11648mergedmiss-islington,2019-01-22 16:16
PR 11648mergedmiss-islington,2019-01-22 16:16
Messages (4)
msg333499 -(view)Author: Lucas Cimon (Lucas Cimon)*Date: 2019-01-11 19:14
Hi.I think I have found a minor memory leak inModules/main.c:pymain_parse_cmdline_impl.When the loop in the pymain_read_conf function in this same filecalls pymain_init_cmdline_argv a 2nd time, the pymain->commandbuffer of wchar_t is overriden and the previously allocated memoryis never freed.I haven't written any code test to reproduce this,but it can be tested easily with gdb:```gdb -- bin/python3 -c passstartbModules/main.c:587b pymain_clear_pymaincc```You'll see that PyMem_RawMalloc is called twice without pymain->command ever being freed in pymain_clear_pymain.I have a patch coming as PR on GitHubI'd be glad to have your feedback on this issue and my proposal for a fix.Regards.
msg334217 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-01-22 16:15
New changeset35ca1820e19f81f69073f294503cdcd708fe490f by Victor Stinner (Lucas Cimon) in branch 'master':bpo-35720: Fixing a memory leak in pymain_parse_cmdline_impl() (GH-11528)https://github.com/python/cpython/commit/35ca1820e19f81f69073f294503cdcd708fe490f
msg334220 -(view)Author: miss-islington (miss-islington)Date: 2019-01-22 16:42
New changesetf71e7433ebccb2e3a2665b93bb84de38f9c581c8 by Miss Islington (bot) in branch '3.7':bpo-35720: Fixing a memory leak in pymain_parse_cmdline_impl() (GH-11528)https://github.com/python/cpython/commit/f71e7433ebccb2e3a2665b93bb84de38f9c581c8
msg334221 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2019-01-22 16:43
Thanks Lucas Cimon!
History
DateUserActionArgs
2022-04-11 14:59:10adminsetgithub: 79901
2019-01-22 16:43:52vstinnersetstatus: open -> closed
messages: +msg334221

keywords:patch,patch,patch
resolution: fixed
stage: patch review -> resolved
2019-01-22 16:42:16miss-islingtonsetnosy: +miss-islington
messages: +msg334220
2019-01-22 16:16:09miss-islingtonsetpull_requests: +pull_request11434
2019-01-22 16:16:03miss-islingtonsetpull_requests: +pull_request11433
2019-01-22 16:15:05vstinnersetmessages: +msg334217
2019-01-14 10:05:04SilentGhostsetkeywords:patch,patch,patch
nosy: +vstinner

type: resource usage
versions: + Python 3.7, Python 3.8
2019-01-11 19:16:22python-devsetkeywords: +patch
stage: patch review
pull_requests: +pull_request11118
2019-01-11 19:16:20python-devsetkeywords: +patch
stage: (no value)
pull_requests: +pull_request11117
2019-01-11 19:16:17python-devsetkeywords: +patch
stage: (no value)
pull_requests: +pull_request11116
2019-01-11 19:14:02Lucas Cimoncreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp