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-142516: fix reference leaks in `ssl.SSLContext` objects by picnixz · Pull Request #143685 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Jan 11, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

I don't think it'll fix all the issues but at least it will fix some issues on SSL contexts.

  • Issue: Observed memory leak in ssl library: Python 3.14 GC issue #142516

Sorry, something went wrong.

Uh oh!

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

All reactions
@picnixz
pythongh-142516: fix reference leaks in ssl.SSLContext objects
cfca05f
@picnixz
picnixz requested a review from gpshead as a code owner January 11, 2026 12:06
@bedevere-app bedevere-app Bot mentioned this pull request Jan 11, 2026
Observed memory leak in ssl library: Python 3.14 GC issue #142516
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 11, 2026
@picnixz
picnixz force-pushed the fix/ssl/leak-gc-142516 branch 3 times, most recently from d32e7bb to b7fa115 Compare January 11, 2026 12:17
picnixz added 2 commits January 11, 2026 13:17
@picnixz
test! add regression tests
ba02a26
@picnixz
chore! NEWS entry
6b08305
@picnixz
picnixz force-pushed the fix/ssl/leak-gc-142516 branch from b7fa115 to 6b08305 Compare January 11, 2026 12:17
@picnixz picnixz added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Jan 11, 2026
@bedevere-bot

bedevere-bot commented Jan 11, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @picnixz for commit 6b08305 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143685%2Fmerge

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 Jan 11, 2026
@picnixz picnixz changed the title gh-142516: fix reference leaks in ssl objects gh-142516: fix reference leaks in ssl.SSLContext objects Jan 11, 2026
@picnixz
fix tests on Windows
57d4fba
@picnixz

picnixz commented Jan 18, 2026

Copy link
Copy Markdown
Member Author

When I am back home I will update the PR

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
Merge branch 'main' into fix/ssl/leak-gc-142516
9083a84
@picnixz
picnixz marked this pull request as draft February 7, 2026 11:07
@bedevere-app bedevere-app Bot removed the awaiting core review label Feb 7, 2026
@picnixz
post-merge
02226ce
@picnixz
picnixz marked this pull request as ready for review February 7, 2026 11:08
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 7, 2026
@picnixz picnixz added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 7, 2026
@bedevere-bot

bedevere-bot commented Feb 7, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @picnixz for commit 02226ce 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F143685%2Fmerge

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 Feb 7, 2026
@picnixz picnixz added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes and removed needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Feb 7, 2026
@picnixz

picnixz commented Feb 7, 2026

Copy link
Copy Markdown
Member Author

Actually I will do the backports manually later. Too many conflicts.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
picnixz merged commit 3a2a686 into python:main Feb 21, 2026
72 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting core review label Feb 21, 2026
@picnixz
picnixz deleted the fix/ssl/leak-gc-142516 branch February 21, 2026 11:31
picnixz added a commit to picnixz/cpython that referenced this pull request Feb 21, 2026
@picnixz
[3.14] pythongh-142516: fix reference leaks in ssl.SSLContext objec…
4607b00
…ts (pythonGH-143685)

(cherry picked from commit 3a2a686)

Co-authored-by: Bénédikt Tran <[email protected]>
@bedevere-app

bedevere-app Bot commented Feb 21, 2026

Copy link
Copy Markdown

GH-145075 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

gpshead
gpshead reviewed Feb 21, 2026
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

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.

thanks!

Sorry, something went wrong.

Uh oh!

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

All reactions
gpshead pushed a commit that referenced this pull request Feb 21, 2026
@picnixz
[3.14] gh-142516: fix reference leaks in ssl.SSLContext objects (GH…
1decc7e
…-143685) (#145075)

* [3.14] gh-142516: fix reference leaks in `ssl.SSLContext` objects (GH-143685)
(cherry picked from commit 3a2a686)

Co-authored-by: Bénédikt Tran <[email protected]>

* fix backport
@bedevere-bot

bedevere-bot commented Feb 21, 2026

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 FreeBSD Refleaks 3.14 (tier-3) has failed when building commit 1decc7e.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1800/builds/1014) and take a look at the build logs.
  4. Check if the failure is related to this commit (1decc7e) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1800/builds/1014

Test leaking resources:

  • test_events: memory blocks

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/test/support/__init__.py", line 859, in gc_collect
    gc.collect()
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('127.0.0.1', 59018), raddr=('127.0.0.1', 59019)>
Task was destroyed but it is pending!
task: <Task pending name='Task-2213' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py:217> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x843ce44d0>:
Traceback (most recent call last):
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py", line 873, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=9>
k


Traceback (most recent call last):
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/test/support/__init__.py", line 859, in gc_collect
    gc.collect()
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('127.0.0.1', 10128), raddr=('127.0.0.1', 10129)>
Task was destroyed but it is pending!
task: <Task pending name='Task-1257' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py:217> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x842b784d0>:
Traceback (most recent call last):
  File "/buildbot/buildarea/3.14.ware-freebsd.refleak/build/Lib/asyncio/selector_events.py", line 873, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=9>
k
All reactions

Sorry, something went wrong.

Uh oh!

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

brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
@picnixz @brijkapadia
pythongh-142516: fix reference leaks in ssl.SSLContext objects (pyt…
ef867b3
…hon#143685)
picnixz added a commit to picnixz/cpython that referenced this pull request Apr 11, 2026
@picnixz
[3.13] pythongh-142516: fix reference leaks in ssl.SSLContext objec…
5aa7ad2
…ts (pythonGH-143685) (pythonGH-145075)

* [3.14] pythongh-142516: fix reference leaks in `ssl.SSLContext` objects (pythonGH-143685)
(cherry picked from commit 3a2a686)

Co-authored-by: Bénédikt Tran <[email protected]>

* fix backport
(cherry picked from commit 1decc7e)

Co-authored-by: Bénédikt Tran <[email protected]>
picnixz added a commit to picnixz/cpython that referenced this pull request Apr 11, 2026
@picnixz
[3.14] pythongh-142516: fix reference leaks in ssl.SSLContext objec…
c690e8c
…ts (pythonGH-143685) (python#145075)

* [3.14] pythongh-142516: fix reference leaks in `ssl.SSLContext` objects (pythonGH-143685)
(cherry picked from commit 3a2a686)

Co-authored-by: Bénédikt Tran <[email protected]>

* fix backport
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@picnixz @ljfp
pythongh-142516: fix reference leaks in ssl.SSLContext objects (pyt…
bbaf112
…hon#143685)
picnixz added a commit that referenced this pull request May 24, 2026
@picnixz
[3.13] gh-142516: fix reference leaks in ssl.SSLContext objects (GH…
e102378
…-143685) (GH-145075) (#148371)

Cherry picked from commits 3a2a686
and 1decc7e with minor amendments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead left review comments

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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

@picnixz @bedevere-bot @gpshead
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.