-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
mypyc generates code that triggers a CPython assertion #12605
Comments
This is the root cause of psf/black#2845 |
I wonder if the assertion is checking a valid assumption, but in the wrong place: I wonder if it should be checking whether |
I'm working on this. |
(off-topic) @Fidget-Spinner , while you're here, any chance you're interested in looking at what's going on with the testProtocol mypyc test failure on Python 3.11? It's currently failing with |
@hauntsaninja I'm interested in fixing mypyc C API problems in 3.11. I can't promise anything though :). |
It seems related to python/cpython#92678 |
Thanks Kumar, that's very helpful. |
Crash Report
mypyc
generates code that triggers a CPython assertion when a subclass inherits__call__
from a superclass.To Reproduce
This ends with a segfault as well, but the segfault isn't really interesting -
_PyObject_ASSERT
on failure makes a call to_PyObject_Dump
, which calls intoPyObject_Print
, which fails because we're in the middle ofPyType_Ready
andtp_dict
hasn't been created yet.The assertion error seems to be a genuine bug, though I'm not sure whether it's a bug in CPython or in mypyc. The failing assertion is:
The second of these two assertions fails (the first succeeds). I'm not sure whether the bug is in CPython (perhaps the assertion is wrong, and it's OK to have
tp_call
set to NULL whenPy_TPFLAGS_HAVE_VECTORCALL
is set ifPyType_Ready
will inherittp_call
from the parent class), or whether the bug is in mypyc (perhaps it's not legal to setPy_TPFLAGS_HAVE_VECTORCALL
when inheritingtp_call
).Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: