[Tarantool-patches] [PATCH 03/10] cmake: add option ENABLE_UB_SANITIZER
Cyrill Gorcunov
gorcunov at gmail.com
Mon Jun 8 15:53:41 MSK 2020
On Thu, May 21, 2020 at 10:37:26PM +0200, Vladislav Shpilevoy wrote:
> Clang has a built-in sanitizer for undefined behaviour. Such as
> wrong memory alignment, array boundaries violation, 0 division,
> bool values with non standard content, etc.
>
> The sanitizer emits runtime checks which lead to either crash, or
> a trap, or a warning print, depending on what is chosen.
>
> The patch makes it possible to turn the sanitizer on and catch
> UBs. The only supported UB so far is alignment check. Other types
> can be added gradually, along with fixing bugs which they find.
>
> Sometimes it happens that unaligned memory access is done
> intentionally, or can't be simply fixed. To disable the sanitizer
> for such places an attribute 'no_sanitize' can be used. It is
> added inside a macro NOSANITIZE_ALIGN.
>
> Part of #4609
Reviewed-by: Cyrill Gorcunov <gorcunov at gmail.com>
More information about the Tarantool-patches
mailing list