pub struct DetectionAnalysis { /* private fields */ }Expand description
Detection analysis module.
Provides leak, UAF, and safety detection.
Implementations§
Source§impl DetectionAnalysis
impl DetectionAnalysis
Sourcepub fn from_view(view: &MemoryView) -> Self
pub fn from_view(view: &MemoryView) -> Self
Create from view.
Sourcepub fn unreleased(&self) -> Vec<&ActiveAllocation>
pub fn unreleased(&self) -> Vec<&ActiveAllocation>
Allocations that are still live at the cut.
This is a fact, not a leak verdict: an allocation that was not released inside the capture window is simply still live there.
Sourcepub fn leaks(&self) -> LeakReport
pub fn leaks(&self) -> LeakReport
Detect memory leaks.
A leak is a conclusion that needs an assessment rule plus evidence about capture completeness (plan §4.5). The view only carries the active set, so no allocation can be assessed here and this returns an empty report.
The historical implementation reported every live allocation as a leak
(filter(|a| a.ptr.is_some())), which made any normal program look like it was
leaking everything it held (plan A02). Use Self::unreleased when the caller
needs the “still live, no release observed” list.
Sourcepub fn uaf(&self) -> UafReport
pub fn uaf(&self) -> UafReport
Detect use-after-free.
Analyzes event stream for potential UAF patterns by tracking deallocations and checking for subsequent accesses to the same address.
Note:
- Reallocations are NOT flagged as UAF because realloc on a deallocated pointer is valid behavior (the allocator may reuse the address).
- Metadata events are NOT flagged as UAF because they represent type/container information, not actual memory access.
- Only actual memory access events (read/write operations) on freed memory would indicate UAF, but these are not currently tracked.
Returns an empty report as UAF detection requires runtime memory access tracking which is not implemented in the current architecture.
Auto Trait Implementations§
impl Forget for DetectionAnalysis
impl Freeze for DetectionAnalysis
impl RefUnwindSafe for DetectionAnalysis
impl Send for DetectionAnalysis
impl Sync for DetectionAnalysis
impl Unpin for DetectionAnalysis
impl UnsafeUnpin for DetectionAnalysis
impl UnwindSafe for DetectionAnalysis
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more