GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-104456: Fix ref leak in _ctypes.COMError by Eclips4 · Pull Request #104457 · python/cpython

Conversation

@Eclips4

@Eclips4 Eclips4 commented May 13, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: test_ctypes are leaked #104456

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Eclips4
pythongh-104456: Fix ref leak in test_ctypes
8dbad09
@bedevere-bot bedevere-bot added the awaiting review label May 13, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 13, 2023
test_ctypes are leaked #104456
Closed
@Eclips4

Eclips4 commented May 13, 2023

Copy link
Copy Markdown
Member Author

Seems that related to #104020
@erlend-aasland

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood AlexWaygood added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label May 13, 2023
@bedevere-bot

bedevere-bot commented May 13, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @AlexWaygood for commit 8dbad09 🤖

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label May 13, 2023
@Eclips4

Eclips4 commented May 13, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Thanks Alex for the buildbots start. But, no one from buildbots use a windows system.
In issue I've mentioned that this refleak only reproducible on Windows, because COMError exist only on Windows.
So... buildbots can't catch this refleak :(
However, maybe add a one buildbot with windows system to buildbots ecosystem? I think it's will be useful.
(of course, this should be a another issue)

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood

AlexWaygood commented May 13, 2023

Copy link
Copy Markdown
Member

!buildbot Windows.*Refleak

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented May 13, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @AlexWaygood for commit 8dbad09 🤖

The command will test the builders whose names match following regular expression: Windows.*Refleak

The builders matched are:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood

AlexWaygood commented May 13, 2023

Copy link
Copy Markdown
Member

!buildbot .*Windows.Refleak.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented May 13, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @AlexWaygood for commit 8dbad09 🤖

The command will test the builders whose names match following regular expression: .*Windows.*Refleak.*

The builders matched are:

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland requested changes May 13, 2023
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Please add a Py_tp_clear slot and do the work there. You can call that function from dealloc. Also, the traverse function must be updated similarly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Eclips4 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot bedevere-bot removed the awaiting review label May 13, 2023
@bedevere-bot

bedevere-bot commented May 13, 2023

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting changes label May 13, 2023
@erlend-aasland

erlend-aasland commented May 13, 2023

Copy link
Copy Markdown
Contributor

Also, in dealloc we first untrack from GC, then we clear.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4
Add suggestion
28ac7ed
@Eclips4

Eclips4 commented May 13, 2023

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting change review and removed awaiting changes labels May 13, 2023
@bedevere-bot

bedevere-bot commented May 13, 2023

Copy link
Copy Markdown

Thanks for making the requested changes!

@erlend-aasland: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot
bedevere-bot requested a review from erlend-aasland May 13, 2023 21:11
@gpshead gpshead assigned erlend-aasland May 13, 2023
erlend-aasland
erlend-aasland reviewed May 13, 2023
View reviewed changes
Comment thread Modules/_ctypes/_ctypes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland reviewed May 13, 2023
View reviewed changes
Comment thread Modules/_ctypes/_ctypes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland reviewed May 13, 2023
View reviewed changes
Comment thread Modules/_ctypes/_ctypes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented May 13, 2023

Copy link
Copy Markdown
Contributor

I left some more remarks. I'll follow this up tomorrow.

Eclips4 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Eclips4 and others added 2 commits May 14, 2023 01:53
@Eclips4 @erlend-aasland
Update Modules/_ctypes/_ctypes.c
91e8893
Co-authored-by: Erlend E. Aasland <[email protected]>
@Eclips4
add suggestions from sunmy2019
e317450
Eclips4
Eclips4 commented May 14, 2023
View reviewed changes
Comment thread Modules/_ctypes/_ctypes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

sunmy2019
sunmy2019 reviewed May 14, 2023
View reviewed changes
Comment thread Modules/_ctypes/_ctypes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

sunmy2019
sunmy2019 approved these changes May 14, 2023
View reviewed changes
@sunmy2019

sunmy2019 commented May 14, 2023

Copy link
Copy Markdown
Member

Could you let me know if you've confirmed the error is fixed on Windows? @Eclips4

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4

Eclips4 commented May 14, 2023

Copy link
Copy Markdown
Member Author

Could you let me know if you've confirmed the error is fixed on Windows? @Eclips4

Yeah, refleak are gone:

 ./python -m test -R 3:3 test_ctypes
Running Debug|x64 interpreter...
0:00:00 Run tests sequentially
0:00:00 [1/1] test_ctypes
beginning 6 repetitions
123456
a=5, b=10, c=15
a=5, b=10, c=15
.a=5, b=10, c=15
a=5, b=10, c=15
.a=5, b=10, c=15
a=5, b=10, c=15
.a=5, b=10, c=15
a=5, b=10, c=15
.a=5, b=10, c=15
a=5, b=10, c=15
.a=5, b=10, c=15
a=5, b=10, c=15
.
test_ctypes passed in 31.2 sec

== Tests result: SUCCESS ==

1 test OK.

Total duration: 31.3 sec
Tests result: SUCCESS

Also, thanks for your help!

sunmy2019 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland reviewed May 14, 2023
View reviewed changes
Comment thread Modules/_ctypes/_ctypes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Update Modules/_ctypes/_ctypes.c
019234e
@erlend-aasland erlend-aasland added the skip news label May 14, 2023
@erlend-aasland erlend-aasland changed the title gh-104456: Fix ref leak in test_ctypes gh-104456: Fix ref leak in _ctypes.COMError May 14, 2023
erlend-aasland
erlend-aasland approved these changes May 14, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting change review labels May 14, 2023
@erlend-aasland
erlend-aasland enabled auto-merge (squash) May 14, 2023 20:48
@erlend-aasland

erlend-aasland commented May 14, 2023

Copy link
Copy Markdown
Contributor

Thanks!

Eclips4 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland merged commit 2cd1c87 into python:main May 14, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label May 14, 2023
@Eclips4
Eclips4 deleted the issue-104456 branch May 14, 2023 21:16
carljm added a commit to carljm/cpython that referenced this pull request May 15, 2023
@carljm
Merge branch 'main' into supermon
343867a
* main: (29 commits)
  pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418)
  pythongh-101819: Isolate `_io` (python#101948)
  Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501)
  pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495)
  pythongh-104050: Run mypy on `clinic.py` in CI (python#104421)
  pythongh-104490: Consistently define phony make targets (python#104491)
  pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473)
  pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488)
  pythongh-101282: move BOLT config after PGO (pythongh-104493)
  pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470)
  pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457)
  pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474)
  pythongh-104337: Clarify random.gammavariate doc entry  (python#104410)
  Minor improvements to typing docs (python#104465)
  pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460)
  pythonGH-71383: IDLE - Document testing subsets of modules (python#104463)
  pythongh-104454: Fix refleak in AttributeError_reduce (python#104455)
  pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446)
  pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424)
  Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430)
  ...
carljm added a commit to carljm/cpython that referenced this pull request May 15, 2023
@carljm
Merge branch 'main' into cached_property_docs
452d9f5
* main: (204 commits)
  pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418)
  pythongh-101819: Isolate `_io` (python#101948)
  Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501)
  pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495)
  pythongh-104050: Run mypy on `clinic.py` in CI (python#104421)
  pythongh-104490: Consistently define phony make targets (python#104491)
  pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473)
  pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488)
  pythongh-101282: move BOLT config after PGO (pythongh-104493)
  pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470)
  pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457)
  pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474)
  pythongh-104337: Clarify random.gammavariate doc entry  (python#104410)
  Minor improvements to typing docs (python#104465)
  pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460)
  pythonGH-71383: IDLE - Document testing subsets of modules (python#104463)
  pythongh-104454: Fix refleak in AttributeError_reduce (python#104455)
  pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446)
  pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424)
  Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430)
  ...
@sunmy2019 sunmy2019 mentioned this pull request May 15, 2023
Ref leaks introduced by _io isolation (gh-101948) #104510
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sobolevn sobolevn sobolevn left review comments
@erlend-aasland erlend-aasland erlend-aasland approved these changes
@sunmy2019 sunmy2019 sunmy2019 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@erlend-aasland erlend-aasland

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@Eclips4 @bedevere-bot @AlexWaygood @erlend-aasland @sunmy2019 @sobolevn
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.