Skip to content

Commit

Permalink
doc: Add small section about UBSan
Browse files Browse the repository at this point in the history
Add a mention of the undefined behavior sanitizer
and which kconfig option toggles it, as users
may not be aware of it, but could benefit from it.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
  • Loading branch information
aescolar authored and carlescufi committed Apr 26, 2023
1 parent 1a2874a commit 8565c9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion boards/posix/native_posix/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ To ease debugging you may want to compile your code without optimizations
Address Sanitizer (ASan)
========================

You can also build Zephyr with `Address Sanitizer`_. To do this, set
You can also build Zephyr with the `Address Sanitizer`_. To do this, set
:kconfig:option:`CONFIG_ASAN`, for example, in the application project file, or in the
``west build`` or ``cmake`` command line invocation.

Expand All @@ -115,6 +115,16 @@ In Debian/Ubuntu this is ``libasan1``.
.. _Address Sanitizer:
https://github.com/google/sanitizers/wiki/AddressSanitizer

Undefined Behavior Sanitizer (UBSan)
====================================

You can also build Zephyr with the `Undefined Behavior Sanitizer`_. To do this, set
:kconfig:option:`CONFIG_UBSAN`, for example, in the application project file, or in the
``west build`` or ``cmake`` command line invocation.

.. _Undefined Behavior Sanitizer:
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

Coverage reports
================

Expand Down
2 changes: 1 addition & 1 deletion boards/posix/nrf52_bsim/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ The same
:ref:`code coverage analysis means from the POSIX arch<coverage_posix>`
are inherited in this board.
Similarly, the
:ref:`address sanitizers can be used as in native_posix<native_posix_asan>`.
:ref:`address and undefined behavior sanitizers can be used as in native_posix<native_posix_asan>`.


Note that BabbleSim will run fine if one or several of its components are
Expand Down

0 comments on commit 8565c9c

Please sign in to comment.