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 — [3.11] gh-111942: Remove an extra incref in textiowrapper_change_encoding by encukou · Pull Request #126542 · python/cpython

Conversation

@encukou

@encukou encukou commented Nov 7, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

A recent test fix uncovered a refleak that went in 3.11 on November due to a Git mis-merge.

So, @pablogsal, here's a RM decision for you. (Not time-sensitive, of course.)
This is not a security issue, but it should fix failing buildbots. (The other way to fix them would be to revert the change that uncovered the issue, which would mean we probably won't notice future refleaks in test_io.)


There's an issue with the 3.11 backport commit e2421a3 The change for the main branch was:

+    Py_INCREF(errors);
 ...
     Py_SETREF(self->encoding, encoding);
-    Py_SETREF(self->errors, Py_NewRef(errors));
+    Py_SETREF(self->errors, errors);

but in 3.11 this became:

+    Py_INCREF(errors);
...
     Py_INCREF(errors);
     Py_SETREF(self->encoding, encoding);
     Py_SETREF(self->errors, errors);

i.e. there's an extra incref, but it looks -- at least to Git -- like the change that removes Py_NewRef was already applied.

This was not caught because test_io refleaks tests were ineffective on 3.11 (see #126478 (comment)).

Remove the extraneous incref.

  • Issue: TextIOWrapper.reconfigure() crashes if encoding is not string or None #111942

Sorry, something went wrong.

Uh oh!

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

serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@encukou
[3.11] pythongh-111942: Remove an extra incref in textiowrapper_chang…
8e08bf8
…e_encoding

There's an issue with the 3.11 backport commit e2421a3
The chane for the main branch was:

```diff
+    Py_INCREF(errors);
 ...
     Py_SETREF(self->encoding, encoding);
-    Py_SETREF(self->errors, Py_NewRef(errors));
+    Py_SETREF(self->errors, errors);
```

but in 3.11 this became:

```diff
+    Py_INCREF(errors);
...
     Py_INCREF(errors);
     Py_SETREF(self->encoding, encoding);
     Py_SETREF(self->errors, errors);
```
i.e. there's an extra incref, but it looks -- at least to Git -- like the change
that removes `Py_NewRef` was already applied.

This was not caught because `test_io` refleaks tests were ineffective on 3.11
(see python#126478 (comment)).

Remove the extraneous incref.
@bedevere-app bedevere-app Bot added the awaiting core review label Nov 7, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Nov 7, 2024
TextIOWrapper.reconfigure() crashes if encoding is not string or None #111942
Closed
@encukou

encukou commented Nov 7, 2024

Copy link
Copy Markdown
Member Author

(stepping out for a bit, then I'll start the buildbots on this after GHA runs.)

All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou encukou added skip news 🔨 test-with-buildbots Test PR w/ buildbots; report in status section and removed awaiting core review labels Nov 7, 2024
@bedevere-bot

bedevere-bot commented Nov 7, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit 8e08bf8 🤖

If you want to schedule another build, you need to add the 🔨 test-with-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-buildbots Test PR w/ buildbots; report in status section label Nov 7, 2024
@encukou

encukou commented Nov 7, 2024

Copy link
Copy Markdown
Member Author

!buildbot AMD64 Windows11 Refleaks

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Nov 7, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit 8e08bf8 🤖

The command will test the builders whose names match following regular expression: AMD64 Windows11 Refleaks

The builders matched are:

  • AMD64 Windows11 Refleaks PR
All reactions

Sorry, something went wrong.

Uh oh!

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

@encukou

encukou commented Nov 8, 2024

Copy link
Copy Markdown
Member Author

The failing builds are unstable (Alpine, Usan, Valgrind, FIPS, AIX), not meant for 3.10 (Android, iOS, WASI, NoGIL, bigmem/extralargefile), flaky (s390x RHEL8 Refleaks, PPC64LE Fedora), or show an unrelated problem (test_socket or Fedora).

All reactions

Sorry, something went wrong.

Uh oh!

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

pablogsal
pablogsal approved these changes Nov 8, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added the awaiting merge label Nov 8, 2024
@pablogsal
pablogsal merged commit e33b6fc into python:3.11 Nov 8, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 8, 2024
@pablogsal

pablogsal commented Nov 8, 2024

Copy link
Copy Markdown
Member

Thanks @encukou! I think it makes sense to land it so I went ahead

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

Sorry, something went wrong.

Uh oh!

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

@encukou
encukou deleted the extra-incref-3.11 branch November 11, 2024 14:27
@encukou

encukou commented Nov 11, 2024

Copy link
Copy Markdown
Member Author

Thank you!

The buildbots have recovered :)

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes

Uh oh!

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

Assignees

No one assigned

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.

3 participants

@encukou @bedevere-bot @pablogsal
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.