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
Pathological case segmentation fault in issubclass #39695
Comments
This works for the PowerPC Python compiled with gcc 3.3 Here's how to make it segment fault: x = (basestring,)
for i in xrange(0, 1000000):
x = (x,)
issubclass(str, x) At least, it segment faults at the interactive prompt |
Logged In: YES I forgot this: Python 2.3.2 (#1, Dec 4 2003, 09:13:58) |
Logged In: YES If you look at Object/abstract.c (line 2119 or so) for 2.4 CVS you Obvious solution is to put in a check that the argument about to be |
Logged In: YES Well, I think any case where the system segment faults Personally, I think that issubclass should either have a The reason I made this test is that I read the description |
Logged In: YES Yes, this needs to be fixed if it *can* be fixed without heroic Brett, the missing piece of your worldview <wink> here is that BTW, if issubclass() has this insecurity, I bet isinstance() |
Logged In: YES OK, consider my worldview fixed. =) I will add a check in the tuple unpacking 'for' loop to make sure it And I will take a look at isinstance, although this tuple feature was And I will backport it. |
Logged In: YES I'm afraid that changing semantics needs to be run through |
Logged In: YES I have appended a file that adds a basic test to make sure that Have a look and if someone will sign off on it I will apply the patch And I just realized I left out a Misc/NEWS in the patch; it will be |
Logged In: YES Oh, Brett, you're missing a chance for some fun here! A bug |
Logged In: YES OK, Tim, start hopping. =) |
Logged In: YES Well, that wasn't as much fun for you as I hoped -- the |
Logged In: YES Have a patch for Python 2.3 that limits the depth of the tuples to the |
Logged In: YES Fixed in both Python 2.3 and 2.4 so that the depth of the tuple cannot |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: