Issue35720
Created on 2019-01-11 19:14 by Lucas Cimon, last changed 2019-01-22 16:43 by vstinner. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11528 | merged | python-dev, 2019-01-11 19:16 | |
| PR 11528 | merged | python-dev, 2019-01-11 19:16 | |
| PR 11528 | merged | python-dev, 2019-01-11 19:16 | |
| PR 11648 | merged | miss-islington, 2019-01-22 16:16 | |
| PR 11648 | merged | miss-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 in Modules/main.c:pymain_parse_cmdline_impl. When the loop in the pymain_read_conf function in this same file calls pymain_init_cmdline_argv a 2nd time, the pymain->command buffer of wchar_t is overriden and the previously allocated memory is never freed. I haven't written any code test to reproduce this, but it can be tested easily with gdb: ``` gdb -- bin/python3 -c pass start b Modules/main.c:587 b pymain_clear_pymain c c ``` 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 GitHub I'd be glad to have your feedback on this issue and my proposal for a fix. Regards. |
|||
| msg334217 - (view) | Author: STINNER Victor (vstinner) * | Date: 2019-01-22 16:15 | |
New changeset 35ca1820e19f81f69073f294503cdcd708fe490f 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 changeset f71e7433ebccb2e3a2665b93bb84de38f9c581c8 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) * | Date: 2019-01-22 16:43 | |
Thanks Lucas Cimon! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-01-22 16:43:52 | vstinner | set | status: open -> closed messages: + msg334221 keywords:
patch, patch, patch |
| 2019-01-22 16:42:16 | miss-islington | set | nosy:
+ miss-islington messages: + msg334220 |
| 2019-01-22 16:16:09 | miss-islington | set | pull_requests: + pull_request11434 |
| 2019-01-22 16:16:03 | miss-islington | set | pull_requests: + pull_request11433 |
| 2019-01-22 16:15:05 | vstinner | set | messages: + msg334217 |
| 2019-01-14 10:05:04 | SilentGhost | set | keywords:
patch, patch, patch nosy: + vstinner type: resource usage |
| 2019-01-11 19:16:22 | python-dev | set | keywords:
+ patch stage: patch review pull_requests: + pull_request11118 |
| 2019-01-11 19:16:20 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request11117 |
| 2019-01-11 19:16:17 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request11116 |
| 2019-01-11 19:14:02 | Lucas Cimon | create | |