#[repr(C)]pub struct CorruptionCanary {
pub _base: CorruptionCanaryForStatics,
}
Expand description
This class is designed to cause crashes when various kinds of memory corruption are observed. For instance, let’s say we have a class C where we suspect out-of-bounds writes to some members. We can insert a member of type Poison near the members we suspect are being corrupted by out-of-bounds writes. Or perhaps we have a class K we suspect is subject to use-after-free violations, in which case it doesn’t particularly matter where in the class we add the member of type Poison.
In either case, we then insert calls to Check() throughout the code. Doing so enables us to narrow down the location where the corruption is occurring. A pleasant side-effect of these additional Check() calls is that crash signatures may become more regular, as crashes will ideally occur consolidated at the point of a Check(), rather than scattered about at various uses of the corrupted memory.
Fields§
§_base: CorruptionCanaryForStatics
Trait Implementations§
source§impl Debug for CorruptionCanary
impl Debug for CorruptionCanary
source§impl PartialEq for CorruptionCanary
impl PartialEq for CorruptionCanary
source§fn eq(&self, other: &CorruptionCanary) -> bool
fn eq(&self, other: &CorruptionCanary) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CorruptionCanary
Auto Trait Implementations§
impl Freeze for CorruptionCanary
impl RefUnwindSafe for CorruptionCanary
impl Send for CorruptionCanary
impl Sync for CorruptionCanary
impl Unpin for CorruptionCanary
impl UnwindSafe for CorruptionCanary
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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
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