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-111178: fix UBSan for `custom.c` examples by picnixz · Pull Request #131606 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Mar 23, 2025 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: UBSan: Calling a function through pointer to incorrect function type is undefined behavior #111178

📚 Documentation preview 📚: https://cpython-previews--131606.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
@picnixz
fix UBSan for custom.c examples
1fb5d8a
@picnixz picnixz added the skip news label Mar 23, 2025
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 23, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 23, 2025
UBSan: Calling a function through pointer to incorrect function type is undefined behavior #111178
Closed
skirpichev
skirpichev approved these changes Mar 24, 2025
View reviewed changes
@picnixz picnixz self-assigned this Mar 24, 2025
vstinner
vstinner approved these changes Mar 24, 2025
View reviewed changes

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

LGTM

cc @encukou

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Mar 24, 2025
@encukou

encukou commented Mar 24, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

These are included in the docs (newtypes_tutorial.rst), which redundantly define most of those in the prose, and have some notes that reference the casts. Could you change those as well?
(Perhaps there's a way to consolidate this with something like Sphinx's :start-at:, but that might be a distraction right now. In any case, some of the actual prose does need to be updated.)

picnixz 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.

@picnixz
sync docs
811b8eb
@picnixz

picnixz commented Mar 24, 2025

Copy link
Copy Markdown
Member Author

I observed that I incorrectly called a function as well, so thanks Petr for pointing out the docs.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
fixup
816c013
@picnixz
picnixz requested a review from encukou March 24, 2025 10:52
encukou
encukou reviewed Mar 24, 2025
View reviewed changes
Comment thread Doc/extending/newtypes_tutorial.rst Resolved

Uh oh!

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

encukou
encukou reviewed Mar 24, 2025
View reviewed changes
Comment thread Doc/extending/newtypes_tutorial.rst Resolved

Uh oh!

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

@picnixz @encukou
Update Doc/extending/newtypes_tutorial.rst
d3b5c48
Co-authored-by: Petr Viktorin <[email protected]>
picnixz
picnixz commented Mar 24, 2025
View reviewed changes
Comment thread Doc/extending/newtypes_tutorial.rst Resolved

Uh oh!

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

picnixz
picnixz commented Mar 24, 2025
View reviewed changes
Comment thread Doc/extending/newtypes_tutorial.rst Resolved

Uh oh!

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

@picnixz
Update Doc/extending/newtypes_tutorial.rst
4ef74c0
@picnixz

picnixz commented Mar 24, 2025

Copy link
Copy Markdown
Member Author

@encukou feel free to merge this one tomorrow or whenever you want, I'm not on my dev session so I can only edit from the web UI.

encukou 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.

@encukou
encukou merged commit 1d6a2e6 into python:main Mar 24, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Mar 24, 2025
@encukou

encukou commented Mar 24, 2025

Copy link
Copy Markdown
Member

Thanks!
FWIW, there's also newtypes.rst with some UB examples.

picnixz 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.

@picnixz
picnixz deleted the fix/ubsan/doc-custom-111178 branch March 24, 2025 18:31
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 1, 2025
@picnixz @encukou @diegorusso
pythongh-111178: fix UBSan for example code in `extending/newtypes_tu…
af2d5f9
…torial` docs (pythonGH-131606)

Co-authored-by: Petr Viktorin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou left review comments
@vstinner vstinner vstinner approved these changes
@skirpichev skirpichev skirpichev approved these changes

Uh oh!

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

Assignees

@picnixz picnixz

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.

4 participants

@picnixz @encukou @vstinner @skirpichev
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 01402520 — 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.