Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Log the backtrace of attempted allocations after OOM in OOM tests (#12382)

Nick Fitzgeraldfdd6550d2232
diff --git a/crates/fuzzing/src/oom.rs b/crates/fuzzing/src/oom.rs
index 45b635f82f..bd367adbff 100644
--- a/crates/fuzzing/src/oom.rs
+++ b/crates/fuzzing/src/oom.rs
@@ -97,6 +97,10 @@ unsafe impl GlobalAlloc for OomTestAllocator {
ptr = unsafe { std::alloc::System.alloc(layout) };
}
OomState::DidOom => {
+ log::trace!(
+ "Attempt to allocate {layout:?} after OOM:\n{:?}",
+ Backtrace::new(),
+ );
panic!("OOM test attempted to allocate after OOM: {layout:?}")
}
}