Skip to content

Runaway recursion with keyword arguments in 3.14 #137883

Closed

Description

@jrivers0

Bug report

Bug description:

def f(a=0):
    f(a=0)
f()

This code causes an infinite loop (until it runs out of memory) in Python 3.14. It raises RecursionError in Python 3.13. There is no problem when calling the function without a keyword argument; in that case, it also raises RecursionError as expected.

CPython versions tested on:

3.13, 3.14, CPython main branch

Operating systems tested on:

macOS

Linked PRs

Activity

  1. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    3.14bugs and security fixes
    3.15bugs and security fixes
    on Aug 17, 2025
  2. StanFromIreland commented on Aug 17, 2025

    @StanFromIreland
    Member

    I think we can classify this as a crash, since there is no error, I had to kill it manually. WDYT @picnixz ?

  3. StanFromIreland commented on Aug 17, 2025

    @StanFromIreland
  4. adqm commented on Aug 17, 2025

    @adqm
    Contributor

    This bisects to c13e7d9

  5. StanFromIreland commented on Aug 17, 2025

    @StanFromIreland
    Member
  6. ZeroIntensity commented on Aug 17, 2025

    @ZeroIntensity
    Member

    This looks pretty critical, considering it's in the core interpreter. We should deal with this before 3.14.0, or at least come to a decision before then.

    I think we can classify this as a crash, since there is no error, I had to kill it manually.

    I think that "bug" is fine. "crash" should be reserved for signals that come from the C code.

  7. added a commit that references this issue on Aug 19, 2025
  8. added 2 commits that reference this issue on Aug 19, 2025
  9. added a commit that references this issue on Aug 19, 2025
  10. added a commit that references this issue on Aug 25, 2025
  11. added a commit that references this issue on Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixes3.15bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions