Closed singpolyma-shopify closed 5 years ago
Should be fixed in a35232cc
.
Testing latest master
from here does not resolve the issue for me. For now I am using this: https://github.com/singpolyma-shopify/life/commit/fbda4000ae9d2e31666cfd1363ee6898105b17f2
The VM no longer returns every 10000 instructions, but only when gas limit exceeded or an import is called. The commit a35232cc
should have fixed the gas limit check issue.
It's suggested that you use gas limit for limiting execution cycles.
Let me know whether the gas limit check in latest master works for you.
I tried master
and set GasLimit
to 1
and a trivial infinite loop still ran forever.
I tried with the following code:
(module
(func $app_main (export "app_main") (result i32)
(loop
br 0
)
(unreachable)
)
)
with GasLimit set to 1 and gas policy compiler.SimpleGasPolicy{GasPerInstruction:1}
. It terminates correctly. Could you post your code here?
I forgot to set gas policy on this time trying. My bad, working now. Thanks!
As far as I can tell, this is just not true. It only returns on exit/error or gas limit exceeded. And a trivial infinite loop (
jmp
over and over) never triggers the gas limit check. This means there is no way to prevent a VM from being tied up forever by an infinite loop.