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 — Fix incorrect function signatures in _testmultiphase (UBSan) · Issue #141553 · python/cpython

Fix incorrect function signatures in _testmultiphase (UBSan) #141553

New issue
Copy link
New issue
Copy link
Closed
Closed
Fix incorrect function signatures in _testmultiphase (UBSan)#141553
Copy link
Labels
3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@ashm-dev
ashm-dev
opened on Nov 14, 2025
Issue body actions

Bug report

Bug description:

UBSan reports errors such as:

modexport_create_string

Objects/moduleobject.c:546:13: runtime error: call to function modexport_create_string through pointer to incorrect function type 'struct _object *(*)(struct _object *, struct PyModuleDef *)' /home/shamil/oss/cpython/main/./Modules/_testmultiphase.c:1066:5: note: modexport_create_string defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/moduleobject.c:546:13

Py_mod_state_free

Objects/moduleobject.c:1101:9: runtime error: call to function modexport_smoke_free through pointer to incorrect function type 'void (*)(void *)' /home/shamil/oss/cpython/main/./Modules/_testmultiphase.c:974: note: modexport_smoke_free defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/moduleobject.c:1101:9

The functions assigned to Py_mod_state_free and modexport_create_string use incorrect signatures, causing calls through mismatched function pointer types and leading to undefined behavior.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

  • gh-141553: Fix incorrect function signatures in _testmultiphase #141554
Reacted by Mikhail Efimov and Sergey Miryanov

Activity

  1. ashm-dev
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Nov 14, 2025
  2. mohsinm-dev commented on Nov 14, 2025

    @mohsinm-dev
    mohsinm-dev
    on Nov 14, 2025
    Contributor
    More actions

    @ashm-dev I was working on the same fix.

  3. ashm-dev commented on Nov 14, 2025

    @ashm-dev
    ashm-dev
    on Nov 14, 2025
    ContributorAuthor
    More actions

    @mohsinm-dev I already have a fix)

    Reacted by Mohsin Mehmood
  4. StanFromIreland
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Nov 14, 2025
  5. picnixz commented on Nov 14, 2025

    @picnixz
    picnixz
    on Nov 14, 2025
    Member
    More actions

    I am surprised that this was not caught when this was introduced.

    Reacted by Shamil
  6. picnixz
    added
    3.15bugs and security fixesbugs and security fixes
    on Nov 15, 2025
  7. picnixz
    added a commit that references this issue on Nov 15, 2025

    gh-141553: Fix incorrect function signatures in `_testmultiphase` (#1…

    85f3009
  8. picnixz commented on Nov 15, 2025

    @picnixz
    picnixz
    on Nov 15, 2025
    Member
    More actions

    Thanks for the report & fix!

    Reacted by Mikhail Efimov
    Reacted by Shamil
  9. picnixz
    closed this as completedon Nov 15, 2025
  10. StanFromIreland
    added a commit that references this issue on Dec 6, 2025

    pythongh-141553: Fix incorrect function signatures in `_testmultiphas…

    90c2983
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.