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 USAN failures for `partialobject` by picnixz · Pull Request #124733 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Sep 28, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Before reviewing this one, I'll add a suppression file with all the incriminating functions. And whenever I make a new PR for fixing USAN failures, I'll just remove the corresponding entries so that we can really check the changes by running the build bot.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot mentioned this pull request Sep 28, 2024
UBSan: Calling a function through pointer to incorrect function type is undefined behavior #111178
Closed
@picnixz picnixz added the skip news label Sep 28, 2024
@picnixz
picnixz force-pushed the chore/fix-usan-failures-partialobject-111178 branch from 8327ef1 to 080d875 Compare September 29, 2024 10:52
picnixz added 3 commits September 29, 2024 13:01
@picnixz
partial_vectorcall
cdc3d9e
@picnixz
partial_call
233302f
@picnixz
redundant casts
287594e
@picnixz
picnixz force-pushed the chore/fix-usan-failures-partialobject-111178 branch from 080d875 to 287594e Compare September 29, 2024 11:01
@vstinner

vstinner commented Oct 9, 2024

Copy link
Copy Markdown
Member

What's the status of this PR? Why is it a draft?

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz

picnixz commented Oct 11, 2024

Copy link
Copy Markdown
Member Author

What's the status of this PR?

Forgotten :D

Why is it a draft?

I wanted to add the suppression before but since it wouldn't have worked anyway, I can mark it as ready (I'll just check that the warnings for partialobjects indeed disappeared).

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
Merge branch 'main' into chore/fix-usan-failures-partialobject-111178
d8c3c78
@picnixz
picnixz marked this pull request as ready for review October 11, 2024 10:16
@picnixz
picnixz requested a review from rhettinger as a code owner October 11, 2024 10:16
@bedevere-app bedevere-app Bot added the awaiting review label Oct 11, 2024
@picnixz
picnixz requested a review from vstinner October 11, 2024 10:16
@picnixz

picnixz commented Oct 11, 2024

Copy link
Copy Markdown
Member Author

@vstinner Do you want me to add some _PyPartialObject_CAST?

All reactions

Sorry, something went wrong.

Uh oh!

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

vstinner
vstinner reviewed Oct 11, 2024
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.

If you want to fix UBSan issues for partial(), you should patch more methods like: partial_dealloc, partial_repr, partial_traverse, etc.

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner

vstinner commented Oct 11, 2024

Copy link
Copy Markdown
Member

@vstinner Do you want me to add some _PyPartialObject_CAST?

I have mixed feelings about these macros :-) You can add a macro which just do the cast and don't check the type, or don't add the macro. As you want.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
picnixz marked this pull request as draft October 11, 2024 15:56
@bedevere-app bedevere-app Bot removed the awaiting review label Oct 11, 2024
@picnixz

picnixz commented Oct 11, 2024

Copy link
Copy Markdown
Member Author

If you want to fix UBSan issues for partial(), you should patch more methods like: partial_dealloc, partial_repr, partial_traverse, etc.

Oups, I forgot to do it. I think I only checked the warnings thinking that the rest would be reported. I'll do it tomorrow (hence reconverting into a draft).

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
fix remaining functions for partial objects
c6ef8e8
@picnixz
picnixz marked this pull request as ready for review October 12, 2024 09:10
@bedevere-app bedevere-app Bot added the awaiting review label Oct 12, 2024
@picnixz

picnixz commented Oct 12, 2024

Copy link
Copy Markdown
Member Author

I haven't touched the utilities functions since they are not used as callbacks and shouldn't lead to undefined behaviours (e.g., partial_setvectorcall).

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
picnixz requested a review from vstinner October 12, 2024 09:11
vstinner
vstinner approved these changes Oct 14, 2024
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

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 review labels Oct 14, 2024
@vstinner
vstinner merged commit c77121e into python:main Oct 14, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 14, 2024
@vstinner

vstinner commented Oct 14, 2024

Copy link
Copy Markdown
Member

Merged, thanks.

picnixz reacted with hooray 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 chore/fix-usan-failures-partialobject-111178 branch October 14, 2024 14:23
@encukou encukou mentioned this pull request Feb 21, 2025
gh-111178: fix UBSan failures in Modules/_functoolsmodule.c #129778
Merged
encukou pushed a commit that referenced this pull request Feb 21, 2025
@picnixz
gh-111178: fix UBSan failures in Modules/_functoolsmodule.c (GH-129778
4f07fd5
)

Fix UBSan failures for `keyobject`, `lru_list_elem`, `lru_cache_object`.
Suppress unused return values.
Change `_PyPartialObject_CAST` (from #124733) to `partialobject_CAST`
for consistency with the current style for these macros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner approved these changes
@rhettinger rhettinger Awaiting requested review from rhettinger rhettinger is a code owner

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.

2 participants

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