Stream: git-wasmtime

Topic: wasmtime / PR #6236 delete wasi truncation_rights test


view this post on Zulip Wasmtime GitHub notifications bot (Apr 18 2023 at 21:45):

pchickey opened PR #6236 from bytecodealliance:pch/delete_truncation_rights_test to bytecodealliance:main:

This test was not meaningfully executing, because wasi-common never provides rights containing RIGHTS_PATH_FILESTAT_SET_SIZE - this flag is not even defined in wasi-common/srd/dir.rs as one of the DirCaps flags.

Even when you get rid of that guard that skips the meat of the test, path_open was being called with OFLAGS_TRUNC but without RIGHTS_FD_WRITE, which boils down to an open(2) with OFLAGS_TRUNC set and none of the access modes set, so it will always fail with EINVAL.

So, it doesn't look like this test ever would have meaningfully passed, even in pre-wiggle-rewrite version of wasi-common it landed in back in late 2019. Late 2019! before the pandemic! our eyes were so full of stars and dreams of the future!

The behavior we really care about for truncation are taken care of by the fd_filestat_set test, which shows fd_filestat_set_size works correctly, and the file_truncation test, which shows that opening with OFLAGS_TRUNC will truncate the file.

<!--
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 (Apr 18 2023 at 21:45):

pchickey requested jameysharp for a review on PR #6236.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 18 2023 at 21:45):

pchickey requested wasmtime-core-reviewers for a review on PR #6236.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 18 2023 at 21:45):

pchickey requested sunfishcode for a review on PR #6236.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 18 2023 at 21:56):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 19 2023 at 17:19):

pchickey merged PR #6236.


Last updated: Nov 22 2024 at 16:03 UTC