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-64490: Fix refcount error when arguments are packed to tuple in argument clinic by colorfulappl · Pull Request #99233 · python/cpython

Conversation

@colorfulappl

@colorfulappl colorfulappl commented Nov 8, 2022 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

While Argument Clinic generated code is packing varargs to a tuple, the arguments' refcounts are not increased.
So all the packed arguments‘ refcounts are decreased 1 improperly when the tuple is released later.

This bug is found in #96178 "Argument Clinic functional test".

  • Issue: Argument Clinic should understand *args and **kwargs parameters #64490

Sorry, something went wrong.

Uh oh!

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

All reactions
@colorfulappl
Do INCREF to tuple-packed arguments in Argument Clinic
ce0b4ab
@bedevere-bot bedevere-bot mentioned this pull request Nov 8, 2022
Argument Clinic should understand *args and **kwargs parameters #64490
Closed
@bedevere-bot bedevere-bot added the awaiting review label Nov 8, 2022
@bedevere-bot

bedevere-bot commented Nov 8, 2022

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

All reactions

Sorry, something went wrong.

Uh oh!

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

@colorfulappl
Add News
2230e7b
colorfulappl added a commit to colorfulappl/cpython that referenced this pull request Nov 8, 2022
@colorfulappl
Add PoC of pythonGH-99233
10ce3c7
colorfulappl added 3 commits November 24, 2022 14:55
@colorfulappl
Merge branch 'main' into fix_ac_tuple_refcount
b11ca00
@colorfulappl
Fix typo
c17b6bc
@colorfulappl
Add Argument Clinic functional test cases
ecba0f0
@colorfulappl

colorfulappl commented Nov 24, 2022

Copy link
Copy Markdown
Contributor Author

Added Argument Clinic functional test (#96002).
@erlend-aasland @kumaraditya303

All reactions

Sorry, something went wrong.

Uh oh!

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

@colorfulappl
Delete unnecessary function doc
b652c0c
erlend-aasland
erlend-aasland approved these changes Nov 24, 2022
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.

LGTM. Kumar, do you have any remarks?

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Nov 24, 2022
kumaraditya303
kumaraditya303 reviewed Nov 24, 2022
View reviewed changes
Comment thread Tools/clinic/clinic.py Resolved

Uh oh!

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

@kumaraditya303 kumaraditya303 self-assigned this Nov 24, 2022
@colorfulappl
Replace Py_INCREF with Py_NewRef
a876e94
kumaraditya303
kumaraditya303 approved these changes Nov 24, 2022
View reviewed changes

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

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
@kumaraditya303 kumaraditya303 added type-bug An unexpected behavior, bug, or error topic-argument-clinic labels Nov 24, 2022
@kumaraditya303
kumaraditya303 merged commit 69f6cc7 into python:main Nov 24, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Nov 24, 2022
@kumaraditya303

kumaraditya303 commented Nov 24, 2022

Copy link
Copy Markdown
Contributor

Merged, thanks!

colorfulappl reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@colorfulappl

colorfulappl commented Nov 24, 2022

Copy link
Copy Markdown
Contributor Author

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

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

colorfulappl added a commit to colorfulappl/cpython that referenced this pull request Dec 19, 2022
@colorfulappl
[3.11] pythongh-64490: Fix refcount error when arguments are packed t…
ebc73ec
…o tuple in argument clinic (python#99233)

(cherry picked from commit 69f6cc7)
@bedevere-bot

bedevere-bot commented Dec 19, 2022

Copy link
Copy Markdown

GH-100338 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@colorfulappl colorfulappl mentioned this pull request Dec 19, 2022
[3.11] gh-64490: Fix refcount error when arguments are packed to tuple in argument clinic (GH-99233) #100338
Merged
kumaraditya303 pushed a commit that referenced this pull request Dec 19, 2022
@colorfulappl
[3.11] gh-64490: Fix refcount error when arguments are packed to tupl…
c42a4ad
…e in argument clinic (GH-99233) (#100338)

(cherry picked from commit 69f6cc7)
rjpower added a commit to rjpower/cpython that referenced this pull request Oct 26, 2026
@rjpower
boil: test_clinic drops the pythongh-99233 refcount test
d649673
Deleted test_gh_99233_refcount: sys.getrefcount of a string was unchanged
after Argument Clinic converted it. The C helper gh_99233_refcount in
Modules/_testclinic.c stays; that generated file is outside this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes
@kumaraditya303 kumaraditya303 kumaraditya303 approved these changes

Uh oh!

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

Assignees

@kumaraditya303 kumaraditya303

Labels

topic-argument-clinic type-bug An unexpected behavior, bug, or error

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.

4 participants

@colorfulappl @bedevere-bot @kumaraditya303 @erlend-aasland
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.