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 405B6A13DF3; Tue, 6 Feb 2024 20:07:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 405B6A13DF3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1707239267; bh=XTBDfTeqH1ChPMdZz4HmcS0ZAZ/A16Wo95yRfxazsik=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XiToYzZsbA1GJ3cyguFiDoq2lzoyarI5cutBRu8bvadQHa3hXg8n87aQRa1CHbgsp ealHu9d2zuXDtdjGcPbViglo5lISIFQHuaqVp38BOm9K7XJs8JpjvbskjhCItsE5Zs Z8YuB2qa4EdpqiN0y48rjXB64Xm7MzbavpB8YMGA= Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [95.163.41.99]) (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 DEF2AA13DC0 for ; Tue, 6 Feb 2024 20:07:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DEF2AA13DC0 Received: by smtp61.i.mail.ru with esmtpa (envelope-from ) id 1rXOvA-00000004Aro-2CUk; Tue, 06 Feb 2024 20:07:45 +0300 Date: Tue, 6 Feb 2024 20:03:47 +0300 To: Sergey Bronnikov Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD94C460F083DF69F51578153A4FD570891E17A4654ABD35A84182A05F53808504057673575E7661C5DD4FF92D56319F197DFDAB37F38016F9A9AB9C87F36677953490E54C98FB8BF8F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73C871DD2182510D5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378D546FBECC9DB5E18638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D854B5A4AED283B4D531AD2A6C810203572BE6E7EECC06483ECC7F00164DA146DAFE8445B8C89999728AA50765F7900637F3E38EE449E3E2AE389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2DCF9CF1F528DBCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD181150BA43C84913FC3A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735458315FA5AE40766C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A516C8D3CB4C0391825002B1117B3ED6969DCDEEE4A2BA566792B673A2F5DDD7E7823CB91A9FED034534781492E4B8EEAD3B72D73EA5828B68BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFA334558126B75082EB56149C5578BF02B641E6C9E4C486A23F5FD50784F527EC90F5B3B6BD0F620E807D692F32DC703288C8B89E3B0969FA64751506408E68CB3F06BEBAF6597D865F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojh/iSjD2txnOmJE27HHYgZQ== X-DA7885C5: 22C501950C5F8B86F255D290C0D534F9F7756C5D0566FEA7D5497175FF3211E98DFF3A0C11A3B9965B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE33652519507D43E2D60D5B0A27ED00DF665121E57EFA022D1AE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 00/26] More tests from LuaJIT-tests, part 1 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! On 01.02.24, Sergey Bronnikov wrote: > Hi, Sergey > > there is a problem with running under ASAN: > > > cmake -S . -B build -DLUAJIT_USE_ASAN=ON > > > > cmake --build build/ -t LuaJIT-tests > > > > [100%] Linking C executable luajit > [100%] Built target luajit_static > Running LuaJIT-tests > ==320737==ASan runtime does not come first in initial library list; you > should either link runtime to your application or manually preload it > with LD_PRELOAD. > gmake[3]: *** > [test/LuaJIT-tests/CMakeFiles/LuaJIT-tests.dir/build.make:74: > LuaJIT-tests] Error 1 > gmake[2]: *** [CMakeFiles/Makefile2:1193: > test/LuaJIT-tests/CMakeFiles/LuaJIT-tests.dir/all] Error 2 > gmake[1]: *** [CMakeFiles/Makefile2:1200: > test/LuaJIT-tests/CMakeFiles/LuaJIT-tests.dir/rule] Error 2 > gmake: *** [Makefile:455: LuaJIT-tests] Error 2 > > cannot reproduce on tarantool/master Good catch! I've been tricked by the CMake again... The new patch is the following: =================================================================== diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt index 96981e32..e91e3d4a 100644 --- a/test/LuaJIT-tests/CMakeLists.txt +++ b/test/LuaJIT-tests/CMakeLists.txt @@ -24,6 +24,39 @@ else() list(APPEND LUAJIT_TESTS_ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}") endif() +if(LUAJIT_USE_ASAN) + # When running LuaJIT-tests under ASAN, the internal ASAN check + # failed: + # AddressSanitizer: CHECK failed: asan_interceptors.cpp:356 + # "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0) + # This is a workaround suggested at + # https://github.com/google/sanitizers/issues/934. + macro(LibRealPath output lib) + execute_process( + COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=${lib} + OUTPUT_VARIABLE LIB_LINK + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + # Fortunately, we are not interested in macOS here, so we can + # use realpath. + execute_process( + COMMAND realpath ${LIB_LINK} + OUTPUT_VARIABLE ${output} + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endmacro() + LibRealPath(LIB_STDCPP libstdc++.so) + # XXX: GCC requires both. Clang requires only libstdc++. + 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}") + else() + list(APPEND LUAJIT_TESTS_ENV LD_PRELOAD="${LIB_STDCPP}") + endif() +endif() + add_custom_command(TARGET LuaJIT-tests COMMENT "Running LuaJIT-tests" COMMAND =================================================================== > > > On 1/29/24 13:45, Sergey Kaplun wrote: > > This patchset enables most of the LuaJIT-tests related to FFI and > > testing of C libraries (cpptest, ctest). More tests (from the > > directory) will be enabled in the future series. > > > > FFI tests from the directory aren't enabled because of their > > inconsistency, see also [1]. > > > > This increases coverage up to 92.5%, see here [2]. > > > > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-9398-more-luajit-tests > > Tarantool PR: https://github.com/tarantool/tarantool/pull/9603 > > Related issues: > > * https://github.com/tarantool/tarantool/issues/9398 > > * https://github.com/tarantool/tarantool/issues/7834 > > > > [1]: https://github.com/LuaJIT/LuaJIT/pull/415 > > [2]: https://coveralls.io/github/tarantool/luajit?branch=skaplun/gh-9398-more-luajit-tests > > > > Changes in the v2: > > * Introduce the AddTestLib macro to avoid copy-pasting. It only adds a > > target with necessary flags without setting any variables. > > * is renamed to for consistency with > > > > * Rename some tests with uninformative naming (like `call_10i` -> > > `10 int args`) > > * Add adjusments of arguments for long calls (~10 arguments) to make them > > comparable without changing test semantics. > > * Fix some typos > > > > Sergey Kaplun (26): > > cmake: introduce AddTestLib macro > > test: prepare lauxilarily libs for LuaJIT-tests > > test: separate LuaJIT helpers from ffi_util.inc > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable in LuaJIT-tests > > test: enable LuaJIT test > > test: enable LuaJIT test > > test: enable LuaJIT test > > test: enable LuaJIT test > > test: enable LuaJIT test > > test: enable LuaJIT test > > > > test/CMakeLists.txt | 3 + > > test/LuaJIT-tests/CMakeLists.txt | 45 ++- > > test/LuaJIT-tests/common/fails.lua | 3 + > > test/LuaJIT-tests/common/ffi/checkfail.lua | 14 + > > test/LuaJIT-tests/common/ffi/checktypes.lua | 15 + > > test/LuaJIT-tests/common/ffi_util.inc | 23 -- > > test/LuaJIT-tests/{misc => lang}/api_call.lua | 32 +- > > .../{sysdep => lang}/catch_cpp.lua | 36 +- > > .../{misc => lang}/catch_wrap.lua | 29 +- > > test/LuaJIT-tests/lang/index | 4 + > > test/LuaJIT-tests/lang/lightud.lua | 89 +++++ > > test/LuaJIT-tests/lib/ffi/ffi_arith_ptr.lua | 13 +- > > test/LuaJIT-tests/lib/ffi/ffi_bitfield.lua | 4 +- > > test/LuaJIT-tests/lib/ffi/ffi_call.lua | 185 +++++----- > > test/LuaJIT-tests/lib/ffi/ffi_callback.lua | 45 +-- > > test/LuaJIT-tests/lib/ffi/ffi_const.lua | 4 +- > > test/LuaJIT-tests/lib/ffi/ffi_convert.lua | 35 +- > > test/LuaJIT-tests/lib/ffi/ffi_enum.lua | 11 +- > > .../lib/ffi/ffi_gcstep_recursive.lua | 27 +- > > test/LuaJIT-tests/lib/ffi/ffi_jit_arith.lua | 22 +- > > test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua | 70 ++-- > > test/LuaJIT-tests/lib/ffi/ffi_jit_conv.lua | 70 ++-- > > test/LuaJIT-tests/lib/ffi/ffi_lex_number.lua | 72 ++-- > > test/LuaJIT-tests/lib/ffi/ffi_metatype.lua | 16 +- > > test/LuaJIT-tests/lib/ffi/ffi_new.lua | 50 +-- > > test/LuaJIT-tests/lib/ffi/ffi_parse_array.lua | 106 +++--- > > test/LuaJIT-tests/lib/ffi/ffi_parse_basic.lua | 251 ++++++------- > > test/LuaJIT-tests/lib/ffi/ffi_parse_cdef.lua | 141 ++++---- > > .../LuaJIT-tests/lib/ffi/ffi_parse_struct.lua | 335 +++++++++--------- > > test/LuaJIT-tests/lib/ffi/ffi_tabov.lua | 12 - > > test/LuaJIT-tests/lib/ffi/index | 18 + > > test/LuaJIT-tests/misc/lightud.lua | 88 ----- > > test/LuaJIT-tests/src/CMakeLists.txt | 17 + > > .../src/{cpptest.cpp => libcpptest.cpp} | 4 +- > > test/LuaJIT-tests/src/{ctest.c => libctest.c} | 4 +- > > test/LuaJIT-tests/test.lua | 7 +- > > .../PUC-Rio-Lua-5.1-tests/libs/CMakeLists.txt | 25 +- > > test/cmake/AddTestLib.cmake | 28 ++ > > test/tarantool-tests/CMakeLists.txt | 27 +- > > test/tarantool-tests/ffi-tabov.test.lua | 27 ++ > > 40 files changed, 1086 insertions(+), 921 deletions(-) > > create mode 100644 test/LuaJIT-tests/common/fails.lua > > create mode 100644 test/LuaJIT-tests/common/ffi/checkfail.lua > > create mode 100644 test/LuaJIT-tests/common/ffi/checktypes.lua > > rename test/LuaJIT-tests/{misc => lang}/api_call.lua (79%) > > rename test/LuaJIT-tests/{sysdep => lang}/catch_cpp.lua (75%) > > rename test/LuaJIT-tests/{misc => lang}/catch_wrap.lua (71%) > > create mode 100644 test/LuaJIT-tests/lang/lightud.lua > > delete mode 100644 test/LuaJIT-tests/lib/ffi/ffi_tabov.lua > > delete mode 100644 test/LuaJIT-tests/misc/lightud.lua > > create mode 100644 test/LuaJIT-tests/src/CMakeLists.txt > > rename test/LuaJIT-tests/src/{cpptest.cpp => libcpptest.cpp} (96%) > > rename test/LuaJIT-tests/src/{ctest.c => libctest.c} (99%) > > create mode 100644 test/cmake/AddTestLib.cmake > > create mode 100644 test/tarantool-tests/ffi-tabov.test.lua > > -- Best regards, Sergey Kaplun