From 2127c3a369d40529d3f7b558d2df1b5824a8a2f1 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 20 Jul 2022 16:39:59 -0500 Subject: [PATCH] Fix CI for `main` (#4486) * Skip new `table_ops` test under emulation When emulating we already have to disable most pooling-allocator related tests so this commit carries over that logic to the new fuzz test which may run some configurations with the pooling allocator depending on the random input. * Fix panics in s390x codegen related to aliases This commit fixes an issue introduced as part of the fix for GHSA-5fhj-g3p3-pq9g. The `reftyped_vregs` list given to `regalloc2` is not allowed to have duplicates in it and while the list originally doesn't have duplicates once aliases are applied the list may have duplicates. The fix here is to perform another pass to remove duplicates after the aliases have been processed. --- cranelift/codegen/src/machinst/vcode.rs | 5 +++++ crates/fuzzing/src/oracles.rs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/cranelift/codegen/src/machinst/vcode.rs b/cranelift/codegen/src/machinst/vcode.rs index f9ef6670f8..aa73ae041c 100644 --- a/cranelift/codegen/src/machinst/vcode.rs +++ b/cranelift/codegen/src/machinst/vcode.rs @@ -603,9 +603,14 @@ impl VCodeBuilder { // will be returned directly to `regalloc2` eventually and all // operands/results of instructions will use the alias-resolved vregs // from `regalloc2`'s perspective. + // + // Also note that `reftyped_vregs` can't have duplicates, so after the + // aliases are applied duplicates are removed. for reg in self.vcode.reftyped_vregs.iter_mut() { *reg = Self::resolve_vreg_alias_impl(&self.vcode.vreg_aliases, *reg); } + self.vcode.reftyped_vregs.sort(); + self.vcode.reftyped_vregs.dedup(); self.compute_preds_from_succs(); self.vcode.debug_value_labels.sort_unstable(); diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index ae15eac8dd..6d387f1c3e 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -716,6 +716,12 @@ fn table_ops_eventually_gcs() { use arbitrary::Unstructured; use rand::prelude::*; + // Skip if we're under emulation because some fuzz configurations will do + // large address space reservations that QEMU doesn't handle well. + if std::env::var("WASMTIME_TEST_NO_HOG_MEMORY").is_ok() { + return; + } + let mut rng = SmallRng::seed_from_u64(0); let mut buf = vec![0; 2048]; let n = 100;