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

Mismatched C function signature in _xxsubinterpreters.channel_close() #77635

Closed
serhiy-storchaka opened this issue May 10, 2018 · 3 comments
Closed
Labels
3.8 only security fixes extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 33454
Nosy @ericsnowcurrently, @serhiy-storchaka, @siddhesh
PRs
  • bpo-33454: Fix arguments parsing in _xxsubinterpreters.channel_close(). #6747
  • 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 = None
    closed_at = <Date 2018-05-23.05:17:46.943>
    created_at = <Date 2018-05-10.10:17:56.494>
    labels = ['extension-modules', 'type-bug', '3.8']
    title = 'Mismatched C function signature in _xxsubinterpreters.channel_close()'
    updated_at = <Date 2018-05-23.05:17:46.941>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-05-23.05:17:46.941>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-05-23.05:17:46.943>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules']
    creation = <Date 2018-05-10.10:17:56.494>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33454
    keywords = ['patch']
    message_count = 3.0
    messages = ['316354', '316734', '316742']
    nosy_count = 3.0
    nosy_names = ['eric.snow', 'serhiy.storchaka', 'siddhesh']
    pr_nums = ['6747']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue33454'
    versions = ['Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    The C function that implements _xxsubinterpreters.channel_close() is defined with the signature

    PyObject *channel_close(PyObject *self, PyObject *args, PyObject *kwds)
    

    which corresponds the method convention METH_VARARGS | METH_KEYWORDS, but is used with the incompatible method convention METH_VARARGS. Either the signature or flags are not correct.

    Actually it can use just METH_O. The proposed PR changes both signature and flags and simplifies the implementation.

    The bug was found thanks to gcc 8 emitting a warning for invalid function cast (it also emits a lot of false alarms). See also bpo-33012.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life 3.8 only security fixes extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels May 10, 2018
    @ericsnowcurrently
    Copy link
    Member

    Thanks for catching this, Serhiy! I've approved the PR.

    @serhiy-storchaka
    Copy link
    Member Author

    New changeset d8dcd57 by Serhiy Storchaka in branch 'master':
    bpo-33454: Fix arguments parsing in _xxsubinterpreters.channel_close(). (GH-6747)
    d8dcd57

    @serhiy-storchaka serhiy-storchaka removed the 3.7 (EOL) end of life label May 23, 2018
    @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.8 only security fixes extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants