Skip to content

Conversation

@gpshead
Copy link
Member

@gpsheadgpshead 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
MemberAuthor

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.

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

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

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

Labels

awaiting core reviewDO-NOT-MERGEneeds backport to 3.10only security fixestype-bugAn unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@gpshead@the-knights-who-say-ni@bedevere-bot