Open
Description
I use Rustpython in wasm/browser. When I try to call some async code, using asyncweb.run
, I get:
Python execute error RangeError: Maximum call stack size exceeded
at rustpython_vm::frame::ExecutingFrame::run::h2212cc95fc9e76c4 (99bfee08c93c30b2ecda.module.wasm:0x1073a5)
at rustpython_vm::frame::<impl rustpython_vm::object::core::Py<rustpython_vm::frame::Frame>>::run::{{closure}}::h1bf9c4d53f957c20 (99bfee08c93c30b2ecda.module.wasm:0x16fa7af)
at rustpython_vm::frame::<impl rustpython_vm::object::core::Py<rustpython_vm::frame::Frame>>::run::h453c69dd489a7212 (99bfee08c93c30b2ecda.module.wasm:0x9948ca)
at rustpython_vm::vm::VirtualMachine::run_frame::{{closure}}::hd99dd8015d565ea3 (99bfee08c93c30b2ecda.module.wasm:0x13fdfeb)
at rustpython_vm::vm::VirtualMachine::with_frame::{{closure}}::hadcd7daa9130f321 (99bfee08c93c30b2ecda.module.wasm:0xfb40a4)
at rustpython_vm::vm::VirtualMachine::with_recursion::h5bde1c2cc3eb071f (99bfee08c93c30b2ecda.module.wasm:0xc494b1)
at rustpython_vm::vm::VirtualMachine::with_frame::hd7b74d4c39a77d3d (99bfee08c93c30b2ecda.module.wasm:0x14debaa)
at rustpython_vm::builtins::function::PyFunction::invoke_with_locals::hd8e8780c1fd8e9f3 (99bfee08c93c30b2ecda.module.wasm:0x367427)
at <rustpython_vm::builtins::function::PyFunction as rustpython_vm::types::slot::Callable>::call::hd74177bd61241180 (99bfee08c93c30b2ecda.module.wasm:0x13c6c5c)
at rustpython_vm::types::slot::Callable::slot_call::h45b59239eb3b5451 (99bfee08c93c30b2ecda.module.wasm:0x4d7108)
This error probably occurs at the line with import asyncweb
.
After that it's possible to run code again but from this moment it's gives:
AttributeError: module 'asyncweb' has no attribute 'run'
and print(dir(asyncweb))
returns ['Promise', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__']
Worst thing that sometime(on first run) it works ok.
Bet If I reload page for example cmd+R, asyncweb become totally broken and impossible to get it working even with cmd+shift+R
Such behaviour also noticeable in rustpython/demo example too. To reproduce:
- Select asyncweb preset from dropdown.
- Launch it
- Try reload page cmd+R(prob, without awaiting result)
- Retry step 1 and you probably catch bug.