Skip to content

Multi-line arguments in a function call crashes CPython #101928

Description

@xiaxinmeng

Crash report

In a function call, if one argument is split in two lines, CPython crashes. For example, we split the lambda expression, i.e., lamda_exp=lambda:1, in test2.py into two lines (See test1.py) . CPython reports a segmentation fault.

This crash just occurs on the latest main branch(e.g.commit a1f08f5, 8a2b7ee ). The older version of CPython(e.g. CPython 3.10.8, CPython 3.9.0 ) does not report any crash.

test1.py (Segmentation fault)

def foo(param, lambda_exp):
    pass

foo(param=0,
    lambda_exp=lambda:
    1)

test2.py (work well )

def foo(param, lambda_exp):
    pass

foo(param=0,
    lambda_exp=lambda:1)

Error messages

Segmentation Fault

Your environment

  • CPython versions tested on: main branch from GitHub (commit a1f08f5)
  • Operating system and architecture: Ubuntu 18.04

Linked PRs

Activity

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.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions