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 12B8E543BF0; Wed, 26 Jul 2023 14:33:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 12B8E543BF0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1690371231; bh=BNTZfJe5gKGHi9rHCzBkVkZMQ89Bp1ke5J6PSiHH+C0=; 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=qsTh9JFh0XhF8iLqL39KVgMhMPjly2Ztfurk0miUixnnvj+CqzY07IyrT0PNsNxFZ jAnKdj+8we6WTjhhvSXaIcmvFQRWmAPlbf/QpKD+MND2Aej2YgtFQn/op8tlrQSFGz qp0f8hN94HaXUtPQbh1ghtVvMXUnz+7D7wZZI4SE= Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [95.163.41.98]) (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 5A5C0543BC1 for ; Wed, 26 Jul 2023 14:33:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5A5C0543BC1 Received: by smtp60.i.mail.ru with esmtpa (envelope-from ) id 1qOcm5-008Q1F-Lm; Wed, 26 Jul 2023 14:33:50 +0300 Date: Wed, 26 Jul 2023 14:29:23 +0300 To: Igor Munkin Message-ID: References: <97b2ba3cab77d42f00d9e2eefe331e33fe651b55.1689925402.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <97b2ba3cab77d42f00d9e2eefe331e33fe651b55.1689925402.git.imun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F4F4431F26286E461E8909B71F218E36BE65B9850231FD28182A05F5380850404FA8CB327F5D8FCB441D2DDB6B47AE38450734120BBD3DEA0E12F241D5082D60 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE728F774C865CF4B07EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063795AFAF91F541EBCE8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8A11F1B0332AA5D258AA5899CCADE01C5117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352041BF15D38FB6CB3AC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE140C956E756FBB7AB1CA5D0BF4193578D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE32A336C65186350916E0066C2D8992A16C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CD2A98E5A6551E3E5089D37D7C0E48F6C8AA50765F79006377F02F59195295693EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5A41D87A53CEB0615BF9E4A6BB6BFD82CC8B24AA0C59F93BEF87CCE6106E1FC07E67D4AC08A07B9B0CE135D2742255B35CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF46F62688FEBC4657E4002E4E0F6217EACFB9F5CDDA4961E131D217AFD910CF8CA0D894938C2B729C2D8A5E5B53F5BD043A2DA6AE30A40D18B321A90AA4632FCFE48CAC7CA610320002C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojXeYlEwgoYE9rDaRt6JlEzw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769D04AF5F1095F0F8D441D2DDB6B47AE3887D154BA7A9C8918DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2 5/5] ci: introduce testing workflow with sanitizers 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, Igor! Thanks for the patch! The patch is generally LGTM, after fixing Sergey's comments. But I'm really concerned about the fact, that the CI don't show any error for lj-1024-* [1], lj-128-* [2] tests, where we have obvious memleak, since `os.exit()` is used instead of `test:done(true)` for these tests. On 21.07.23, Igor Munkin wrote: > This commit adds GitHub workflow running all available LuaJIT tests with > LUAJIT_USE_ASAN option enabled. For now, sanitizers workflow works only > for Linux/x86_64 as the most scaling setup in our CI. I believe we will > be able to add other platforms being supported, when macOS runners > starvation is defeated. There is also a separate GitHub Action > introduced for convenient setup of the environment. > > Besided, internal LuaJIT memory allocator is not instrumented yet Typo? s/Besided/Besides/ Typo: s/internal ... allocator/the internal ... allocator/ > unfortunately, so to find any memory faults it's better to build LuaJIT > with system provided memory allocator (i.e. run CMake configuration > phase with -DLUAJIT_USE_SYSMALLOC=ON). However, LUAJIT_USE_SYSMALLOC > cannot be enabled on x64 without GC64, since realloc usually doesn't > return addresses in the right address range. For more info, see root > CMakeLists.txt. > > Follows up tarantool/tarantool#5878 > > Signed-off-by: Igor Munkin > --- > .github/actions/setup-sanitizers/README.md | 12 +++ > .github/actions/setup-sanitizers/action.yml | 24 ++++++ > .github/workflows/sanitizers-testing.yml | 89 +++++++++++++++++++++ > diff --git a/.github/actions/setup-sanitizers/action.yml b/.github/actions/setup-sanitizers/action.yml > new file mode 100644 > index 00000000..ca6b6b9f > --- /dev/null > +++ b/.github/actions/setup-sanitizers/action.yml > @@ -0,0 +1,24 @@ > +name: Setup CI environment for testing with sanitizers on Linux > +description: Common part to tweak Linux CI runner environment for sanitizers > +runs: > + using: composite > + steps: > + - name: Setup CI environment > + uses: ./.github/actions/setup > + - name: Set CMAKE_BUILD_PARALLEL_LEVEL > + run: | > + # Set CMAKE_BUILD_PARALLEL_LEVEL environment variable to > + # limit the number of parallel jobs for build/test step. > + NPROC=$(nproc) > + echo CMAKE_BUILD_PARALLEL_LEVEL=$(($NPROC + 1)) | tee -a $GITHUB_ENV > + shell: bash > + - name: Install build and test dependencies > + run: | > + apt -y update > + apt -y install clang-11 cmake ninja-build make perl > + shell: bash > + - name: Set Clang as a default toolchain > + run: | > + echo CC=clang-11 | tee -a $GITHUB_ENV > + echo CXX=clang++-11 | tee -a $GITHUB_ENV Do we need clang++ for LuaJIT? Why? > + shell: bash > diff --git a/.github/workflows/sanitizers-testing.yml b/.github/workflows/sanitizers-testing.yml > new file mode 100644 > index 00000000..6c345108 > --- /dev/null > +++ b/.github/workflows/sanitizers-testing.yml > + - name: configure > + run: > > + cmake -S . -B ${{ env.BUILDDIR }} > + -G Ninja > + ${{ matrix.CMAKEFLAGS }} > + -DLUAJIT_USE_ASAN=ON > + # XXX: Unfortunately, internal LuaJIT memory allocator > + # is not instrumented yet, so to find any memory errors > + # it's better to build LuaJIT with system provided > + # memory allocator (i.e. run CMake configuration phase > + # with -DLUAJIT_USE_SYSMALLOC=ON). For more info, see > + # root CMakeLists.txt. > + -DLUAJIT_USE_SYSMALLOC=ON > + # XXX: LUAJIT_USE_SYSMALLOC cannot be enabled on x64 > + # without GC64, since realloc usually doesn't return > + # addresses in the right address range. For more info, > + # see root CMakeLists.txt. > + -DLUAJIT_ENABLE_GC64=ON > + - name: build > + run: cmake --build . --parallel > + working-directory: ${{ env.BUILDDIR }} > + - name: test > + env: > + # Enable as much checks as possible. See more info here: > + # https://github.com/google/sanitizers/wiki/AddressSanitizerFlags. Please, also add the link to the [1], since heap_profile is common flag (same for print_suppressions). Also, it is disabled by default, why do we need to forcify it to false? > + ASAN_OPTIONS: " \ > + detect_invalid_pointer_pairs=1: \ > + detect_leaks=1: \ > + detect_stack_use_after_return=1: \ > + dump_instruction_bytes=1: \ > + heap_profile=0: \ > + print_suppressions=0 \ > + symbolize=1: \ > + unmap_shadow_on_exit=1: \ > + " > + run: cmake --build . --parallel --target LuaJIT-test > + working-directory: ${{ env.BUILDDIR }} > -- > 2.30.2 > [1]: https://github.com/tarantool/luajit/actions/runs/5619185186/job/15225900726#step:6:673 [2]: https://github.com/tarantool/luajit/actions/runs/5619185186/job/15225900726#step:6:638 [3]: https://github.com/google/sanitizers/wiki/SanitizerCommonFlags -- Best regards, Sergey Kaplun