FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-156124: Fix a crash when deleting ctypes Pointer.contents by serhiy-storchaka · Pull Request #156125 · python/cpython · GitHub

Repository navigation

gh-156124: Fix a crash when deleting ctypes Pointer.contents - #156125

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-156124-ctypes-pointer-contents-delete
Aug 21, 2026
Merged

serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-156124-ctypes-pointer-contents-delete

Conversation

serhiy-storchaka commented Aug 20, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Pointer_set_contents() entered a critical section on the new value before checking it for NULL, so del ptr.contents crashed the free-threaded build. The check is moved ahead of the critical section.

In the free-threaded build the setter passed the value to
Py_BEGIN_CRITICAL_SECTION2() before checking it for NULL.
serhiy-storchaka added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Aug 20, 2026
serhiy-storchaka merged commit ca6e733 into python:main Aug 21, 2026
60 checks passed

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

serhiy-storchaka deleted the gh-156124-ctypes-pointer-contents-delete branch August 21, 2026 07:05

bedevere-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

GH-156153 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Aug 21, 2026

bedevere-app Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 21, 2026
serhiy-storchaka added a commit that referenced this pull request Aug 21, 2026
…H-156125) (GH-156154)

In the free-threaded build the setter passed the value to
Py_BEGIN_CRITICAL_SECTION2() before checking it for NULL.
(cherry picked from commit ca6e733)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Oct 10, 2026
…H-156125) (GH-156153)

In the free-threaded build the setter passed the value to
Py_BEGIN_CRITICAL_SECTION2() before checking it for NULL.
(cherry picked from commit ca6e733)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL