bytecodealliance / componentize-py

Apache License 2.0
136 stars 13 forks source link

time.sleep sleeps indefinitely #29

Closed dicej closed 11 months ago

dicej commented 11 months ago

For example, when targeting the wasi:cli command world:

from hello import exports
from time import sleep

class Run(exports.Run):
    def run(self):
        print("Hello, world!")
        sleep(0.00001)

The above prints "Hello, world!" and then seems to sleep forever.

dicej commented 11 months ago

Actually, this seems non-deterministic, i.e. it sometimes blocks forever and sometimes not at all. Someone on MacOS reported that it either doesn't block at all or traps with an integer or floating point overflow error.

dicej commented 11 months ago

This is addressed by https://github.com/bytecodealliance/wasmtime/pull/6993

dicej commented 11 months ago

This was a bug in wasmtime-wasi and will be fixed in Wasmtime 13, to be released soon.