Title: Fix incorrect function signatures in _testmultiphase (UBSan) · Issue #141553 · python/cpython · GitHub
Open Graph Title: Fix incorrect function signatures in _testmultiphase (UBSan) · Issue #141553 · python/cpython
X Title: Fix incorrect function signatures in _testmultiphase (UBSan) · Issue #141553 · python/cpython
Description: 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 *(*)(stru...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/python/cpython/issues/141553
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix incorrect function signatures in _testmultiphase (UBSan)","articleBody":"# Bug report\n\n### Bug description:\n\nUBSan reports errors such as:\n\n\u003cdetails>\u003csummary>modexport_create_string\u003c/summary>\n\u003cp>\n\n```\nObjects/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\n```\n\n\u003c/p>\n\u003c/details> \n\n\u003cdetails>\u003csummary>Py_mod_state_free\u003c/summary>\n\u003cp>\n\n```\nObjects/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\n```\n\n\u003c/p>\n\u003c/details> \n\nThe 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.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-141554\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/ashm-dev","@type":"Person","name":"ashm-dev"},"datePublished":"2025-11-14T12:59:55Z","url":"https://github.com/python/cpython/issues/141553"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:64f6284b-34dd-5ded-c589-94160c6bf92a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A00:3A13A0:2A8536D:39DEA48:6B00519F |
| html-safe-nonce | aedc520918842f30bd85aff28ab86799fb7d3da1feafe199311ebc8f00bb5df7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTAwOjNBMTNBMDoyQTg1MzZEOjM5REVBNDg6NkIwMDUxOUYiLCJ2aXNpdG9yX2lkIjoiNjYyMDIxMDEyMDIzNDEyNzc3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fcd2c8aad9c4bc386197aea93769f099c9c39bdf48b60a88f4bda38f71e22fb6 |
| hovercard-subject-tag | issue:3625518975 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/141553/issue_layout |
| twitter:image | https://opengraph.githubassets.com/118f3bb104a8fcc27adffaa5b60762f07797af2168f6af3f3f7c9596686f108b/python/cpython/issues/141553 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/118f3bb104a8fcc27adffaa5b60762f07797af2168f6af3f3f7c9596686f108b/python/cpython/issues/141553 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ashm-dev |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width