Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org,
	Sergey Kaplun <skaplun@tarantool.org>,
	Maxim Kokryashkin <m.kokryashkin@tarantool.org>
Subject: [Tarantool-patches] [PATCH luajit 4/6] test: more cautious usage of LD_PRELOAD for ASan
Date: Tue, 26 Mar 2024 11:33:30 +0300	[thread overview]
Message-ID: <038a2581330cdd81b3aa4abb01f07aec0bab18c8.1711441864.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1711441864.git.sergeyb@tarantool.org>

From: Sergey Bronnikov <sergeyb@tarantool.org>

This patch adds a comment for clarification about the usage of different
versions of ASan implementations for different compilers. Also, it
replaces ' ' with a ':' as a separator in `LD_PRELOAD` to make it more
robust to the CMake list semantics and removes unnecessary double
quotes.

Needed for tarantool/tarantool#9656

Co-authored-by: Sergey Bronnikov <sergeyb@tarantool.org>
---
 test/LuaJIT-tests/CMakeLists.txt | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt
index e8361e97..003f8de6 100644
--- a/test/LuaJIT-tests/CMakeLists.txt
+++ b/test/LuaJIT-tests/CMakeLists.txt
@@ -33,13 +33,19 @@ if(LUAJIT_USE_ASAN)
   # https://github.com/google/sanitizers/issues/934.
   LibRealPath(LIB_STDCPP libstdc++.so)
   # XXX: GCC requires both. Clang requires only libstdc++.
+  # Be aware, ASAN runtime in Clang on Linux was offered only in
+  # the form of a library with differ name from libasan.so (e.g.
+  # libclang_rt.asan-x86_64.a).
+  # See also:
+  # https://github.com/google/sanitizers/wiki/AddressSanitizerAsDso.
   if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     LibRealPath(LIB_ASAN libasan.so)
-    # XXX: Don't use " " (separator in LD_PRELOAD) in `list()`.
-    # ";" will expand to " " as we want.
-    list(APPEND LUAJIT_TESTS_ENV LD_PRELOAD="${LIB_ASAN};${LIB_STDCPP}")
+    # XXX: The items of the list in LD_PRELOAD can be separated
+    # by spaces or colons, and there is no support for escaping
+    # either separator, see ld.so(8).
+    list(APPEND LUAJIT_TESTS_ENV LD_PRELOAD=${LIB_ASAN}:${LIB_STDCPP})
   else()
-    list(APPEND LUAJIT_TESTS_ENV LD_PRELOAD="${LIB_STDCPP}")
+    list(APPEND LUAJIT_TESTS_ENV LD_PRELOAD=${LIB_STDCPP})
   endif()
 endif()
 
-- 
2.34.1


  parent reply	other threads:[~2024-03-26  8:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26  8:33 [Tarantool-patches] [PATCH luajit 0/6][v5] cmake: replace prove with CTest Sergey Bronnikov via Tarantool-patches
2024-03-26  8:33 ` [Tarantool-patches] [PATCH luajit 1/6] ci: execute LuaJIT tests with GCC 10 and ASAN Sergey Bronnikov via Tarantool-patches
2024-03-26  9:51   ` Sergey Kaplun via Tarantool-patches
2024-03-26  8:33 ` [Tarantool-patches] [PATCH luajit 2/6] test: refactor CMake macro LibRealPath Sergey Bronnikov via Tarantool-patches
2024-03-26  9:57   ` Sergey Kaplun via Tarantool-patches
2024-03-26  8:33 ` [Tarantool-patches] [PATCH luajit 3/6] test: move LibRealPath to the separate module Sergey Bronnikov via Tarantool-patches
2024-03-26 10:01   ` Sergey Kaplun via Tarantool-patches
2024-03-26  8:33 ` Sergey Bronnikov via Tarantool-patches [this message]
2024-03-26 10:04   ` [Tarantool-patches] [PATCH luajit 4/6] test: more cautious usage of LD_PRELOAD for ASan Sergey Kaplun via Tarantool-patches
2024-03-26  8:33 ` [Tarantool-patches] [PATCH luajit 5/6] test: fix lj-802-panic-at-mcode-protfail GCC+ASan Sergey Bronnikov via Tarantool-patches
2024-03-26 10:08   ` Sergey Kaplun via Tarantool-patches
2024-03-26 15:22     ` Sergey Bronnikov via Tarantool-patches
2024-03-26  8:33 ` [Tarantool-patches] [PATCH luajit 6/6] cmake: replace prove with CTest Sergey Bronnikov via Tarantool-patches
2024-03-26 11:03   ` Sergey Kaplun via Tarantool-patches
2024-04-01 14:28     ` Sergey Bronnikov via Tarantool-patches
2024-04-01 18:46       ` Sergey Kaplun via Tarantool-patches
2024-04-11 16:47 ` [Tarantool-patches] [PATCH luajit 0/6][v5] " Sergey Kaplun via Tarantool-patches

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=038a2581330cdd81b3aa4abb01f07aec0bab18c8.1711441864.git.sergeyb@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=estetus@gmail.com \
    --cc=m.kokryashkin@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 4/6] test: more cautious usage of LD_PRELOAD for ASan' \
    /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