Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_zoneinfo module_free has invalid function signature #90541

Closed
tiran opened this issue Jan 14, 2022 · 4 comments
Closed

_zoneinfo module_free has invalid function signature #90541

tiran opened this issue Jan 14, 2022 · 4 comments
Assignees
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@tiran
Copy link
Member

tiran commented Jan 14, 2022

BPO 46383
Nosy @vstinner, @tiran, @pganssle, @miss-islington, @kumaraditya303
PRs
  • bpo-46383: Fix signature of zoneinfo module_free function (GH-30607) #30607
  • [3.10] bpo-46383: Fix signature of zoneinfo module_free function (GH-30607) #30610
  • [3.9] bpo-46383: Fix signature of zoneinfo module_free function (GH-3… #30611
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tiran'
    closed_at = <Date 2022-01-22.11:06:43.702>
    created_at = <Date 2022-01-14.19:51:10.207>
    labels = ['extension-modules', '3.10', '3.9', 'type-crash', '3.11']
    title = '_zoneinfo module_free has invalid function signature'
    updated_at = <Date 2022-01-22.11:06:43.702>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2022-01-22.11:06:43.702>
    actor = 'christian.heimes'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2022-01-22.11:06:43.702>
    closer = 'christian.heimes'
    components = ['Extension Modules']
    creation = <Date 2022-01-14.19:51:10.207>
    creator = 'christian.heimes'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46383
    keywords = ['patch']
    message_count = 4.0
    messages = ['410594', '410631', '410785', '411246']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'christian.heimes', 'p-ganssle', 'miss-islington', 'kumaraditya']
    pr_nums = ['30607', '30610', '30611']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue46383'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @tiran
    Copy link
    Member Author

    tiran commented Jan 14, 2022

    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)

    @tiran tiran added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jan 14, 2022
    @tiran tiran self-assigned this Jan 14, 2022
    @tiran tiran added extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Jan 14, 2022
    @tiran tiran self-assigned this Jan 14, 2022
    @tiran tiran added extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump labels Jan 14, 2022
    @tiran
    Copy link
    Member Author

    tiran commented Jan 15, 2022

    New changeset cfbde65 by Christian Heimes in branch 'main':
    bpo-46383: Fix signature of zoneinfo module_free function (GH-30607)
    cfbde65

    @vstinner
    Copy link
    Member

    New changeset 7a822c9 by Miss Islington (bot) in branch '3.10':
    bpo-46383: Fix signature of zoneinfo module_free function (GH-30607) (GH-30610)
    7a822c9

    @miss-islington
    Copy link
    Contributor

    New changeset 3e7d06a by Kumar Aditya in branch '3.9':
    [3.9] bpo-46383: Fix signature of zoneinfo module_free function (GH-3… (GH-30611)
    3e7d06a

    @tiran tiran closed this as completed Jan 22, 2022
    @tiran tiran closed this as completed Jan 22, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants