Skip to content

cranelift-isle: Don't panic on too-large rule priorities#5236

Merged
jameysharp merged 1 commit into
bytecodealliance:mainfrom
jameysharp:isle-parse-error
Nov 9, 2022
Merged

cranelift-isle: Don't panic on too-large rule priorities#5236
jameysharp merged 1 commit into
bytecodealliance:mainfrom
jameysharp:isle-parse-error

Conversation

@jameysharp
Copy link
Copy Markdown
Contributor

Found with ISLE's fuzzer.

@jameysharp jameysharp requested a review from elliottt November 9, 2022 19:29
Copy link
Copy Markdown
Member

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely reasonable!

@jameysharp jameysharp enabled auto-merge (squash) November 9, 2022 19:31
@jameysharp jameysharp merged commit d38631a into bytecodealliance:main Nov 9, 2022
@jameysharp jameysharp deleted the isle-parse-error branch November 9, 2022 20:37
abrown added a commit to abrown/wasmtime that referenced this pull request Dec 20, 2022
After bytecodealliance#5236, it is now easier to modify the `wasi-common`
implementations (both `preview0` and `preview1`) to use `&self` instead
of `&mut self` in their function signatures. This makes it possible to
access and use a `WasiCtx` from an `Arc<Host>` (the top-level Wasmtime
CLI structure holding the WASI implementations). An `Arc<Host>` will
only give out immutable access to the WASI implementations it contains.
This relies on bytecodealliance#5428 to configure Wiggle to emit `&self`-receiving
traits.

This change also wraps `wasi-common`'s source of randomness in `WasiCtx`
with a `Mutex` to enable this `&mut self` to `&self` refactoring.

One remaining issue to figure out with this change is the interaction
with the `async` side of wiggle. E.g., `cargo build --all-features -p
wasmtime-wasi` will fail due to the `tokyo` feature being enabled. The
errors have to do with incorrect `Send` and `Sync` bounds on various
parts of the Wiggle-generated API. We had previously discussed turning
off these `async` parts when the `wasi-threads` feature is enabled, or
at least prevent these features from being enabled at the same time,
since as-is even `cargo test --all` is affected.
abrown added a commit to abrown/wasmtime that referenced this pull request Jan 6, 2023
After bytecodealliance#5236, it is now easier to modify the `wasi-common`
implementations (both `preview0` and `preview1`) to use `&self` instead
of `&mut self` in their function signatures. This makes it possible to
access and use a `WasiCtx` from an `Arc<Host>` (the top-level Wasmtime
CLI structure holding the WASI implementations). An `Arc<Host>` will
only give out immutable access to the WASI implementations it contains.
This relies on bytecodealliance#5428 to configure Wiggle to emit `&self`-receiving
traits.

This change also wraps `wasi-common`'s source of randomness in `WasiCtx`
with a `Mutex` to enable this `&mut self` to `&self` refactoring.

One remaining issue to figure out with this change is the interaction
with the `async` side of wiggle. E.g., `cargo build --all-features -p
wasmtime-wasi` will fail due to the `tokyo` feature being enabled. The
errors have to do with incorrect `Send` and `Sync` bounds on various
parts of the Wiggle-generated API. We had previously discussed turning
off these `async` parts when the `wasi-threads` feature is enabled, or
at least prevent these features from being enabled at the same time,
since as-is even `cargo test --all` is affected.
abrown added a commit to abrown/wasmtime that referenced this pull request Jan 9, 2023
After bytecodealliance#5236, it is now easier to modify the `wasi-common`
implementations (both `preview0` and `preview1`) to use `&self` instead
of `&mut self` in their function signatures. This makes it possible to
access and use a `WasiCtx` from an `Arc<Host>` (the top-level Wasmtime
CLI structure holding the WASI implementations). An `Arc<Host>` will
only give out immutable access to the WASI implementations it contains.
This relies on bytecodealliance#5428 to configure Wiggle to emit `&self`-receiving
traits.

This change also wraps `wasi-common`'s source of randomness in `WasiCtx`
with a `Mutex` to enable this `&mut self` to `&self` refactoring.

One remaining issue to figure out with this change is the interaction
with the `async` side of wiggle. E.g., `cargo build --all-features -p
wasmtime-wasi` will fail due to the `tokyo` feature being enabled. The
errors have to do with incorrect `Send` and `Sync` bounds on various
parts of the Wiggle-generated API. We had previously discussed turning
off these `async` parts when the `wasi-threads` feature is enabled, or
at least prevent these features from being enabled at the same time,
since as-is even `cargo test --all` is affected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants