Skip to content

Long parameter lists cause core dumped #4858

Closed

Description

@xiaxinmeng

If a function takes long parameter lists, the rustpython reports a core dumped

test.py

def f(*args): return len(args)
f(*([0]*(2**32+1)))

Crash message:

memory allocation of 34359738376 bytes failed
Aborted (core dumped)

Environment:
Ubuntu 18.04
rustpython v0.2.0

Activity

  1. DimitrisJim commented on Apr 6, 2023

    @DimitrisJim
    Member

    Thanks, this is basically a duplicate of #3494. With fallible allocations, we should be able to make this raise a MemoryError in the same way CPython does.

    (Note that this isn't an issue with the fact that it is an arg but just the fact that we try to allocate something so large).

    Thanks again for opening these issues, even if some are duplicate.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions