Stream: git-wasmtime

Topic: wasmtime / PR #7058 Force usage of a worker thread for st...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2023 at 20:11):

alexcrichton opened PR #7058 from alexcrichton:stdin-always-worker to bytecodealliance:main:

This commit is a follow-up to #6833 to remove the unix module for handling stdio which sets stdin to nonblocking mode. I've just now discovered that on macOS at least configuring O_NONBLOCK for stdin affects the stdout/stderr descriptors too. This program for example will panic:

fn main() {
    unsafe {
        let r = libc::fcntl(
            libc::STDIN_FILENO,
            libc::F_SETFL,
            libc::fcntl(libc::STDIN_FILENO, libc::F_GETFL) | libc::O_NONBLOCK,
        );
        assert_eq!(r, 0);
    }

    loop {
        println!("hello");
    }
}

It was originally assumed that updating the flags for stdin wouldn't affect anything else except Wasmtime, but because this looks to not be the case this commit removes the logic of registering stdin raw with Tokio and instead unconditionally using the worker thread solution which should work in all situations.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2023 at 20:11):

alexcrichton requested wasmtime-core-reviewers for a review on PR #7058.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2023 at 20:11):

alexcrichton requested fitzgen for a review on PR #7058.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2023 at 20:53):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2023 at 04:31):

pchickey merged PR #7058.


Last updated: Nov 22 2024 at 17:03 UTC