Skip to content

The string representation of the asyncio object results in 'panicked'. #4859

Description

@xiaxinmeng

The following code defines an asynchronous function goo that takes two arguments a and b. The asyncio.create_task() function is then used inside the main function to create a task object that represents the execution of the goo coroutine with arguments 1 and b=1. Finally, the repr() function obtains a string representation of the task object. The asyncio.run() function runs the main coroutine and execute the task. The code essentially creates and runs an empty task while RustPython gets crashing.

import asyncio

async def goo(a, b): pass

async def main():
    task = asyncio.create_task(goo(1, b=1))
    print(repr(task))

asyncio.run(main())

Crash message:

thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 18446744073709551615', vm/src/frame.rs:169:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Environment:
Ubuntu 18.04
rustpython v0.2.0

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

    A-vmArea: virtual machineC-bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions