This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _zoneinfo module_free has invalid function signature
Type: crash Stage: resolved
Components: Extension Modules Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: christian.heimes, kumaraditya, miss-islington, p-ganssle, vstinner
Priority: normal Keywords: patch

Created on 2022-01-14 19:51 by christian.heimes, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30607 merged christian.heimes, 2022-01-14 19:56
PR 30610 merged miss-islington, 2022-01-15 08:52
PR 30611 merged kumaraditya, 2022-01-15 09:35
Messages (4)
msg410594 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2022-01-14 19:51
The zoneinfo C extension has the "freefunc m_free" function with signature "static void module_free(void)". The signature of freefunc is "void (*freefunc)(void *)". It takes a void * argument, but module_free() does not.

The signature mismatch is not a problem for most C compilers. But Web Assembly is more strict. wasm32-emscripten fails and aborts at runtime:

worker.js onmessage() captured an uncaught exception: RuntimeError: function signature mismatch
Pthread 0x8a1df0 sent an error! undefined:undefined: function signature mismatch

/python-wasm/cpython/builddir/node/python.js:158
   throw ex;
   ^
Error [RuntimeError]: function signature mismatch
    at module_dealloc (<anonymous>:wasm-function[1883]:0x9a15e)
    at _Py_Dealloc (<anonymous>:wasm-function[1959]:0x9eabe)
    at insertdict (<anonymous>:wasm-function[1624]:0x87ccb)
    at _PyDict_SetItem_Take2 (<anonymous>:wasm-function[1622]:0x8749c)
    at dict_ass_sub (<anonymous>:wasm-function[1708]:0x8e604)
    at PyObject_SetItem (<anonymous>:wasm-function[486]:0x34221)
    at finalize_modules (<anonymous>:wasm-function[3644]:0x1703d0)
    at Py_FinalizeEx (<anonymous>:wasm-function[3641]:0x16f986)
    at Py_RunMain (<anonymous>:wasm-function[4055]:0x191124)
    at pymain_main (<anonymous>:wasm-function[4058]:0x19174d)
Emitted 'error' event on process instance at:
    at emitUnhandledRejectionOrErr (internal/event_target.js:579:11)
    at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:403:9)
    at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)
msg410631 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2022-01-15 08:52
New changeset cfbde65df318eea243706ff876e5ef834c085e5f by Christian Heimes in branch 'main':
bpo-46383: Fix signature of zoneinfo module_free function (GH-30607)
https://github.com/python/cpython/commit/cfbde65df318eea243706ff876e5ef834c085e5f
msg410785 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-17 13:47
New changeset 7a822c92782ffda8fa32a4b30a95b9de7cc1b8e6 by Miss Islington (bot) in branch '3.10':
bpo-46383: Fix signature of zoneinfo module_free function (GH-30607) (GH-30610)
https://github.com/python/cpython/commit/7a822c92782ffda8fa32a4b30a95b9de7cc1b8e6
msg411246 - (view) Author: miss-islington (miss-islington) Date: 2022-01-22 11:05
New changeset 3e7d06a1fa2102723314552b37410d11fefa928a by Kumar Aditya in branch '3.9':
[3.9] bpo-46383: Fix signature of zoneinfo module_free function (GH-3… (GH-30611)
https://github.com/python/cpython/commit/3e7d06a1fa2102723314552b37410d11fefa928a
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90541
2022-01-22 11:06:43christian.heimessetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-22 11:05:59miss-islingtonsetmessages: + msg411246
2022-01-17 13:47:54vstinnersetnosy: + vstinner
messages: + msg410785
2022-01-15 09:35:42kumaradityasetnosy: + kumaraditya
pull_requests: + pull_request28813
2022-01-15 08:52:31miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request28812
2022-01-15 08:52:27christian.heimessetmessages: + msg410631
2022-01-14 19:57:36christian.heimeslinkissue40280 dependencies
2022-01-14 19:56:41christian.heimessetkeywords: + patch
stage: patch review
pull_requests: + pull_request28807
2022-01-14 19:51:10christian.heimescreate