From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BAD7A469710 for ; Mon, 8 Jun 2020 15:53:43 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id n23so20319108ljh.7 for ; Mon, 08 Jun 2020 05:53:43 -0700 (PDT) Date: Mon, 8 Jun 2020 15:53:41 +0300 From: Cyrill Gorcunov Message-ID: <20200608125341.GD134822@grain> References: <2e24204c8064d0c81e1baf81e9e23247199d083f.1590093222.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2e24204c8064d0c81e1baf81e9e23247199d083f.1590093222.git.v.shpilevoy@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 03/10] cmake: add option ENABLE_UB_SANITIZER List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org 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