From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 4BAE2EBBD96; Tue, 24 Sep 2024 17:13:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4BAE2EBBD96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1727187190; bh=mljxIKEw3AtgWww53we8assDnrIJtYzc7WjdWMdw4nE=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Ebjj7jeCcMMn1ZBZCi2H3rp3QtWlWUZUvoUrysdmHK5nSHunX6sM+/JaaRhgo2sGQ xFJkcp3z3zuAAQMTc5v8lmGuS5I3HGz/ka1a5L7nwo2ywe9Qd5d7JaUsjeOkWjFBdr dWS2fUpS6PfqCmJu6mZuhRzlL7nc8pVz3WUKrMiA= Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [95.163.41.87]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 81D3BEBBD81 for ; Tue, 24 Sep 2024 17:13:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 81D3BEBBD81 Received: by smtp51.i.mail.ru with esmtpa (envelope-from ) id 1st6Hs-00000008TgJ-1DZw; Tue, 24 Sep 2024 17:13:08 +0300 Content-Type: multipart/alternative; boundary="------------W0xzXI2fTlsO2UN2cFbkt0X1" Message-ID: <1d07cc3d-10b4-4ea4-8d71-421b4f6e0c95@tarantool.org> Date: Tue, 24 Sep 2024 17:13:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <3078cc813a6789de05ceb162093f40f5f48de455.1727172936.git.skaplun@tarantool.org> In-Reply-To: <3078cc813a6789de05ceb162093f40f5f48de455.1727172936.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD941CBEC3D08EBAA096DD98E365DE151DD85552754D3CB7C05182A05F5380850404C228DA9ACA6FE27702D0A41253238A5C7A4B249DE6549FD9A904A1B3E1DA148ECBEE71F5DB76FAC09E014349702AB77 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE762F001A90027CA0CC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7922FDBD9EBA3C5B452120BFB3F63BC185F65E78799B30205C33C3ADAEA971F8E611E41BBFE2FEB2B440465877666B1105F35E2B2FC012DD716A9AC0BBF10CF96A533A0A84176576C9FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B55B19328CBC4F849A471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC99BDD1F873C82D133AA81AA40904B5D9CF19DD082D7633A0C84D3B47A649675F3AA81AA40904B5D98AA50765F7900637F609FDC7BF3E55A5D81D268191BDAD3D3666184CF4C3C14F3FC91FA280E0CE3D1A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F890A246B268E114E156CCFE7AF13BCA4B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A52F39223D173AC3685002B1117B3ED696B8E0A47EC0A913E630E4A65F242F5898823CB91A9FED034534781492E4B8EEAD21D4E6D365FE45D1BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D3419891600CCEF460756147E37215FF1091DE41E5BC0287407081CB5B510F09A50EE5E09F67E7A651D1D7E09C32AA3244C2A4A06CC9F08A8263BA3F8B02A6D222B4A84825585A76A15EA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojamSMdo1tbG982v0vk0SPzQ== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140FFA75D0B2B4D8528A86D15D4893F314534BE3D26B3605D170152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 7/7] test: set LD_PRELOAD only when necessary X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------W0xzXI2fTlsO2UN2cFbkt0X1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Sergey, On 24.09.2024 13:29, Sergey Kaplun wrote: > This patch sets LD_PRELOAD for ASan build for the required tests instead > of all tests. > > Follows up tarantool/tarantool#9898 probably follows up these commits as well: commit 9f1137bcc890c28c5de24497624553574d371007    "cmake: replace prove with CTest" commit abe1e0aca3ad01f89f9d184c2a82949314814d04     "ci: execute LuaJIT tests with GCC 10 and ASAN" LGTM > --- > test/tarantool-tests/CMakeLists.txt | 33 ++++++++++++++++------------- > 1 file changed, 18 insertions(+), 15 deletions(-) > > diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt > index a1aee3a2..74086ca4 100644 > --- a/test/tarantool-tests/CMakeLists.txt > +++ b/test/tarantool-tests/CMakeLists.txt > @@ -82,21 +82,6 @@ make_lua_path(LUA_PATH > > set(LUA_TEST_SUFFIX .test.lua) > > -# Some tests use `LD_PRELOAD` to mock system calls (like > -# overwrites > -# `mprotect()`. When compiling with ASan support under GCC, it is > -# required that the ASan library go first in the `LD_PRELOAD` > -# list. Set it manually. The test will append it to the executed > -# process. > -if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU") > - # FIXME: We should set this environment variable only > - # for the corresponding tests to avoid warnings from > - # the GNU libc and other libc implementations. > - # Seehttps://github.com/tarantool/tarantool/issues/9898. > - LibRealPath(LIB_ASAN libasan.so) > - list(APPEND LUA_TEST_ENV_MORE LD_PRELOAD=${LIB_ASAN}) > -endif() > - > # FIXME: This is needed for disabling some flaky tests (like > # profilers), until LuaJIT/LuaJIT#606 will not be resolved. > if(LUAJIT_ENABLE_TABLE_BUMP) > @@ -163,3 +148,21 @@ foreach(test_path ${tests}) > endforeach() > endif() > endforeach() > + > +# Some tests use `LD_PRELOAD` to mock system calls (like > +# overwrites > +# `mprotect()`). When compiling with ASan support under GCC, it is > +# required that the ASan library go first in the `LD_PRELOAD` > +# list. Set it manually. The test will append it to the executed > +# process. > +if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU") > + LibRealPath(LIB_ASAN libasan.so) > + AppendTestEnvVar( > + "test/${TEST_SUITE_NAME}/lj-522-fix-dlerror-return-null.test.lua" > + LD_PRELOAD ${LIB_ASAN} > + ) > + AppendTestEnvVar( > + "test/${TEST_SUITE_NAME}/lj-802-panic-at-mcode-protfail.test.lua" > + LD_PRELOAD ${LIB_ASAN} > + ) > +endif() --------------W0xzXI2fTlsO2UN2cFbkt0X1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, Sergey,

On 24.09.2024 13:29, Sergey Kaplun wrote:
This patch sets LD_PRELOAD for ASan build for the required tests instead
of all tests.

Follows up tarantool/tarantool#9898

probably follows up these commits as well:


commit 9f1137bcc890c28c5de24497624553574d371007    "cmake: replace prove with CTest"

commit abe1e0aca3ad01f89f9d184c2a82949314814d04     "ci: execute LuaJIT tests with GCC 10 and ASAN"


LGTM

---
 test/tarantool-tests/CMakeLists.txt | 33 ++++++++++++++++-------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index a1aee3a2..74086ca4 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -82,21 +82,6 @@ make_lua_path(LUA_PATH
 
 set(LUA_TEST_SUFFIX .test.lua)
 
-# Some tests use `LD_PRELOAD` to mock system calls (like
-# <lj-802-panic-at-mcode-protfail.test.lua> overwrites
-# `mprotect()`. When compiling with ASan support under GCC, it is
-# required that the ASan library go first in the `LD_PRELOAD`
-# list. Set it manually. The test will append it to the executed
-# process.
-if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
-  # FIXME: We should set this environment variable only
-  # for the corresponding tests to avoid warnings from
-  # the GNU libc and other libc implementations.
-  # See https://github.com/tarantool/tarantool/issues/9898.
-  LibRealPath(LIB_ASAN libasan.so)
-  list(APPEND LUA_TEST_ENV_MORE LD_PRELOAD=${LIB_ASAN})
-endif()
-
 # FIXME: This is needed for disabling some flaky tests (like
 # profilers), until LuaJIT/LuaJIT#606 will not be resolved.
 if(LUAJIT_ENABLE_TABLE_BUMP)
@@ -163,3 +148,21 @@ foreach(test_path ${tests})
     endforeach()
   endif()
 endforeach()
+
+# Some tests use `LD_PRELOAD` to mock system calls (like
+# <lj-802-panic-at-mcode-protfail.test.lua> overwrites
+# `mprotect()`). When compiling with ASan support under GCC, it is
+# required that the ASan library go first in the `LD_PRELOAD`
+# list. Set it manually. The test will append it to the executed
+# process.
+if(LUAJIT_USE_ASAN AND CMAKE_C_COMPILER_ID STREQUAL "GNU")
+  LibRealPath(LIB_ASAN libasan.so)
+  AppendTestEnvVar(
+    "test/${TEST_SUITE_NAME}/lj-522-fix-dlerror-return-null.test.lua"
+    LD_PRELOAD ${LIB_ASAN}
+  )
+  AppendTestEnvVar(
+    "test/${TEST_SUITE_NAME}/lj-802-panic-at-mcode-protfail.test.lua"
+    LD_PRELOAD ${LIB_ASAN}
+  )
+endif()
--------------W0xzXI2fTlsO2UN2cFbkt0X1--