-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
BUG: flexible inheritance segfault #24358
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
Conversation
Looks like |
It seems indeed that test should be skipped on PyPy.There is a 5 year old issue about this problem |
* Fixes numpy#23737 * based on the discussion in the issue above, this completely blocks subclassing `np.flexible` at the Python level and adds a test to ensure the segfault codepath is no longer accessible
4570f1f
to
aa9b23d
Compare
@@ -4122,7 +4122,7 @@ initialize_numeric_types(void) | |||
|
|||
/**begin repeat | |||
* #NAME= Number, Integer, SignedInteger, UnsignedInteger, Inexact, | |||
* Floating, ComplexFloating, Flexible, Character# | |||
* Floating, ComplexFloating, Character# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seberg none of these others are abstract base classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are, but I suspect flexible
is the only one implementing things that cannot be inherited. Maybe that is the bigger problem really, but I guess this is also OK.
Thanks @tylerjereddy |
This is causing problems after I fixed the PyPy flag handling, since CharacterArrType inherits from flexible here
Why does CPython allow that? |
CPython doesn't check this at all for C types I think. |
Wow, that is weird. But OK, I think I can make PyPy mimic that behaviour. Disallowing inheritance for numpy.flexible doesn't seem right, it is meant to be a base class. Is this really the best solution for the problem being solved here? |
Yah, sorry, I don't really feel this is terrible, but instead let's just delete code and burn down |
Fixes BUG: Stack overflow on double inheritance from numpy.flexible and numpy.ma.core.MaskedArray #23737
based on the discussion in the issue above, this completely blocks subclassing
np.flexible
at the Python level and adds a test to ensure the segfault codepath is no longer accessible