From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@dev.tarantool.org, alyapunov@tarantool.org, korablev@tarantool.org, tsafin@tarantool.org Subject: [Tarantool-patches] [PATCH v2 00/10] Sanitize unaligned access Date: Thu, 28 May 2020 01:32:18 +0200 [thread overview] Message-ID: <cover.1590622225.git.v.shpilevoy@tarantool.org> (raw) 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-full-ci Issue: https://github.com/tarantool/tarantool/issues/4609 Changes in v2: - Properly fixed CRC33 and removed NOSANITIZE macro; - Added UB sanitizer to CI in ASAN builds; - Rebased to master, and pushed some preliminary patches. Vladislav Shpilevoy (10): small: sanitized rlist and new region API cmake: ignore warnings on alignof() and offsetof() cmake: add option ENABLE_UB_SANITIZER crc32: align memory access 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() .travis.mk | 3 +- 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 | 31 ++++++++++---- src/lib/core/backtrace.cc | 6 +-- src/lib/core/port.h | 2 +- src/lib/small | 2 +- src/lua/popen.c | 20 +++++---- test/unit/CMakeLists.txt | 3 ++ test/unit/crc32.c | 73 +++++++++++++++++++++++++++++++++ test/unit/crc32.result | 11 +++++ test/vinyl/quota.result | 10 ++--- test/vinyl/quota_timeout.result | 4 +- test/vinyl/stat.result | 4 +- 48 files changed, 429 insertions(+), 248 deletions(-) create mode 100644 test/unit/crc32.c create mode 100644 test/unit/crc32.result -- 2.21.1 (Apple Git-122.3)
next reply other threads:[~2020-05-27 23:32 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-27 23:32 Vladislav Shpilevoy [this message] 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 01/10] small: sanitized rlist and new region API Vladislav Shpilevoy 2020-05-28 20:41 ` Timur Safin 2020-05-28 22:56 ` Vladislav Shpilevoy 2020-06-08 23:01 ` Vladislav Shpilevoy 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 10/10] xrow: use unaligned store operation in xrow_to_iovec() Vladislav Shpilevoy 2020-05-28 20:20 ` Timur Safin 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 02/10] cmake: ignore warnings on alignof() and offsetof() Vladislav Shpilevoy 2020-05-28 20:18 ` Timur Safin 2020-05-29 6:24 ` Kirill Yukhin 2020-05-29 22:34 ` Vladislav Shpilevoy 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 03/10] cmake: add option ENABLE_UB_SANITIZER Vladislav Shpilevoy 2020-05-28 20:42 ` Timur Safin 2020-05-29 8:53 ` Sergey Bronnikov 2020-05-29 22:36 ` Vladislav Shpilevoy 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 04/10] crc32: align memory access Vladislav Shpilevoy 2020-05-28 20:11 ` Timur Safin 2020-05-28 23:23 ` Vladislav Shpilevoy 2020-05-28 23:32 ` Timur Safin 2020-06-08 22:33 ` Vladislav Shpilevoy 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 05/10] sql: make BtCursor's memory aligned Vladislav Shpilevoy 2020-05-28 20:20 ` Timur Safin 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 06/10] region: use aligned allocations where necessary Vladislav Shpilevoy 2020-05-28 20:35 ` Timur Safin 2020-05-28 23:07 ` Vladislav Shpilevoy 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 07/10] vinyl: align statements and bps tree extents Vladislav Shpilevoy 2020-05-28 20:38 ` Timur Safin 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 08/10] tuple: use unaligned store-load for field map Vladislav Shpilevoy 2020-05-28 20:22 ` Timur Safin 2020-05-27 23:32 ` [Tarantool-patches] [PATCH v2 09/10] port: make port_c_entry not PACKED Vladislav Shpilevoy 2020-05-28 20:42 ` Timur Safin 2020-06-03 21:27 ` [Tarantool-patches] [PATCH v2 00/10] Sanitize unaligned access Vladislav Shpilevoy 2020-06-08 22:33 ` Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=cover.1590622225.git.v.shpilevoy@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=alyapunov@tarantool.org \ --cc=korablev@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=tsafin@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v2 00/10] Sanitize unaligned access' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox