Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-30769: Fix reference leak introduced in 77703942c59 #2416

Merged
merged 1 commit into from
Jun 27, 2017

Conversation

ericvw
Copy link
Contributor

@ericvw ericvw commented Jun 26, 2017

New error condition paths were introduced, which did not decrement
key2 and val2 objects. Therefore, decrement references before
jumping to the error label.

Signed-off-by: Eric N. Vander Weele ericvw@gmail.com

@serhiy-storchaka serhiy-storchaka added needs backport to 3.5 type-bug An unexpected behavior, bug, or error labels Jun 26, 2017
@willingc
Copy link
Contributor

Thanks @ericvw for the PR on this issue. @emilyemorehouse, if you have time to review this PR, that would be great since you identified the added test that surfaced the leak (no worries if you don't have time).

@emilyemorehouse
Copy link
Member

@willingc got it!
LGTM, I pulled it down and verified. I also double checked that 2.7 is still error free as a similar patch was applied from the original PR.

I'm happy to update the stage in the bug tracker as PRs progress as well, let me know if that would be helpful. (I also was not sure the exact difference between patch review and commit review).

Copy link
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving changes based on review by @emilyemorehouse.

@willingc
Copy link
Contributor

Thanks @emilyemorehouse! I've approved this PR based on your review.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, I fail to find your name (Eric N. Vander Weele) in Misc/ACKS.

Can you please add yourself to Misc/ACKS?

By the way, @berkerpeksag forgot to add you when he pushed the commit ef6bf4c ;-)

@vstinner
Copy link
Member

"@emilyemorehouse: LGTM"

Don't hesitate to approve the change ;-)

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to complete Misc/ACKS.

@emilyemorehouse
Copy link
Member

@Haypo I'll be more explicit in the future. (:

I'll also keep an eye on this to ensure backporting is completed.

@berkerpeksag
Copy link
Member

By the way, @berkerpeksag forgot to add you when he pushed the commit ef6bf4c ;-)

FTR, I didn't because it was a trivial patch. There is a note in devguide that says we should update Misc/ACKS only for nontrivial changes.

@vstinner
Copy link
Member

@berkerpeksag: "FTR, I didn't because it was a trivial patch. There is a note in devguide that says we should update Misc/ACKS only for nontrivial changes."

Ok, it makes sense!

New error condition paths were introduced, which did not decrement
`key2` and `val2` objects.  Therefore, decrement references before
jumping to the error label.

Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
@ericvw
Copy link
Contributor Author

ericvw commented Jun 27, 2017

Can you please add yourself to Misc/ACKS?

@Haypo, updated Misc/ACKS.

@vstinner vstinner merged commit a7874c7 into python:master Jun 27, 2017
@vstinner
Copy link
Member

Thanks @ericvw, I merged your fix! Anyone wants to backport the fix to 3.6 and 3.5?

@emilyemorehouse
Copy link
Member

@Haypo I'm on it.

emilyemorehouse pushed a commit to emilyemorehouse/cpython that referenced this pull request Jun 27, 2017
)

New error condition paths were introduced, which did not decrement
`key2` and `val2` objects.  Therefore, decrement references before
jumping to the error label.

Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
(cherry picked from commit a7874c7)
@bedevere-bot
Copy link

GH-2425 is a backport of this pull request to the 3.6 branch.

@emilyemorehouse
Copy link
Member

3.5 has a merge conflict, looking into it. 😬

@emilyemorehouse
Copy link
Member

Actually, the identical test_execve_invalid_env passes just fine on 3.5.

serhiy-storchaka pushed a commit that referenced this pull request Jun 27, 2017
…2425)

New error condition paths were introduced, which did not decrement
`key2` and `val2` objects.  Therefore, decrement references before
jumping to the error label.

Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
(cherry picked from commit a7874c7)
@vstinner
Copy link
Member

@emilyemorehouse: "3.5 has a merge conflict, looking into it. 😬"

Do you need help to handle the conflict? You might rewrite the fix instead of trying a simple cherry-pick, it may be simpler.

@emilyemorehouse
Copy link
Member

Rewriting the fix was indeed the path I was going to take. I'm stuck on not having a test case to illustrate the issue for 3.5 as the original test that I was using actually passes on 3.5 as is, though Serhiy pointed out that the bug does indeed exist for 3.5

@vstinner
Copy link
Member

I just checked the 3.5 branch (at commit de1850b) on Linux, and I'm still able to reproduce the bug:

haypo@selma$ ./python -m test -R 3:3 -m test_execve_invalid_env test_os
0:00:00 load avg: 0.72 [1/1] test_os
beginning 6 repetitions
123456
......
test_os leaked [2, 2, 2] references, sum=6
test_os leaked [2, 2, 2] memory blocks, sum=6
1 test failed:
    test_os
Tests result: FAILURE

emilyemorehouse added a commit to emilyemorehouse/cpython that referenced this pull request Jun 27, 2017
@bedevere-bot
Copy link

GH-2447 is a backport of this pull request to the 3.5 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants