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: remove redundant casts for functions with correct signatures by picnixz · Pull Request #131673 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Mar 24, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This is a cleanup PR but it's easier to hunt non-covered possible UBSans

  • 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
picnixz added 15 commits March 24, 2025 13:16
@picnixz
remove un-necessary casts to PyCFunction
70861ec
@picnixz
remove un-necessary casts to getter
d356465
@picnixz
remove un-necessary casts to setter
f641773
@picnixz
remove un-necessary casts for initproc
a197210
@picnixz
add TODO note to remove casts to destructor
5a39cb7
@picnixz
un-necessary cast for module free functions
222b662
@picnixz
fixup: None and NoneType
ad434c0
@picnixz
fixup: _PyDictViewObject
2fea60f
@picnixz
fixup: bool_invert
47bc0ee
@picnixz
fixup: PyUnicodeObject methods
a894c4c
@picnixz
fixup: rangeobject
1c17bfc
@picnixz
fixup: zoneinfo_init_subclass
e415739
@picnixz
fixup: ga_iter
86bc47c
@picnixz
fixup: hamt_baseiter_tp_iternext
5d98a84
@picnixz
remove dead code
1053101
@picnixz picnixz added the skip news label Mar 24, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Mar 24, 2025
UBSan: Calling a function through pointer to incorrect function type is undefined behavior #111178
Closed
@picnixz
Merge branch 'main' into fix/ubsan/casts-111178
5e68e29
@picnixz

picnixz commented Mar 24, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Very interesting. I locally had an issue where my make command hangs (which is the case here) but I still don't know why this happens.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
Merge branch 'main' into fix/ubsan/casts-111178
937aa63
picnixz
picnixz commented Mar 24, 2025
View reviewed changes
Comment thread Include/cpython/object.h Resolved

Uh oh!

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

@picnixz
Update Include/cpython/object.h
9c780ad
@picnixz

picnixz commented Mar 24, 2025

Copy link
Copy Markdown
Member Author

I think it know what happened! I incorrectly merged main into this branch c:

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
Merge remote-tracking branch 'upstream/main' into fix/ubsan/casts-111178
3124512
@picnixz
picnixz marked this pull request as ready for review March 30, 2025 09:07
@picnixz
picnixz requested review from ammaraskar, corona10, ericsnowcurrently, markshannon and rhettinger as code owners March 30, 2025 09:07
@picnixz
picnixz requested review from 1st1, asvetlov, kumaraditya303 and willingc as code owners March 30, 2025 09:07
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 30, 2025
@picnixz
fixup comments
92d648e
@picnixz
picnixz requested review from vstinner and removed request for 1st1, ammaraskar, asvetlov, corona10, ericsnowcurrently, kumaraditya303, markshannon, methane, rhettinger and willingc March 30, 2025 09:11
@picnixz
Merge branch 'main' into fix/ubsan/casts-111178
25c2a3f
vstinner
vstinner reviewed Apr 1, 2025
View reviewed changes
Comment thread Modules/faulthandler.c Resolved

Uh oh!

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

Comment thread Python/ceval.c Resolved

Uh oh!

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

Comment thread Include/cpython/object.h Resolved

Uh oh!

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

@picnixz @vstinner
Update Modules/faulthandler.c
4bf2a1e
Co-authored-by: Victor Stinner <[email protected]>
picnixz
picnixz commented Apr 1, 2025
View reviewed changes
Comment thread Include/cpython/object.h Resolved

Uh oh!

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

Comment thread Python/ceval.c Resolved

Uh oh!

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

picnixz added 2 commits April 1, 2025 15:45
@picnixz
Update Include/cpython/object.h
db5dae1
@picnixz
Update Python/ceval.c
6cfed6c
vstinner
vstinner approved these changes Apr 1, 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

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 Apr 1, 2025
@picnixz
picnixz merged commit edbf7fb into python:main Apr 1, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 1, 2025
@picnixz
picnixz deleted the fix/ubsan/casts-111178 branch April 1, 2025 15:18
@bedevere-bot

bedevere-bot commented Apr 1, 2025

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 FreeBSD Refleaks 3.x (tier-3) has failed when building commit edbf7fb.

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/1613/builds/1061) and take a look at the build logs.
  4. Check if the failure is related to this commit (edbf7fb) 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/1613/builds/1061

Failed tests:

  • test.test_concurrent_futures.test_interpreter_pool

Failed subtests:

  • test_map_buffersize - test.test_concurrent_futures.test_interpreter_pool.InterpreterPoolExecutorTest.test_map_buffersize

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/test/test_concurrent_futures/executor.py", line 100, in test_map_buffersize
    res = self.executor.map(str, ints, buffersize=buffersize)
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/_base.py", line 614, in map
    fs = collections.deque(
        self.submit(fn, *args) for args in islice(zipped_iterables, buffersize)
    )
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/_base.py", line 615, in <genexpr>
    self.submit(fn, *args) for args in islice(zipped_iterables, buffersize)
    ~~~~~~~~~~~^^^^^^^^^^^
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/thread.py", line 202, in submit
    raise self.BROKEN(self._broken)
concurrent.futures.interpreter.BrokenInterpreterPool: A thread initializer failed, the thread pool is not usable anymore


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/thread.py", line 99, in _worker
    ctx.initialize()
    ~~~~~~~~~~~~~~^^
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/interpreter.py", line 132, in initialize
    self.interpid = _interpreters.create(reqrefs=True)
                    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
interpreters.InterpreterError: interpreter creation failed


Traceback (most recent call last):
  File "<frozen getpath>", line 358, in <module>
ValueError: embedded null byte
Exception in initializer:
RuntimeError: error evaluating path


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/test/support/__init__.py", line 814, in gc_collect
    gc.collect()
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('127.0.0.1', 40376), raddr=('127.0.0.1', 40377)>
Task was destroyed but it is pending!
task: <Task pending name='Task-1035' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /buildbot/buildarea/3.x.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 0x841c2f290>:
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.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=8>
k


Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/thread.py", line 99, in _worker
    ctx.initialize()
    ~~~~~~~~~~~~~~^^
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/interpreter.py", line 132, in initialize
    self.interpid = _interpreters.create(reqrefs=True)
                    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
interpreters.InterpreterError: interpreter creation failed
Timeout (0:45:00)!
Thread 0x000000082e37b000 (most recent call first):
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/concurrent/futures/thread.py", line 116 in _worker
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/threading.py", line 996 in run
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/threading.py", line 1054 in _bootstrap_inner
  File "/buildbot/buildarea/3.x.ware-freebsd.refleak/build/Lib/threading.py", line 1016 in _bootstrap
All reactions

Sorry, something went wrong.

Uh oh!

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

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

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

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