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-145202: Fix crash in unicodedata's GraphemeBreakIterator and Segment by serhiy-storchaka · Pull Request #145216 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Feb 25, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Remove the tp_clear slots and make Segment members read-only.

  • Issue: Segfault from unicodedata.iter_graphemes on a free threaded build #145202

Sorry, something went wrong.

Uh oh!

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

All reactions
@serhiy-storchaka
pythongh-145202: Fix crash in unicodedata's GraphemeBreakIterator and…
4134f4d
… Segment

Remove the tp_clear slots and make Segment members read-only.
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 25, 2026
@serhiy-storchaka serhiy-storchaka added skip news and removed awaiting core review labels Feb 25, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Feb 25, 2026
Segfault from unicodedata.iter_graphemes on a free threaded build #145202
Closed
@serhiy-storchaka serhiy-storchaka mentioned this pull request Feb 25, 2026
gh-145202: Fix segfault in unicodedata.iter_graphemes when cleared by GC #145203
Closed
sergey-miryanov
sergey-miryanov reviewed Feb 25, 2026
View reviewed changes
Comment thread Modules/unicodedata.c Resolved

Uh oh!

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

sergey-miryanov
sergey-miryanov approved these changes Feb 25, 2026
View reviewed changes

@sergey-miryanov sergey-miryanov 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, small nitpick.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 25, 2026
@serhiy-storchaka
Add tests for reference loops.
d1f651f
@serhiy-storchaka

serhiy-storchaka commented Feb 25, 2026

Copy link
Copy Markdown
Member Author

It is difficult to implement the absence of something. There are other GC classes that do not implement tp_clear. They will also crash if we add tp_clear without updating tp_dealloc.

I added tests to ensure that these classes work with the garbage collector.

sergey-miryanov 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.

colesbury
colesbury approved these changes Feb 25, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Feb 25, 2026
@serhiy-storchaka
serhiy-storchaka merged commit 812ef66 into python:main Feb 26, 2026
49 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Feb 26, 2026
@serhiy-storchaka
serhiy-storchaka deleted the unicodedata-iter_graphemes-clear branch February 26, 2026 09:30
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
@serhiy-storchaka @brijkapadia
pythongh-145202: Fix crash in unicodedata's GraphemeBreakIterator and…
3032154
… Segment (pythonGH-145216)

Remove the tp_clear slots and make Segment members read-only.

Also add tests for reference loops involving GraphemeBreakIterator
and Segment.
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@serhiy-storchaka @ljfp
pythongh-145202: Fix crash in unicodedata's GraphemeBreakIterator and…
5179bd7
… Segment (pythonGH-145216)

Remove the tp_clear slots and make Segment members read-only.

Also add tests for reference loops involving GraphemeBreakIterator
and Segment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sergey-miryanov sergey-miryanov sergey-miryanov approved these changes
@colesbury colesbury colesbury 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

@serhiy-storchaka @sergey-miryanov @colesbury
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.