Stream: git-wasmtime

Topic: wasmtime / issue #3660 Unexpected behavior when running R...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2022 at 06:52):

KernelErr labeled issue #3660:

Test Case

rustpython.wasm.zip

Compiled RustPython.

Steps to Reproduce

Input any wrong python syntax like:

![image](https://user-images.githubusercontent.com/45716019/148503714-2a11531e-848b-4196-b26d-aee79a12dded.png)

Expected Results

There should be a Python error pointing out a syntax error.

Actual Results

Syntax errors could not be printed out in time.

Versions and Environment

Wasmtime version or commit: 0.33.0

Operating system: Linux

Architecture: amd64

Extra Info

On other runtimes, there could be current output.

![image](https://user-images.githubusercontent.com/45716019/148503910-48c4cfc3-3df2-4d60-a028-9527a3ee8d4f.png)

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2022 at 06:52):

KernelErr opened issue #3660:

Test Case

rustpython.wasm.zip

Compiled RustPython.

Steps to Reproduce

Input any wrong python syntax like:

![image](https://user-images.githubusercontent.com/45716019/148503714-2a11531e-848b-4196-b26d-aee79a12dded.png)

Expected Results

There should be a Python error pointing out a syntax error.

Actual Results

Syntax errors could not be printed out in time.

Versions and Environment

Wasmtime version or commit: 0.33.0

Operating system: Linux

Architecture: amd64

Extra Info

On other runtimes, there could be current output.

![image](https://user-images.githubusercontent.com/45716019/148503910-48c4cfc3-3df2-4d60-a028-9527a3ee8d4f.png)

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2022 at 06:53):

KernelErr edited issue #3660:

Test Case

rustpython.wasm.zip

Compiled RustPython.

Steps to Reproduce

Input any wrong python syntax like:

![image](https://user-images.githubusercontent.com/45716019/148503714-2a11531e-848b-4196-b26d-aee79a12dded.png)

Expected Results

There should be a syntax error right after the wrong line.

Actual Results

Syntax errors could not be printed out in time.

Versions and Environment

Wasmtime version or commit: 0.33.0

Operating system: Linux

Architecture: amd64

Extra Info

On other runtimes, there could be correct output.

![image](https://user-images.githubusercontent.com/45716019/148503910-48c4cfc3-3df2-4d60-a028-9527a3ee8d4f.png)

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2022 at 15:39):

alexcrichton commented on issue #3660:

Thanks for the report, are you able to share the source for how this module was built? Testing locally it appears that Wasmtime is doing the right thing with respect to the WASI API calls made. It may be a difference in WASI behavior between runtimes, though, causing this issue.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2022 at 15:56):

KernelErr commented on issue #3660:

Hi, I am using code from RustPython's pr 3514(https://github.com/RustPython/RustPython/pull/3514). That's because I opened issue 3513 for it.

After cloning the RustPython repo, I used GitHub CLI to checkout the pr and ran the following command to build:

cargo build --release --target wasm32-wasi --features="freeze-stdlib"

I built it again, and the problem still exists.

![image](https://user-images.githubusercontent.com/45716019/148570101-54e0332a-40a5-4e20-a8a2-157c87ff18fc.png)

view this post on Zulip Wasmtime GitHub notifications bot (Jan 07 2022 at 21:43):

alexcrichton commented on issue #3660:

cc @sunfishcode and @pchickey, this all boils down to isatty({0,1,2}) which is a mixture of:

It looks like the rustpython.wasm is differing its behavior based on whether the stdin/stdout/stderr are a tty, and that basically affects buffering which means that the error being expected here is buffered to be printed later. The test for isatty in wasi-libc needs two modifications in wasi-common to clear checks, one being changing Unknown to something not-unknown, and another being removing rights from the stdio descriptors.

I don't really know where the bug here is. A lot of this is basically legacy I think and there's not really a crisp-and-clear definition of what everything should be. There's not really a bug in Wasmtime per-se, it's just that our stdio descriptors don't look like something that rustpython is expecting and as a result rustpython behaves oddly.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 09 2022 at 18:38):

alexcrichton commented on issue #3660:

I think this was fixed in https://github.com/bytecodealliance/wasmtime/pull/3696, so closing.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 09 2022 at 18:38):

alexcrichton closed issue #3660:

Test Case

rustpython.wasm.zip

Compiled RustPython.

Steps to Reproduce

Input any wrong python syntax like:

![image](https://user-images.githubusercontent.com/45716019/148503714-2a11531e-848b-4196-b26d-aee79a12dded.png)

Expected Results

There should be a syntax error right after the wrong line.

Actual Results

Syntax errors could not be printed out in time.

Versions and Environment

Wasmtime version or commit: 0.33.0

Operating system: Linux

Architecture: amd64

Extra Info

On other runtimes, there could be correct output.

![image](https://user-images.githubusercontent.com/45716019/148503910-48c4cfc3-3df2-4d60-a028-9527a3ee8d4f.png)


Last updated: Nov 22 2024 at 16:03 UTC