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 8B6D46ECDB; Wed, 23 Sep 2026 17:14:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8B6D46ECDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1790172898; bh=mZAztOTEEtgy3QCdo8NFSM27ECWanBlyleDqGVUubIE=; 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=Ikr1SyXh9kIiS04BaFG9pZNb8bQuQ8xNIWEniGqEDBzSwTBlZbNlY7QIJF/xp7P0l svWYYX/RU2SXaQPfCARKBE7NKnuULcMjyi/5M9/nBe6hAeBQ3Bptea6nnzNd4qBe34 V2g4y90QfHO16LFx3eX2Xo9SKu51f0rcgPNwzmXs= Received: from send174.i.mail.ru (send174.i.mail.ru [95.163.59.13]) (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 3B7E96ECDB for ; Wed, 23 Sep 2026 17:14:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3B7E96ECDB Received: by exim-smtp-7cfc745659-pzv7p with esmtpa (envelope-from ) id 1x9NkN-00000000Ijg-2Cxx; Wed, 23 Sep 2026 17:14:56 +0300 Content-Type: multipart/alternative; boundary="------------LhsXJYDOuhtm6urpUXpccQ0l" Message-ID: Date: Wed, 23 Sep 2026 17:14:54 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Evgeniy Temirgaleev References: <9d4e2c67dcc3640a917a649cfcd2f19253ddd2f1.1786019520.git.e.temirgaleev@tarantool.org> <5798e367-3daa-4fe1-b9e0-5fec24d52082@tarantool.org> <1787929924.462961851@f483.i.mail.ru> Content-Language: en-US In-Reply-To: <1787929924.462961851@f483.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F6609298D81718F42DF46A9F23813DA1368D695CB55ECC76182A05F538085040C1B5598F191018AD3DE06ABAFEAF67058CBE695DAC02D9FCE0B74AC92AE36B4BED52766DCE320BCF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A34C649281B21B01EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F88016AB904663428638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B258CA8EAAACCD5C142E070BE324C7D3C4C63BED7B7BC9894FF6B57BC7E64490618DEB871D839B73339E8FC8737B5C22498424CA1AAF98A6958941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6A70DDFFB3186CBC5CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7CDC9B9C0B24BED77731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A55CC5A3FA361855EA5002B1117B3ED696E9158374C718F4CD4A0A47EBA01A636A823CB91A9FED034534781492E4B8EEADEF0AF71940E62277BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659C3185D8B3C7F01E37F2CE8AD8FD04B48747720154F4126A06A15FAB51D078C9A5808D9EAAB0A85D4B8341EE9D5BE9A0A08826CA66527A4759E489BDF67ED43B4BF0E851B551D04BD6536EB022892E5344C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXOcIETfglQORZ0zpDET4Zrk3igikrdHlWGdKZcopcPl0l/VZul3y37o= X-Mailru-Sender: 689FA8AB762F73937C9FA53A4753B313A050B6EB151FC874172D7677D8B01CF23FDF05E4C9A75672EF86D5F70DA33880E41E8EF7A07863ECB274557F927329BE2DDF8182D28ACDB545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v3 2/3] ci: enabled sanitizer tests for macOS 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------LhsXJYDOuhtm6urpUXpccQ0l Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Evgeniy! Thanks for the fixes! Please consider the following comments: 1. please fix an action name in the .github/actions/setup-sanitizers-linux/README.md s/setup-sanitizers/setup-sanitizers-linux/ should we set CMAKE_PREFIX_PATH in .github/actions/setup-sanitizers-linux/action.yml like we do in the macos version. the comment "# Try to install" is obvious and excess 2. there is inconsistency in the .github/actions/setup-sanitizers-macos/README.md and implementation: README says: "Requires input: cc_name" but the current implementation has a default (and `required: false`). In action.yml, `CMAKE_C_COMPILER=clang-21` (the name, not the full path) and `CMAKE_PREFIX_PATH` are set, and `-DCMAKE_C_COMPILER=clang-21` is passed to the workflow. CMake looks for the compiler in the `PATH` to detect it - `CMAKE_PREFIX_PATH` has no effect on this. Either the required compiler is already in the runner's `PATH` (in which case `.github/actions/setup-macos` is unnecessary, as it doesn't add anything to the `PATH`), or the configuration will fail. You should explicitly add `$(brew --prefix llvm@21)/bin` to the `PATH`. 3. I don't like that we have three copies of ASAN_OPTIONS in the same workflow. It is better to fix this. 4. .github/actions/setup-sanitizers-linux/action.yml: why CC was renamed to CMAKE_C_COMPILER? I would leave CC env var. CMAKE_C_COMPILER is a CMake option name name, GH action knows nothing about CMake. Also, please fix CMake name: s/cmake/CMake/ Sergey On 8/28/26 18:12, Evgeniy Temirgaleev wrote: > Hi, Sergey! Thanks for review! > Please, see my answers below. > Fixes applied and the branch is force pushed. > > From: Sergey Bronnikov > To: Evgeniy Temirgaleev , Sergey > Kaplun > Cc:tarantool-patches@dev.tarantool.org > Date: Thursday, August 27, 2026 3:07 PM +03:00 > > Hi, Evgeniy, > > thanks for the patch! See my comments below. > > Sergey > > On 8/6/26 15:47, Evgeniy Temirgaleev wrote: >> From: Temir Galeev >> >> The arm64 and x86_64 architectures with clang/gcc compiler were added >> to the matrix. >> --- >> .../README.md | 0 >> .../action.yml | 8 +- >> .../actions/setup-sanitizers-macos/README.md | 15 +++ >> .../actions/setup-sanitizers-macos/action.yml | 73 +++++++++++++ >> .github/workflows/sanitizers-testing.yml | 101 ++++++++++++++++-- >> 5 files changed, 186 insertions(+), 11 deletions(-) >> rename .github/actions/{setup-sanitizers => setup-sanitizers-linux}/README.md (100%) >> rename .github/actions/{setup-sanitizers => setup-sanitizers-linux}/action.yml (76%) >> create mode 100644 .github/actions/setup-sanitizers-macos/README.md >> create mode 100644 .github/actions/setup-sanitizers-macos/action.yml >> >> diff --git a/.github/actions/setup-sanitizers/README.md b/.github/actions/setup-sanitizers-linux/README.md >> similarity index 100% >> rename from .github/actions/setup-sanitizers/README.md >> rename to .github/actions/setup-sanitizers-linux/README.md >> diff --git a/.github/actions/setup-sanitizers/action.yml b/.github/actions/setup-sanitizers-linux/action.yml >> similarity index 76% >> rename from .github/actions/setup-sanitizers/action.yml >> rename to .github/actions/setup-sanitizers-linux/action.yml >> index 8642d553..18f5a75d 100644 >> --- a/.github/actions/setup-sanitizers/action.yml >> +++ b/.github/actions/setup-sanitizers-linux/action.yml >> @@ -20,13 +20,17 @@ runs: >> - name: Install build and test dependencies >> run: | >> apt -y update >> + echo Available compilers: >> + export CC_FAMILY=`echo ${CC_NAME} | sed 's/-.*$//'` >> + apt list | grep -Pe "^${CC_FAMILY}-[0-9]+/" >> + # Try to install > > Honestly, I don't get why we should available compilers on each run. > > I think this information is important for some cases to have it on > hand. The example was present in the thread above: > https://lists.tarantool.org/pipermail/tarantool-patches/2026-August/030774.html > > Why we cannot > > hardcode compiler here? > > This patch is not intended to refactor linux sanitizers action, so the > existing solution is used. > Only info about available compilers was added: > «Also, the 'setup-sanitizers-macos' action supplied with > the 'list available compilers' commands in one of it's job. > It helps to get the answer to the question: > 'Which compiler we can select just now with our current environment?' > The 'setup-sanitizers-linux' build job extended with such commands also.» > >> apt -y install ${CC_NAME} libstdc++-10-dev cmake ninja-build make perl >> shell: bash >> env: >> CC_NAME: ${{ inputs.cc_name }} >> - - name: Set specific C compiler as a default toolchain >> + - name: Set specific C compiler as a default toolchain for cmake > s/cmake/CMake/? > > Fixed. > >> run: | >> - echo CC=${CC_NAME} | tee -a $GITHUB_ENV >> + echo CMAKE_C_COMPILER=${CC_NAME} | tee -a $GITHUB_ENV > s/tee -a/>>/ (feel free to ignore, previously tee was used) > > The ‘tee -a’ method allows the programmer to see the step’s result of > the env definition. It’s used in the ‘setup’, ‘setup-linux’, > ‘setup-macos’ actions and some workflows already. I think it’s a good > approach to use. Also, there is an empty grep for the ‘>> $GITHUB_ENV’ > method in our scripts. > If there are the strong reasons to change it, I think it must be done > in all places and in the separate refactoring patch. Agree, let's keep as is. > >> shell: bash >> env: >> CC_NAME: ${{ inputs.cc_name }} >> diff --git a/.github/actions/setup-sanitizers-macos/README.md b/.github/actions/setup-sanitizers-macos/README.md >> new file mode 100644 >> index 00000000..9ac5eb38 >> --- /dev/null >> +++ b/.github/actions/setup-sanitizers-macos/README.md >> @@ -0,0 +1,15 @@ >> +# Setup environment for sanitizers on macOS >> + >> +Action setups the environment on macOS runners (install requirements, setup the >> +workflow environment, etc) for testing with sanitizers enabled. >> + >> +Requires input: >> +- cc_name as versioned C compiler: gcc-ver or clang-ver. >> + >> +## How to use Github Action from Github workflow >> + >> +Add the following code to the running steps before LuaJIT configuration: >> +``` >> +- uses: ./.github/actions/setup-sanitizers-macos >> + if: ${{ matrix.OS == 'macOS' }} >> +``` >> diff --git a/.github/actions/setup-sanitizers-macos/action.yml b/.github/actions/setup-sanitizers-macos/action.yml >> new file mode 100644 >> index 00000000..9836ea03 >> --- /dev/null >> +++ b/.github/actions/setup-sanitizers-macos/action.yml >> @@ -0,0 +1,73 @@ >> +name: Setup CI environment for testing with sanitizers on macOS >> +description: Common part to tweak macOS CI runner environment for sanitizers >> +inputs: >> + cc_name: >> + description: C compiler name (for example, gcc-12) >> + required: false >> + default: clang-21 >> +runs: >> + using: composite >> + steps: >> + - name: Get compiler version from cc_name >> + shell: bash >> + env: >> + CC_NAME: ${{ inputs.cc_name }} >> + run: | >> + echo CC_VERSION=`echo ${CC_NAME} | sed 's/.*-//'` | tee -a $GITHUB_ENV >> + - name: Get brew formula from cc_name >> + shell: bash >> + env: >> + CC_FORMULA_NAME: |- >> + ${{ case( >> + startsWith(inputs.cc_name, 'gcc'), 'gcc', >> + startsWith(inputs.cc_name, 'clang'), 'llvm', >> + 'MISCONFIG' >> + ) }} >> + run: | >> + echo CC_FORMULA=${CC_FORMULA_NAME}@${CC_VERSION} | tee -a $GITHUB_ENV >> + echo Available formulas: `brew search ${CC_FORMULA_NAME}` >> + - name: Setup CI environment >> + uses: ./.github/actions/setup >> + - name: Set CMAKE_BUILD_PARALLEL_LEVEL >> + shell: bash >> + run: | >> + # Set CMAKE_BUILD_PARALLEL_LEVEL environment variable to >> + # limit the number of parallel jobs for build/test step. >> + NPROC=$(sysctl -n hw.logicalcpu 2>/dev/null) >> + echo CMAKE_BUILD_PARALLEL_LEVEL=$(($NPROC + 1)) | tee -a $GITHUB_ENV >> + - name: Set MACOSX_DEPLOYMENT_TARGERT >> + shell: bash >> + run: | >> + # Set required MACOSX_DEPLOYMENT_TARGERT environment >> + # variable for Makefile.original build. >> + # Seehttps://github.com/LuaJIT/LuaJIT/issues/484, >> + #https://github.com/LuaJIT/LuaJIT/issues/653. >> + echo MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion) | tee -a $GITHUB_ENV >> + - name: Install build and test dependencies >> + shell: bash >> + run: | >> + # Install brew using the command from Homebrew repository >> + # instructions:https://github.com/Homebrew/install. >> + # XXX: 'echo' command below is required since brew >> + # installation script obliges the one to enter a newline >> + # for confirming the installation via Ruby script. >> + brew update || >> + echo | /usr/bin/ruby -e "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)" >> + # Try to install the packages either upgrade it to avoid >> + # of fails if the package already exists with the previous >> + # version. >> + brew install --force ${CC_FORMULA} cmake make ninja perl || >> + brew upgrade ${CC_FORMULA} cmake make ninja perl >> + - name: Set specific C compiler as a default toolchain for cmake >> + shell: bash >> + env: >> + CC_NAME: ${{ inputs.cc_name }} >> + run: | >> + echo CMAKE_C_COMPILER=${CC_NAME} | tee -a $GITHUB_ENV >> + echo CMAKE_PREFIX_PATH="`brew --prefix ${CC_FORMULA}`" | tee -a $GITHUB_ENV >> + - name: Log installed compilers >> + shell: bash >> + run: | >> + echo default clang: `clang --version` >> + echo default gcc: `gcc --version` >> + echo cmake compiler: `${CMAKE_PREFIX_PATH}/bin/${CMAKE_C_COMPILER} --version` >> diff --git a/.github/workflows/sanitizers-testing.yml b/.github/workflows/sanitizers-testing.yml >> index 4bf7d023..fe550b81 100644 >> --- a/.github/workflows/sanitizers-testing.yml >> +++ b/.github/workflows/sanitizers-testing.yml >> @@ -31,17 +31,41 @@ jobs: >> strategy: >> fail-fast: false >> matrix: >> - # XXX: Let's start with only Linux/x86_64 >> + ARCH: [ARM64, x86_64] >> BUILDTYPE: [Debug, Release] >> - CC: [gcc-10, clang-11] >> + OS: [Linux, macOS] >> + # There are different top-level versions available for Linux and macOS runners. >> + CC: [gcc-10, clang-11, gcc-15, clang-21] >> include: >> - BUILDTYPE: Debug >> CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON >> - BUILDTYPE: Release >> CMAKEFLAGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo >> - runs-on: [self-hosted, regular, Linux, x86_64] >> + exclude: >> + # On current runners with Linux/ARM64 environment and >> + # with LUAJIT_USE_SYSMALLOC=ON the system allocator returns addresses >> + # with 48-bit set. Thus checkptrGC() fails with new Lua state pointer >> + # and luajit fails to start with 'cannot create state: not enough memory' >> + # error. So, we exclude these cases. >> + - ARCH: ARM64 >> + OS: Linux >> + # Exclude nonsuitable OS/compiler pairs. >> + - OS: macOS >> + CC: gcc-10 >> + - OS: macOS >> + CC: clang-11 >> + - OS: Linux >> + CC: gcc-15 >> + - OS: Linux >> + CC: clang-21 >> + # Exclude macOS/ARM64/gcc case due to some tests are failed. >> + # Details:https://github.com/tarantool/tarantool/issues/13018 >> + - ARCH: ARM64 >> + OS: macOS >> + CC: gcc-15 >> + runs-on: [self-hosted, regular, '${{ matrix.OS }}', '${{ matrix.ARCH }}'] >> name: > >> - LuaJIT with ASan and UBSan (Linux/x86_64) >> + LuaJIT with ASan and UBSan (${{ matrix.OS }}/${{ matrix.ARCH }}) >> ${{ matrix.BUILDTYPE }} >> CC:${{ matrix.CC }} >> GC64:ON SYSMALLOC:ON >> @@ -51,7 +75,13 @@ jobs: >> fetch-depth: 0 >> submodules: recursive >> - name: setup Linux for sanitizers >> - uses: ./.github/actions/setup-sanitizers >> + if: ${{ matrix.OS == 'Linux' }} >> + uses: ./.github/actions/setup-sanitizers-linux >> + with: >> + cc_name: ${{ matrix.CC }} >> + - name: setup macOS for sanitizers >> + if: ${{ matrix.OS == 'macOS' }} >> + uses: ./.github/actions/setup-sanitizers-macos >> with: >> cc_name: ${{ matrix.CC }} >> - name: configure >> @@ -70,18 +100,46 @@ jobs: >> cmake -S . -B ${{ env.BUILDDIR }} >> -G Ninja >> ${{ matrix.CMAKEFLAGS }} >> + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} >> + -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} >> -DLUAJIT_ENABLE_GC64=ON >> -DLUAJIT_USE_ASAN=ON >> -DLUAJIT_USE_SYSMALLOC=ON >> -DLUAJIT_USE_UBSAN=ON >> + - name: Check for possible compiler misconfig >> + working-directory: ${{ env.BUILDDIR }} >> + env: >> + CC_NAME: ${{ matrix.CC }} >> + run: grep CMakeCache.txt -e CMAKE_C_COMPILER:STRING | grep ${CC_NAME} >> - name: build >> run: cmake --build . --parallel >> working-directory: ${{ env.BUILDDIR }} >> - - name: test >> + >> + # Enable as much checks as possible. See more info here: > > You say about enabling ASAN features, but some features are > disabled below, > > please explain why these features are disabled. > >> + #https://github.com/google/sanitizers/wiki/AddressSanitizerFlags, >> + #https://github.com/google/sanitizers/wiki/SanitizerCommonFlags. >> + - name: setup sanitizer options for Linux >> + if: ${{ matrix.OS == 'Linux' }} >> + env: >> + ASAN_OPTIONS: " \ >> + detect_invalid_pointer_pairs=1: \ >> + detect_leaks=1: \ > already enabled by default >> + detect_stack_use_after_return=1: \ >> + dump_instruction_bytes=1: \ >> + heap_profile=0: \ > disabled by default >> + print_suppressions=0: \ > Why disabled? >> + symbolize=1: \ > enabled by default > > The patch doesn’t enable ASAN for Linux, so this part isn’t changed: > the ASAN options for Linux is used as is. > The ASAN options for macOS is just a copy of the Linux options with > one exception. The detect_leaks was disabled with the explanation in a > comment. > The full option investigation and selection in not the main goal of > the patch. The patch enables ASAN for macOS and it’s truly enabled for > the options selected. > I agree that the actualization of options for both Linux and macOS is > a valuable job. I suggest to make a ticket for it. > >> + unmap_shadow_on_exit=1: \ >> + " >> + UBSAN_OPTIONS: " >> + print_stacktrace=1 \ >> + " >> + run: | >> + echo ASAN_OPTIONS=${ASAN_OPTIONS} | tee -a $GITHUB_ENV >> + echo UBSAN_OPTIONS=${UBSAN_OPTIONS} | tee -a $GITHUB_ENV > s/tee -a/>>/ (the same thing but usually used in Github documentation) > > Answered above. > >> + - name: setup sanitizer options for macOS (common) >> + if: ${{ matrix.OS == 'macOS' && matrix.ARCH != 'ARM64' && matrix.CC != 'clang-21' }} >> env: >> - # Enable as much checks as possible. See more info here: >> - #https://github.com/google/sanitizers/wiki/AddressSanitizerFlags, >> - #https://github.com/google/sanitizers/wiki/SanitizerCommonFlags. >> ASAN_OPTIONS: " \ >> detect_invalid_pointer_pairs=1: \ >> detect_leaks=1: \ >> @@ -95,5 +153,30 @@ jobs: >> UBSAN_OPTIONS: " >> print_stacktrace=1 \ >> " >> + run: | >> + echo ASAN_OPTIONS=${ASAN_OPTIONS} | tee -a $GITHUB_ENV >> + echo UBSAN_OPTIONS=${UBSAN_OPTIONS} | tee -a $GITHUB_ENV > s/tee -a/>>/ > > The same. > >> + - name: setup sanitizer options for macOS (ARM64/clang-21) >> + if: ${{ matrix.OS == 'macOS' && matrix.ARCH == 'ARM64' && matrix.CC == 'clang-21' }} >> + # detect_leaks is disabled due to some tests build is failed. >> + # Details:https://github.com/tarantool/tarantool/issues/13019 >> + env: >> + ASAN_OPTIONS: " \ >> + detect_invalid_pointer_pairs=1: \ >> + detect_leaks=0: \ >> + detect_stack_use_after_return=1: \ >> + dump_instruction_bytes=1: \ >> + heap_profile=0: \ >> + print_suppressions=0: \ >> + symbolize=1: \ >> + unmap_shadow_on_exit=1: \ > the same questions as above. Also, can we avoid duplication? > > May be we can use the file to accumulate the options and to update it > in a specific steps. I suggest this task to the new > ticket ‘ci: actualization of the ASAN options for Linux and macOS’ also. > >> + " >> + UBSAN_OPTIONS: " >> + print_stacktrace=1 \ >> + " >> + run: | >> + echo ASAN_OPTIONS=${ASAN_OPTIONS} | tee -a $GITHUB_ENV >> + echo UBSAN_OPTIONS=${UBSAN_OPTIONS} | tee -a $GITHUB_ENV > s/tee -a/>>/ > > Answered above. > >> + - name: test >> run: cmake --build . --parallel --target LuaJIT-test >> working-directory: ${{ env.BUILDDIR }} > > The changes applied: > ------------------------------------------------------------------------ > diff --git a/.github/actions/setup-sanitizers-linux/action.yml > b/.github/actions/setup-sanitizers-linux/action.yml > index 9744e5dd..19314dca 100644 > --- a/.github/actions/setup-sanitizers-linux/action.yml > +++ b/.github/actions/setup-sanitizers-linux/action.yml > @@ -28,7 +28,7 @@ runs: >        shell: bash >        env: >          CC_NAME: ${{ inputs.cc_name }} > -    - name: Set specific C compiler as a default toolchain for cmake > +    - name: Set specific C compiler as a default toolchain for CMake. >        run: | >          echo CMAKE_C_COMPILER=${CC_NAME} | tee -a $GITHUB_ENV >        shell: bash > diff --git a/.github/actions/setup-sanitizers-macos/action.yml > b/.github/actions/setup-sanitizers-macos/action.yml > index d2160faa..740943af 100644 > --- a/.github/actions/setup-sanitizers-macos/action.yml > +++ b/.github/actions/setup-sanitizers-macos/action.yml > @@ -35,7 +35,7 @@ runs: >          # of fails if the package already exists with the previous >          # version. >          brew install --force ${CC_FORMULA} || brew upgrade ${CC_FORMULA} > -    - name: Set specific C compiler as a default toolchain for cmake > +    - name: Set specific C compiler as a default toolchain for CMake. >        shell: bash >        env: >          CC_NAME: ${{ inputs.cc_name }} > -- > Best regards, > Evgeniy Temirgaleev --------------LhsXJYDOuhtm6urpUXpccQ0l Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, Evgeniy!


Thanks for the fixes!

Please consider the following comments:

1. please fix an action name in the .github/actions/setup-sanitizers-linux/README.md 

s/setup-sanitizers/setup-sanitizers-linux/

should we set CMAKE_PREFIX_PATH in .github/actions/setup-sanitizers-linux/action.yml like we do in the macos version.

the comment "# Try to install" is obvious and excess

2. there is inconsistency in the .github/actions/setup-sanitizers-macos/README.md and implementation:

README says: "Requires input: cc_name" but the current implementation has a default (and `required: false`).

In action.yml, `CMAKE_C_COMPILER=clang-21` (the name, not the full path) and `CMAKE_PREFIX_PATH` are set,

and `-DCMAKE_C_COMPILER=clang-21` is passed to the workflow. CMake looks for the compiler in the `PATH` to

detect it - `CMAKE_PREFIX_PATH` has no effect on this.  Either the required compiler is already in the runner's `PATH`

(in which case `.github/actions/setup-macos` is unnecessary, as it doesn't add anything to the `PATH`),

or the configuration will fail. You should explicitly add `$(brew --prefix llvm@21)/bin` to the `PATH`.

3. I don't like that we have three copies of ASAN_OPTIONS in the same workflow. It is better to fix this.

4. .github/actions/setup-sanitizers-linux/action.yml:

why CC was renamed to CMAKE_C_COMPILER? I would leave CC env var. CMAKE_C_COMPILER is a CMake option name name, GH action

knows nothing about CMake.

Also, please fix CMake name: s/cmake/CMake/


Sergey

On 8/28/26 18:12, Evgeniy Temirgaleev wrote:
Hi, Sergey! Thanks for review!
Please, see my answers below.
Fixes applied and the branch is force pushed.
From: Sergey Bronnikov <sergeyb@tarantool.org>
To: Evgeniy Temirgaleev <e.temirgaleev@tarantool.org>, Sergey Kaplun <skaplun@tarantool.org>
Cc:tarantool-patches@dev.tarantool.org
Date: Thursday, August 27, 2026 3:07 PM +03:00

 

Hi, Evgeniy,

thanks for the patch! See my comments below.

Sergey

On 8/6/26 15:47, Evgeniy Temirgaleev wrote:
From: Temir Galeev <temir.galeev@bk.ru>

The arm64 and x86_64 architectures with clang/gcc compiler were added
to the matrix.
---
 .../README.md                                 |   0
 .../action.yml                                |   8 +-
 .../actions/setup-sanitizers-macos/README.md  |  15 +++
 .../actions/setup-sanitizers-macos/action.yml |  73 +++++++++++++
 .github/workflows/sanitizers-testing.yml      | 101 ++++++++++++++++--
 5 files changed, 186 insertions(+), 11 deletions(-)
 rename .github/actions/{setup-sanitizers => setup-sanitizers-linux}/README.md (100%)
 rename .github/actions/{setup-sanitizers => setup-sanitizers-linux}/action.yml (76%)
 create mode 100644 .github/actions/setup-sanitizers-macos/README.md
 create mode 100644 .github/actions/setup-sanitizers-macos/action.yml

diff --git a/.github/actions/setup-sanitizers/README.md b/.github/actions/setup-sanitizers-linux/README.md
similarity index 100%
rename from .github/actions/setup-sanitizers/README.md
rename to .github/actions/setup-sanitizers-linux/README.md
diff --git a/.github/actions/setup-sanitizers/action.yml b/.github/actions/setup-sanitizers-linux/action.yml
similarity index 76%
rename from .github/actions/setup-sanitizers/action.yml
rename to .github/actions/setup-sanitizers-linux/action.yml
index 8642d553..18f5a75d 100644
--- a/.github/actions/setup-sanitizers/action.yml
+++ b/.github/actions/setup-sanitizers-linux/action.yml
@@ -20,13 +20,17 @@ runs:
     - name: Install build and test dependencies
       run: |
         apt -y update
+        echo Available compilers:
+        export CC_FAMILY=`echo ${CC_NAME} | sed 's/-.*$//'`
+        apt list | grep -Pe "^${CC_FAMILY}-[0-9]+/"
+        # Try to install

Honestly, I don't get why we should available compilers on each run.

I think this information is important for some cases to have it on hand. The example was present in the thread above: https://lists.tarantool.org/pipermail/tarantool-patches/2026-August/030774.html

Why we cannot

hardcode compiler here?

This patch is not intended to refactor linux sanitizers action, so the existing solution is used.
 
Only info about available compilers was added:
 
«Also, the 'setup-sanitizers-macos' action supplied with
the 'list available compilers' commands in one of it's job.
It helps to get the answer to the question:
'Which compiler we can select just now with our current environment?'
 
The 'setup-sanitizers-linux' build job extended with such commands also.»
 
         apt -y install ${CC_NAME} libstdc++-10-dev cmake ninja-build make perl
       shell: bash
       env:
         CC_NAME: ${{ inputs.cc_name }}
-    - name: Set specific C compiler as a default toolchain
+    - name: Set specific C compiler as a default toolchain for cmake
s/cmake/CMake/?
Fixed.
       run: |
-        echo CC=${CC_NAME} | tee -a $GITHUB_ENV
+        echo CMAKE_C_COMPILER=${CC_NAME} | tee -a $GITHUB_ENV
s/tee -a/>>/ (feel free to ignore, previously tee was used)
The ‘tee -a’ method allows the programmer to see the step’s result of the env definition. It’s used in the ‘setup’, ‘setup-linux’, ‘setup-macos’ actions and some workflows already. I think it’s a good approach to use. Also, there is an empty grep for the ‘>> $GITHUB_ENV’ method in our scripts.
 
If there are the strong reasons to change it, I think it must be done in all places and in the separate refactoring patch.
Agree, let's keep as is.
       shell: bash
       env:
         CC_NAME: ${{ inputs.cc_name }}
diff --git a/.github/actions/setup-sanitizers-macos/README.md b/.github/actions/setup-sanitizers-macos/README.md
new file mode 100644
index 00000000..9ac5eb38
--- /dev/null
+++ b/.github/actions/setup-sanitizers-macos/README.md
@@ -0,0 +1,15 @@
+# Setup environment for sanitizers on macOS
+
+Action setups the environment on macOS runners (install requirements, setup the
+workflow environment, etc) for testing with sanitizers enabled.
+
+Requires input:
+- cc_name as versioned C compiler: gcc-ver or clang-ver.
+
+## How to use Github Action from Github workflow
+
+Add the following code to the running steps before LuaJIT configuration:
+```
+- uses: ./.github/actions/setup-sanitizers-macos
+  if: ${{ matrix.OS == 'macOS' }}
+```
diff --git a/.github/actions/setup-sanitizers-macos/action.yml b/.github/actions/setup-sanitizers-macos/action.yml
new file mode 100644
index 00000000..9836ea03
--- /dev/null
+++ b/.github/actions/setup-sanitizers-macos/action.yml
@@ -0,0 +1,73 @@
+name: Setup CI environment for testing with sanitizers on macOS
+description: Common part to tweak macOS CI runner environment for sanitizers
+inputs:
+  cc_name:
+    description: C compiler name (for example, gcc-12)
+    required: false
+    default: clang-21
+runs:
+  using: composite
+  steps:
+    - name: Get compiler version from cc_name
+      shell: bash
+      env:
+        CC_NAME: ${{ inputs.cc_name }}
+      run: |
+        echo CC_VERSION=`echo ${CC_NAME} | sed 's/.*-//'` | tee -a $GITHUB_ENV
+    - name: Get brew formula from cc_name
+      shell: bash
+      env:
+        CC_FORMULA_NAME: |-
+          ${{ case(
+            startsWith(inputs.cc_name, 'gcc'), 'gcc',
+            startsWith(inputs.cc_name, 'clang'), 'llvm',
+            'MISCONFIG'
+          ) }}
+      run: |
+        echo CC_FORMULA=${CC_FORMULA_NAME}@${CC_VERSION} | tee -a $GITHUB_ENV
+        echo Available formulas: `brew search ${CC_FORMULA_NAME}`
+    - name: Setup CI environment
+      uses: ./.github/actions/setup
+    - name: Set CMAKE_BUILD_PARALLEL_LEVEL
+      shell: bash
+      run: |
+        # Set CMAKE_BUILD_PARALLEL_LEVEL environment variable to
+        # limit the number of parallel jobs for build/test step.
+        NPROC=$(sysctl -n hw.logicalcpu 2>/dev/null)
+        echo CMAKE_BUILD_PARALLEL_LEVEL=$(($NPROC + 1)) | tee -a $GITHUB_ENV
+    - name: Set MACOSX_DEPLOYMENT_TARGERT
+      shell: bash
+      run: |
+        # Set required MACOSX_DEPLOYMENT_TARGERT environment
+        # variable for Makefile.original build.
+        # See https://github.com/LuaJIT/LuaJIT/issues/484,
+        # https://github.com/LuaJIT/LuaJIT/issues/653.
+        echo MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion) | tee -a $GITHUB_ENV
+    - name: Install build and test dependencies
+      shell: bash
+      run: |
+        # Install brew using the command from Homebrew repository
+        # instructions: https://github.com/Homebrew/install.
+        # XXX: 'echo' command below is required since brew
+        # installation script obliges the one to enter a newline
+        # for confirming the installation via Ruby script.
+        brew update ||
+          echo | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+        # Try to install the packages either upgrade it to avoid
+        # of fails if the package already exists with the previous
+        # version.
+        brew install --force ${CC_FORMULA} cmake make ninja perl ||
+          brew upgrade ${CC_FORMULA} cmake make ninja perl
+    - name: Set specific C compiler as a default toolchain for cmake
+      shell: bash
+      env:
+        CC_NAME: ${{ inputs.cc_name }}
+      run: |
+        echo CMAKE_C_COMPILER=${CC_NAME} | tee -a $GITHUB_ENV
+        echo CMAKE_PREFIX_PATH="`brew --prefix ${CC_FORMULA}`" | tee -a $GITHUB_ENV
+    - name: Log installed compilers
+      shell: bash
+      run: |
+        echo default clang: `clang --version`
+        echo default gcc: `gcc --version`
+        echo cmake compiler: `${CMAKE_PREFIX_PATH}/bin/${CMAKE_C_COMPILER} --version`
diff --git a/.github/workflows/sanitizers-testing.yml b/.github/workflows/sanitizers-testing.yml
index 4bf7d023..fe550b81 100644
--- a/.github/workflows/sanitizers-testing.yml
+++ b/.github/workflows/sanitizers-testing.yml
@@ -31,17 +31,41 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        # XXX: Let's start with only Linux/x86_64
+        ARCH: [ARM64, x86_64]
         BUILDTYPE: [Debug, Release]
-        CC: [gcc-10, clang-11]
+        OS: [Linux, macOS]
+        # There are different top-level versions available for Linux and macOS runners.
+        CC: [gcc-10, clang-11, gcc-15, clang-21]
         include:
           - BUILDTYPE: Debug
             CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON
           - BUILDTYPE: Release
             CMAKEFLAGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    runs-on: [self-hosted, regular, Linux, x86_64]
+        exclude:
+          # On current runners with Linux/ARM64 environment and
+          # with LUAJIT_USE_SYSMALLOC=ON the system allocator returns addresses
+          # with 48-bit set. Thus checkptrGC() fails with new Lua state pointer
+          # and luajit fails to start with 'cannot create state: not enough memory'
+          # error. So, we exclude these cases.
+          - ARCH: ARM64
+            OS: Linux
+          # Exclude nonsuitable OS/compiler pairs.
+          - OS: macOS
+            CC: gcc-10
+          - OS: macOS
+            CC: clang-11
+          - OS: Linux
+            CC: gcc-15
+          - OS: Linux
+            CC: clang-21
+          # Exclude macOS/ARM64/gcc case due to some tests are failed.
+          # Details: https://github.com/tarantool/tarantool/issues/13018
+          - ARCH: ARM64
+            OS: macOS
+            CC: gcc-15
+    runs-on: [self-hosted, regular, '${{ matrix.OS }}', '${{ matrix.ARCH }}']
     name: >
-      LuaJIT with ASan and UBSan (Linux/x86_64)
+      LuaJIT with ASan and UBSan (${{ matrix.OS }}/${{ matrix.ARCH }})
       ${{ matrix.BUILDTYPE }}
       CC:${{ matrix.CC }}
       GC64:ON SYSMALLOC:ON
@@ -51,7 +75,13 @@ jobs:
           fetch-depth: 0
           submodules: recursive
       - name: setup Linux for sanitizers
-        uses: ./.github/actions/setup-sanitizers
+        if: ${{ matrix.OS == 'Linux' }}
+        uses: ./.github/actions/setup-sanitizers-linux
+        with:
+          cc_name: ${{ matrix.CC }}
+      - name: setup macOS for sanitizers
+        if: ${{ matrix.OS == 'macOS' }}
+        uses: ./.github/actions/setup-sanitizers-macos
         with:
           cc_name: ${{ matrix.CC }}
       - name: configure
@@ -70,18 +100,46 @@ jobs:
           cmake -S . -B ${{ env.BUILDDIR }}
           -G Ninja
           ${{ matrix.CMAKEFLAGS }}
+          -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+          -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
           -DLUAJIT_ENABLE_GC64=ON
           -DLUAJIT_USE_ASAN=ON
           -DLUAJIT_USE_SYSMALLOC=ON
           -DLUAJIT_USE_UBSAN=ON
+      - name: Check for possible compiler misconfig
+        working-directory: ${{ env.BUILDDIR }}
+        env:
+          CC_NAME: ${{ matrix.CC }}
+        run: grep CMakeCache.txt -e CMAKE_C_COMPILER:STRING | grep ${CC_NAME}
       - name: build
         run: cmake --build . --parallel
         working-directory: ${{ env.BUILDDIR }}
-      - name: test
+
+      # Enable as much checks as possible. See more info here:

You say about enabling ASAN features, but some features are disabled below,

please explain why these features are disabled.

+      # https://github.com/google/sanitizers/wiki/AddressSanitizerFlags,
+      # https://github.com/google/sanitizers/wiki/SanitizerCommonFlags.
+      - name: setup sanitizer options for Linux
+        if: ${{ matrix.OS == 'Linux' }}
+        env:
+          ASAN_OPTIONS: "                    \
+            detect_invalid_pointer_pairs=1:  \
+            detect_leaks=1:                  \
already enabled by default
+            detect_stack_use_after_return=1: \
+            dump_instruction_bytes=1:        \
+            heap_profile=0:                  \
disabled by default
+            print_suppressions=0:            \
Why disabled?
+            symbolize=1:                     \
enabled by default
The patch doesn’t enable ASAN for Linux, so this part isn’t changed: the ASAN options for Linux is used as is.
 
The ASAN options for macOS is just a copy of the Linux options with one exception. The detect_leaks was disabled with the explanation in a comment.
 
The full option investigation and selection in not the main goal of the patch. The patch enables ASAN for macOS and it’s truly enabled for the options selected.
 
I agree that the actualization of options for both Linux and macOS is a valuable job. I suggest to make a ticket for it.
+            unmap_shadow_on_exit=1:          \
+          "
+          UBSAN_OPTIONS: "
+            print_stacktrace=1 \
+          "
+        run: |
+          echo ASAN_OPTIONS=${ASAN_OPTIONS} | tee -a $GITHUB_ENV
+          echo UBSAN_OPTIONS=${UBSAN_OPTIONS} | tee -a $GITHUB_ENV
s/tee -a/>>/ (the same thing but usually used in Github documentation)
Answered above.
+      - name: setup sanitizer options for macOS (common)
+        if: ${{ matrix.OS == 'macOS' && matrix.ARCH != 'ARM64' && matrix.CC != 'clang-21' }}
         env:
-          # Enable as much checks as possible. See more info here:
-          # https://github.com/google/sanitizers/wiki/AddressSanitizerFlags,
-          # https://github.com/google/sanitizers/wiki/SanitizerCommonFlags.
           ASAN_OPTIONS: "                    \
             detect_invalid_pointer_pairs=1:  \
             detect_leaks=1:                  \
@@ -95,5 +153,30 @@ jobs:
           UBSAN_OPTIONS: "
             print_stacktrace=1 \
           "
+        run: |
+          echo ASAN_OPTIONS=${ASAN_OPTIONS} | tee -a $GITHUB_ENV
+          echo UBSAN_OPTIONS=${UBSAN_OPTIONS} | tee -a $GITHUB_ENV
s/tee -a/>>/
The same.
+      - name: setup sanitizer options for macOS (ARM64/clang-21)
+        if: ${{ matrix.OS == 'macOS' && matrix.ARCH == 'ARM64' && matrix.CC == 'clang-21' }}
+        # detect_leaks is disabled due to some tests build is failed.
+        # Details: https://github.com/tarantool/tarantool/issues/13019
+        env:
+          ASAN_OPTIONS: "                    \
+            detect_invalid_pointer_pairs=1:  \
+            detect_leaks=0:                  \
+            detect_stack_use_after_return=1: \
+            dump_instruction_bytes=1:        \
+            heap_profile=0:                  \
+            print_suppressions=0:            \
+            symbolize=1:                     \
+            unmap_shadow_on_exit=1:          \
the same questions as above. Also, can we avoid duplication?
May be we can use the file to accumulate the options and to update it in a specific steps. I suggest this task to the new ticket ‘ci: actualization of the ASAN options for Linux and macOS’ also.
+          "
+          UBSAN_OPTIONS: "
+            print_stacktrace=1 \
+          "
+        run: |
+          echo ASAN_OPTIONS=${ASAN_OPTIONS} | tee -a $GITHUB_ENV
+          echo UBSAN_OPTIONS=${UBSAN_OPTIONS} | tee -a $GITHUB_ENV
s/tee -a/>>/
Answered above.
+      - name: test
         run: cmake --build . --parallel --target LuaJIT-test
         working-directory: ${{ env.BUILDDIR }}
The changes applied:

diff --git a/.github/actions/setup-sanitizers-linux/action.yml b/.github/actions/setup-sanitizers-linux/action.yml
index 9744e5dd..19314dca 100644
--- a/.github/actions/setup-sanitizers-linux/action.yml
+++ b/.github/actions/setup-sanitizers-linux/action.yml
@@ -28,7 +28,7 @@ runs:
       shell: bash
       env:
         CC_NAME: ${{ inputs.cc_name }}
-    - name: Set specific C compiler as a default toolchain for cmake
+    - name: Set specific C compiler as a default toolchain for CMake.
       run: |
         echo CMAKE_C_COMPILER=${CC_NAME} | tee -a $GITHUB_ENV
       shell: bash
diff --git a/.github/actions/setup-sanitizers-macos/action.yml b/.github/actions/setup-sanitizers-macos/action.yml
index d2160faa..740943af 100644
--- a/.github/actions/setup-sanitizers-macos/action.yml
+++ b/.github/actions/setup-sanitizers-macos/action.yml
@@ -35,7 +35,7 @@ runs:
         # of fails if the package already exists with the previous
         # version.
         brew install --force ${CC_FORMULA} || brew upgrade ${CC_FORMULA}
-    - name: Set specific C compiler as a default toolchain for cmake
+    - name: Set specific C compiler as a default toolchain for CMake.
       shell: bash
       env:
         CC_NAME: ${{ inputs.cc_name }}
--
Best regards,
Evgeniy Temirgaleev
--------------LhsXJYDOuhtm6urpUXpccQ0l--