Skip to content

Conversation

@gpshead
Copy link
Member

@gpshead gpshead commented Oct 18, 2021

issubclass() could crash due to infinite recursion on the values user supplied code emits for __bases__.

https://bugs.python.org/issue30570

@gpshead
Copy link
Member Author

gpshead commented Oct 18, 2021

While this appears to work, I'd like to see the python benchmark suite run with it to make sure it doesn't have a notable performance impact. there are faster implementation alternatives. even just storing the visited pointers in a linear C array that we realloc when it needs to grow and doing a linear search in that or keeping it sorted for faster than O(n) lookup would be sufficient and waay less complex than using the PySet code.

@gpshead gpshead changed the title bpo-30570: fix an issubclass infinite recurision crash bpo-30570: fix an issubclass infinite recursion crash Oct 18, 2021
@gpshead gpshead added needs backport to 3.10 only security fixes type-bug An unexpected behavior, bug, or error labels Oct 18, 2021
@gpshead
Copy link
Member Author

gpshead commented Oct 22, 2021

#29048 is much simpler and nicer than this one. closing. :)

@gpshead gpshead closed this Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review DO-NOT-MERGE needs backport to 3.10 only security fixes type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants