perlin-network / life

A secure WebAssembly VM catered for decentralized applications.
MIT License
1.7k stars 119 forks source link

Strange misbehaviour in life VM #73

Open singpolyma-shopify opened 5 years ago

singpolyma-shopify commented 5 years ago

https://0x0.st/zcgm.wasm

The above wasm works in nodejs and using wagon's wasm-run command, but running with life I get a different return value.

Calling the exported function run with no arguments should return 4 and in nodejs and wasm-run it does but running under life I get 0.

I know it's a big blob but I have not yet been able to get a smaller version that triggers the bug.

losfair commented 5 years ago

Thanks for reporting the bug!

Could you try with Polymerase engine enabled? There's a known bug in the register allocator for interpreter mode.

singpolyma-shopify commented 5 years ago

That's the AOT mode? When I enable that it takes a looong time and then says "unable to open compiled code"

lowesyang commented 5 years ago

Has this bug solved? Can life be used in production env?

singpolyma-shopify commented 5 years ago

I haven't tested this specific case in awhile, but in general we have had much more luck with AOT (though you can't run it under many Docker setups because of the userfaultfd requirement)