[2.7] bpo-36126: Fix ref count leakage in structseq_repr#12035
[2.7] bpo-36126: Fix ref count leakage in structseq_repr#12035serhiy-storchaka merged 1 commit intopython:2.7from zasdfgbnm:patch-1
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
|
Just signed CLA, might take time for the status to be updated? |
eamanu
left a comment
There was a problem hiding this comment.
lgtm, Can you add a testcase?
hmm IMO you should open a bpo, this way you will have more reviewers
|
Try to made the PR on master branch. |
|
@eamanu The master branch does not have this problem. |
|
Also @eamanu, is there a way to test ref count for local variables is correctly handled? These variables are not visible outside the function. Also, there are so many edge cases, and I didn't see any similar test for other edge cases. |
|
Do I need to add news? |
|
I think this is not required. You can get the leak only in very special situation. SystemError itself is a sign of more severe issues. |
|
Thank you for your contribution @zasdfgbnm! |
Not sure if I need to open an issue for this one line fix.
This fixes the ref count leakage of
structseq_repron Python 2.7. To reproduce the bug, create a new project:setup.py
test_pystructsequence.c
And run the following file and look at the memory usage:
https://bugs.python.org/issue36126