Stream: git-wasmtime

Topic: wasmtime / issue #7437 `fflush` doesn't work since v14 (w...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2023 at 08:54):

ktock added the bug label to Issue #7437.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2023 at 08:54):

ktock opened issue #7437:

Test Case

#include <stdio.h>
#include <unistd.h>

int main(){
  printf(">");

  fflush(stdout);
  char buf[10];
  read(0, buf, 10);
  printf("Got %s\n", buf);
}

I built this using wasi-sdk 19.0.

Steps to Reproduce

Expected Results

fflush works and buffered string is printed.

wasmtime v13 prints the string when fflush is called.

$ wasmtime --version
wasmtime-cli 13.0.1
$ wasmtime ./a.out
>hi
Got hi

Actual Results

fflush doesn't work and buffered string isn't printed.

wasmtime v14 doesn't print the string even if fflush is called.

$ wasmtime --version
wasmtime-cli 14.0.3
$ wasmtime ./a.out

(nothing is printed)

Versions and Environment

wasmtime-cli 14.0.3

Operating system: Linux 5.15.0-87-generic

Architecture: x86_64

Extra Info

view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2023 at 15:31):

alexcrichton commented on issue #7437:

Thanks for the report! This was an accidental regression from https://github.com/bytecodealliance/wasmtime/pull/6825 and this should be fixed in #7441

view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2023 at 16:44):

pchickey commented on issue #7437:

@ktock Thanks for this bug report, we did not have test coverage for this case but I will work on adding it.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 01 2023 at 18:54):

fitzgen closed issue #7437:

Test Case

#include <stdio.h>
#include <unistd.h>

int main(){
  printf(">");

  fflush(stdout);
  char buf[10];
  read(0, buf, 10);
  printf("Got %s\n", buf);
}

I built this using wasi-sdk 19.0.

Steps to Reproduce

Expected Results

fflush works and buffered string is printed.

wasmtime v13 prints the string when fflush is called.

$ wasmtime --version
wasmtime-cli 13.0.1
$ wasmtime ./a.out
>hi
Got hi

Actual Results

fflush doesn't work and buffered string isn't printed.

wasmtime v14 doesn't print the string even if fflush is called.

$ wasmtime --version
wasmtime-cli 14.0.3
$ wasmtime ./a.out

(nothing is printed)

Versions and Environment

wasmtime-cli 14.0.3

Operating system: Linux 5.15.0-87-generic

Architecture: x86_64

Extra Info


Last updated: Nov 22 2024 at 16:03 UTC