From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2E980469710 for ; Thu, 21 May 2020 23:37:35 +0300 (MSK) From: Vladislav Shpilevoy Date: Thu, 21 May 2020 22:37:22 +0200 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 00/10] Sanitize unaligned access List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, korablev@tarantool.org, tsafin@tarantool.org, alyapunov@tarantool.org, gorcunov@gmail.com The patchset introduces a new cmake option ENABLE_UB_SANITIZER, to enable clang undefined behaviour sanitizer. The sanitizer revealed lots of unaligned memory accesses, and the patchset fixed all of them (which were found). Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-4609-sanitize-alignment Issue: https://github.com/tarantool/tarantool/issues/4609 Vladislav Shpilevoy (10): small: sanitized rlist and new region API cmake: ignore warnings on alignof() and offsetof() cmake: add option ENABLE_UB_SANITIZER crc32: disable align sanitizer sql: make BtCursor's memory aligned region: use aligned allocations where necessary vinyl: align statements and bps tree extents tuple: use unaligned store-load for field map port: make port_c_entry not PACKED xrow: use unaligned store operation in xrow_to_iovec() cmake/compiler.cmake | 13 ++++++- src/box/alter.cc | 39 ++++++++++++--------- src/box/applier.cc | 22 ++++++------ src/box/bind.c | 7 ++-- src/box/ck_constraint.c | 11 +++--- src/box/field_map.c | 30 +++++++++++------ src/box/field_map.h | 21 +++++++----- src/box/fk_constraint.h | 14 +++++--- src/box/index_def.c | 9 ++--- src/box/key_def.c | 9 ++--- src/box/lua/execute.c | 7 ++-- src/box/lua/key_def.c | 7 ++-- src/box/lua/misc.cc | 8 ++--- src/box/lua/schema.lua | 2 +- src/box/memtx_tree.c | 7 ++-- src/box/port.h | 10 +----- src/box/space_def.c | 7 ++-- src/box/sql.c | 20 +++++++---- src/box/sql/build.c | 60 ++++++++++++++++++++------------- src/box/sql/func.c | 7 ++-- src/box/sql/select.c | 14 ++++---- src/box/sql/update.c | 6 ++-- src/box/sql/vdbe.c | 16 ++++----- src/box/sql/wherecode.c | 9 +++-- src/box/tuple_format.c | 3 +- src/box/txn.c | 29 +++++++++------- src/box/user.cc | 8 ++--- src/box/vinyl.c | 26 ++++++++------ src/box/vy_log.c | 33 +++++++++--------- src/box/vy_mem.c | 9 ++--- src/box/vy_point_lookup.c | 9 ++--- src/box/vy_stmt.c | 13 ++++--- src/box/vy_write_iterator.c | 7 ++-- src/box/xrow.c | 2 +- src/box/xrow_update_map.c | 7 ++-- src/box/xrow_update_route.c | 7 ++-- src/cpu_feature.c | 3 +- src/lib/core/backtrace.cc | 6 ++-- src/lib/core/port.h | 2 +- src/lib/small | 2 +- src/lua/popen.c | 20 ++++++----- src/trivia/util.h | 6 ++++ test/vinyl/quota.result | 10 +++--- test/vinyl/quota_timeout.result | 4 +-- test/vinyl/stat.result | 4 +-- 45 files changed, 325 insertions(+), 240 deletions(-) -- 2.21.1 (Apple Git-122.3)