Skip to content

gh-101747: Fix refleak in new OrderedDict repr - #101748

Merged
rhettinger merged 2 commits into
python:mainfrom
sobolevn:issue-101747
Feb 10, 2023
Merged

rhettinger merged 2 commits into
python:mainfrom
sobolevn:issue-101747

Conversation

@sobolevn

@sobolevn sobolevn commented Feb 9, 2023 •

Copy link
Copy Markdown
Member

After: ./python.exe -m test -v test_ordered_dict -R 3:3

Ran 279 tests in 1.460s

OK
.

== Tests result: SUCCESS ==

1 test OK.

Total duration: 10.2 sec
Tests result: SUCCESS
@sobolevn
sobolevn requested a review from corona10 February 9, 2023 17:10
@corona10 corona10 added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 9, 2023
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @corona10 for commit f8adfe9 🤖

If you want to schedule another build, you need to add the :hammer: test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 9, 2023
@erlend-aasland

Copy link
Copy Markdown
Contributor

The aarch64 RHEL8 refleak bot still reports a leak. Could you please examine, @sobolevn?

Comment thread Objects/odictobject.c Outdated

Done:
Py_ReprLeave((PyObject *)self);
Py_XDECREF(dcopy);

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.

You can move it above the Done label and change Py_XDECREF to Py_DECREF.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, it might be a slightly more readable! I will wait for all tests to finish and apply it :)

@sobolevn

sobolevn commented Feb 9, 2023

Copy link
Copy Markdown
Member Author

@erlend-aasland it reports:

test_importlib leaked [6, 4, 2] references, sum=12
test_importlib leaked [4, 4, 2] memory blocks, sum=10

I think these leaks are not related 🤔

Should I fix it here?

@erlend-aasland

Copy link
Copy Markdown
Contributor

Should I fix it here?

I prefer one fix per PR; that makes it easier to bisect in case something goes wrong, and it also makes for a cleaner git history.

@sobolevn

sobolevn commented Feb 9, 2023

Copy link
Copy Markdown
Member Author

@erlend-aasland then I consider this done:

  1. Review suggestion is applied
  2. New issue is created: Refleak in test_importlib on aarch64 RHEL8 #101766

@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.

lgtm

@corona10

corona10 commented Feb 9, 2023

Copy link
Copy Markdown
Member

I will merge this PR after waiting for @serhiy-storchaka approval

test_importlib leaked [6, 4, 2] references, sum=12

I can not reproduce the issue on my macOS. It sounds like we have to debug on the RHEL machine.

@rhettinger
rhettinger merged commit 34c50ce into python:main Feb 10, 2023
carljm added a commit to carljm/cpython that referenced this pull request Feb 10, 2023
* main:
  Fix some typos in asdl_c.py (pythonGH-101757)
  pythongh-101747: Fix refleak in new `OrderedDict` repr (pythonGH-101748)
  pythongh-101430: Update tracemalloc to handle presize properly. (pythongh-101745)
  pythonGH-101228: Fix typo in docstring for read method of `_io.TextIOWrapper` class (python#101227)
  Fix typo in `test_fstring.py` (python#101600)
  pythongh-101726: Update the OpenSSL version to 1.1.1t (pythonGH-101727)
  pythongh-101283: Fix 'versionchanged' for the shell=True fallback on Windows in 3.12 (pythonGH-101728)
  LibFFI build requires x64 Cygwin, and skip the ARM build (pythonGH-101743)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

7 participants