Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-38803: Fix leak in posixmodule#17373

Merged
benjaminp merged 1 commit into
python:masterpython/cpython:masterfrom
eduardo-elizondo:posix-leak-fixeduardo-elizondo/cpython:posix-leak-fixCopy head branch name to clipboard
Nov 26, 2019
Merged

bpo-38803: Fix leak in posixmodule#17373
benjaminp merged 1 commit into
python:masterpython/cpython:masterfrom
eduardo-elizondo:posix-leak-fixeduardo-elizondo/cpython:posix-leak-fixCopy head branch name to clipboard

Conversation

@eduardo-elizondo

@eduardo-elizondo eduardo-elizondo commented Nov 25, 2019

Copy link
Copy Markdown
Contributor

Fixed a leak in posixmodule by running my leak detection tool:

eelizondo@build -> ./python -m test test_wait3 -R 3:3 -j0
Expected refcnt: 24, actual: 25
class 'resource.struct_rusage'>

This quickly pointed out to the function that pulled out the struct_rusage class.

Run after the fix:

eelizondo@build -> ./python -m test test_wait3 -R 3:3 -j0
0:00:42 load avg: 4.16 [1/1] test_wait3 passed (42.3 sec)
beginning 6 repetitions
123456
123456
......
== Tests result: SUCCESS ==

eelizondo@build -> ./python -m test test_wait4 -R 3:3 -j0
0:00:00 load avg: 3.59 Run tests in parallel using 50 child processes
0:00:30 load avg: 4.02 running: test_wait4 (30.0 sec)
0:00:36 load avg: 4.10 [1/1] test_wait4 passed (36.3 sec)
beginning 6 repetitions
123456
......
== Tests result: SUCCESS ==

https://bugs.python.org/issue38803

@eduardo-elizondo

Copy link
Copy Markdown
Contributor Author

cc @vstinner

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@eduardo-elizondo cc @vstinner

Thanks for your contribution.
I checked your PR locally and it works well.

master

Python 3.9.0a1+ (heads/master:27fc3b6, Nov 25 2019, 17:29:57

$ ./python -m test test_wait3 -R 3:3 -j0
0:00:00 load avg: 0.00 Run tests in parallel using 10 child processes
0:00:30 load avg: 0.00 running: test_wait3 (30.0 sec)
0:00:36 load avg: 0.00 [1/1/1] test_wait3 failed (36.6 sec)
beginning 6 repetitions
123456
......
test_wait3 leaked [23, 22, 22] references, sum=67

== Tests result: FAILURE ==

1 test failed:
    test_wait3

Total duration: 36.9 sec
Tests result: FAILURE

Proposed

Python 3.9.0a1+ (heads/pr/17373:b67e20e, Nov 25 2019, 17:27:28)

$ ./python -m test test_wait3 -R 3:3 -j0
0:00:00 load avg: 0.00 Run tests in parallel using 10 child processes
0:00:30 load avg: 0.00 running: test_wait3 (30.0 sec)
0:00:36 load avg: 0.00 [1/1] test_wait3 passed (36.6 sec)
beginning 6 repetitions
123456
......

== Tests result: SUCCESS ==

1 test OK.

Total duration: 37.0 sec
Tests result: SUCCESS

@benjaminp benjaminp merged commit e4db1f0 into python:master Nov 26, 2019
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.