Skip to content

wasmtime-wasi only preopening the first and last directory set in WasiCtxBuilder #10058

Description

@justingaffney

Test Case

Clone example repo here: https://github.com/justingaffney/wasmtime-preopen-bug

Steps to Reproduce

  • Build component
    • cd component
    • cargo component build --release
  • Run host
    • cd ..
    • cargo run

Expected Results

The following output:

Reading /a: Success
Reading /b: Success
Reading /c: Success
Reading /d: Success
Reading /e: Success

Actual Results

The following output:

Reading /a: Success
Reading /b: Failed. Error: Some(Custom { kind: Uncategorized, error: "failed to find a pre-opened file descriptor through which \"/b\" could be opened" })
Reading /c: Failed. Error: Some(Custom { kind: Uncategorized, error: "failed to find a pre-opened file descriptor through which \"/c\" could be opened" })
Reading /d: Failed. Error: Some(Custom { kind: Uncategorized, error: "failed to find a pre-opened file descriptor through which \"/d\" could be opened" })
Reading /e: Success

Versions and Environment

Wasmtime version or commit: 28.0.1, 29.0.0

Operating system: Windows 11

Architecture: x86_64

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions