classification
Title: Mismatched C function signature in _xxsubinterpreters.channel_close()
Type: behavior Stage: patch review
Components: Extension Modules Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.snow, serhiy.storchaka, siddhesh
Priority: normal Keywords: patch

Created on 2018-05-10 10:17 by serhiy.storchaka, last changed 2018-05-15 22:08 by serhiy.storchaka.

Pull Requests
URL Status Linked Edit
PR 6747 merged serhiy.storchaka, 2018-05-10 10:20
Messages (3)
msg316354 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-10 10:17
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 issue33012.
msg316734 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2018-05-15 21:39
Thanks for catching this, Serhiy!  I've approved the PR.
msg316742 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-15 22:08
New changeset d8dcd57edb88ce57063e5c2b85fe0ee1abb1ce8b by Serhiy Storchaka in branch 'master':
bpo-33454: Fix arguments parsing in _xxsubinterpreters.channel_close(). (GH-6747)
https://github.com/python/cpython/commit/d8dcd57edb88ce57063e5c2b85fe0ee1abb1ce8b
History
Date User Action Args
2018-05-15 22:08:11serhiy.storchakasetmessages: + msg316742
2018-05-15 21:39:06eric.snowsetmessages: + msg316734
2018-05-10 10:20:15serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request6435
2018-05-10 10:17:56serhiy.storchakacreate