Skip to content

Commit fdd6550

Browse files
authored
Log the backtrace of attempted allocations after OOM in OOM tests (#12382)
1 parent a052569 commit fdd6550

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/fuzzing/src/oom.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ unsafe impl GlobalAlloc for OomTestAllocator {
9797
ptr = unsafe { std::alloc::System.alloc(layout) };
9898
}
9999
OomState::DidOom => {
100+
log::trace!(
101+
"Attempt to allocate {layout:?} after OOM:\n{:?}",
102+
Backtrace::new(),
103+
);
100104
panic!("OOM test attempted to allocate after OOM: {layout:?}")
101105
}
102106
}

0 commit comments

Comments
 (0)