Home

UBSANOPTIONS

UBSANOPTIONS refers to the configuration string used to control the Undefined Behavior Sanitizer (UBSan) in the LLVM/Clang toolchain. UBSan is a runtime instrumenter that detects various kinds of undefined behavior in program execution. The options can be supplied to the sanitizer via an environment variable—commonly named UBSAN_OPTIONS—and, in some contexts, users refer to the option string as UBSANOPTIONS.

The configuration is expressed as a list of key=value pairs that modify how UBSan reports and handles

Common practical use cases include enabling stack traces on errors to aid debugging and deciding whether the

UBSan_OPTIONS is most commonly used when building or running code compiled with -fsanitize=undefined. It provides a

See also: Undefined Behavior Sanitizer (UBSan), Clang/LLVM sanitizers, -fsanitize=undefined, runtime diagnostics.

errors.
Pairs
are
separated
by
commas
(or,
on
some
platforms,
colons),
and
the
overall
effect
is
to
tune
runtime
behavior
without
changing
the
instrumented
code.
Typical
purposes
include
enabling
or
disabling
reporting
details,
controlling
whether
a
program
aborts
on
detection,
and
selecting
the
level
of
output.
sanitizer
should
terminate
the
program
immediately
or
continue
running
after
an
error.
The
exact
set
of
available
keys
depends
on
the
version
of
UBSan
and
the
platform,
but
examples
often
involve
toggling
stack
traces,
error
handling,
and
the
verbosity
of
the
emitted
messages.
flexible
runtime
knob
for
developers
to
tailor
diagnostics
to
their
debugging
and
testing
needs.
If
the
variable
is
not
set,
UBSan
applies
its
default
behavior.