Skip to content

Infinity recursion with a malicious finalizer #141170

@sergey-miryanov

Description

@sergey-miryanov

Bug report

Bug description:

For the following example CPython runs infinitely (at least on my Windows build)

def test():
    class Wrong:
        def __del__(self):
            Wrong()

    Wrong()

test()

It works infinitely because of the trashcan mechanism. Should we address this, or should we consider it as another example of CPython VM abuse?

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions