tetratelabs / wazero

wazero: the zero dependency WebAssembly runtime for Go developers
https://wazero.io
Apache License 2.0
4.95k stars 259 forks source link

Programs that succeed to execute with v1.6.0 sometimes hang indefinitely with v1.8.1 during instantiation. #2340

Open davidmdm opened 4 hours ago

davidmdm commented 4 hours ago

Describe the bug Programs that succeed to execute with v1.6.0 sometimes hang indefinitely with v1.8.1 during instantiation. The same program crashes with v1.7.x

To Reproduce Clone the example repository:

git clone https://github.com/davidmdm/wzbug.git
cd ./wzbug
./test.sh

Expected behavior Program should behave the same as with the v1.6.0 runtime.

Environment (please complete the relevant information):

Additional context

Incredibly rare and difficult to reproduce. If I tweak the example program slightly, the bug disappears. If I don't use stdin the bug disappears. However I don't want to write programs fearing that the perfect storm will hang my execution.

evacchi commented 3 hours ago

If I don't use stdin the bug disappears.

that's really useful, I wonder if that bug lies there entirely 🤔 stdin has a special treatment, especially in poll_oneoff, and when used interactively

mathetake commented 3 hours ago

relevant to https://github.com/tetratelabs/wazero/issues/2178 ?

davidmdm commented 3 hours ago

@evacchi here is an incomplete list of weird things which have made the program succeed.

However if I parse stdin using the yaml decoder from k8s and use that data it hangs.