Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add general fuzzing support for custom page sizes #9462

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/fuzzing/src/generators/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ impl Config {
.wasm_threads(self.module_config.config.threads_enabled)
.wasm_function_references(self.module_config.config.gc_enabled)
.wasm_gc(self.module_config.config.gc_enabled)
.wasm_custom_page_sizes(self.module_config.config.custom_page_sizes_enabled)
.wasm_wide_arithmetic(self.module_config.config.wide_arithmetic_enabled)
.native_unwind_info(cfg!(target_os = "windows") || self.wasmtime.native_unwind_info)
.cranelift_nan_canonicalization(self.wasmtime.canonicalize_nans)
Expand Down
3 changes: 1 addition & 2 deletions crates/fuzzing/src/generators/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ impl<'a> Arbitrary<'a> for ModuleConfig {
let _ = config.tail_call_enabled;
config.exceptions_enabled = false;
config.gc_enabled = false;
config.custom_page_sizes_enabled = u.arbitrary()?;
config.wide_arithmetic_enabled = u.arbitrary()?;
config.memory64_enabled = u.ratio(1, 20)?;
// Allow the threads proposal if memory64 is not already enabled. FIXME:
// to allow threads and memory64 to coexist, see
// https://github.com/bytecodealliance/wasmtime/issues/4267.
config.threads_enabled = !config.memory64_enabled && u.ratio(1, 20)?;
// FIXME: this may be safe to enable
config.custom_page_sizes_enabled = false;
// Allow multi-memory but make it unlikely
if u.ratio(1, 20)? {
config.max_memories = config.max_memories.max(2);
Expand Down
1 change: 1 addition & 0 deletions crates/fuzzing/src/oracles/diff_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ impl SpecInterpreter {
config.reference_types_enabled = false;
config.tail_call_enabled = false;
config.relaxed_simd_enabled = false;
config.custom_page_sizes_enabled = false;
config.wide_arithmetic_enabled = false;

Self
Expand Down
1 change: 1 addition & 0 deletions crates/fuzzing/src/oracles/diff_v8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ impl V8Engine {
config.min_memories = config.min_memories.min(1);
config.max_memories = config.max_memories.min(1);
config.memory64_enabled = false;
config.custom_page_sizes_enabled = false;
config.wide_arithmetic_enabled = false;

Self {
Expand Down
1 change: 1 addition & 0 deletions crates/fuzzing/src/oracles/diff_wasmi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl WasmiEngine {
config.threads_enabled = false;
config.exceptions_enabled = false;
config.gc_enabled = false;
config.custom_page_sizes_enabled = false;
config.wide_arithmetic_enabled = false;

let mut wasmi_config = wasmi::Config::default();
Expand Down
4 changes: 1 addition & 3 deletions docs/stability-wasm-proposals.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,14 @@ column is below.
| [`function-references`] | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ |
| [`gc`] [^6] | ✅ | ✅ | ❌[^7] | ❌ | ✅ | ❌ |
| [`wide-arithmetic`] | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [`custom-page-sizes`] | ❌ | ✅ | | ⚠️[^8] | ✅ | ❌ |
| [`custom-page-sizes`] | ❌ | ✅ | | | ✅ | ❌ |

[^6]: There is also a [tracking
issue](https://github.com/bytecodealliance/wasmtime/issues/5032) for the
GC proposal.
[^7]: The implementation of GC has [known performance
issues](https://github.com/bytecodealliance/wasmtime/issues/9351) which can
affect non-GC code when the GC proposal is enabled.
[^8]: A custom fuzzer exists but this isn't enabled yet for general-purpose
fuzzing.

## Unsupported proposals

Expand Down