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 585C413EBF55; Fri, 6 Jun 2025 18:31:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 585C413EBF55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1749223866; bh=0Lhxr82bEHxNBu6H32omC80S2hcBUMEACGeR+lmfpqg=; 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=dNaqWkzVXj7g6JB8phQOM4mBZmV/DX5g9x5nHSZDeZKI7fTJh0nxvn/SvSpwSZDCO OFXUcH8tF4VSgva1uLb1+ctJfDIF5sH4wSdVSkmzFUDo0goBRtAefH2MX62VzkXTq+ ga5fuYbGXhW+81NJr5e1KJxQjEQfcrPDA8nUzWzQ= Received: from send217.i.mail.ru (send217.i.mail.ru [95.163.59.56]) (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 36DA013EBF58 for ; Fri, 6 Jun 2025 18:31:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 36DA013EBF58 Received: by exim-smtp-567cc788d4-2fngb with esmtpa (envelope-from ) id 1uNZ28-00000000WrD-1XQL; Fri, 06 Jun 2025 18:31:04 +0300 Date: Fri, 6 Jun 2025 18:31:08 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD95E97EA1894635BC3577730E5842974C3685F41BE2997D50B182A05F5380850404029E4E9883FB9E73DE06ABAFEAF670566E7D969095957FA7A4314C45CEF4668906DE0852CB23DE4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7BCC85671EC7A750CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB5533756680FD86C7FE90CFE50C62FCA08F6E0D331BED0CA044B25B9B71254EA8DA35E49D389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7B2B7C64F398C7410731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5DF96EB3A4E2509185002B1117B3ED6966EB8838DDE6CAB1BA9DAB4B68AE4D22F823CB91A9FED034534781492E4B8EEAD8D8BB953E4894305BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF308AD4082915FF5036340E1A2E6E8236151778308E00DD68B44C469E3C70C1F41EB2640544212C894322DC41441C31F070476817152598678F8502586D300529382C0EDFB1B7EE21111DC66A97D0BFE2913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVSykAyseJQ6/XntGzfLG0qc= X-DA7885C5: 4D99521C46B5385CF255D290C0D534F93655436FE6F9A733315E668F34B13B984419F0F23B553AD35B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393FE9E42A757851DB62ADBBDD4B9B9AD58F338F81AC3AE0CCCE632D339558D1525E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/3] ci: add track-fds Valgrind scenario 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the reply! Please see my answer below. On 06.06.25, Sergey Bronnikov wrote: > Hi, Sergey, > > > On 6/6/25 17:03, Sergey Kaplun wrote: > > Hi, Sergey! > > Thanks for the review! > > Please consider my answers below. > > > > On 06.06.25, Sergey Bronnikov wrote: > >> Hello, Sergey, > >> > >> Thanks for the patch! See my comments below. > >> > >> On 6/5/25 08:44, Sergey Kaplun wrote: > >>> This patch adds a new field, track-fds [1], in the Valgrind workflow > >>> matrix to detect descriptor leakage in the tests. > >>> > >>> [1]:https://valgrind.org/docs/manual/manual-core.html#opt.track-fds > >>> > >>> Needed for tarantool/tarantool#11278 > >>> --- > >>> .github/workflows/valgrind-testing.yaml | 9 ++++++++- > >>> 1 file changed, 8 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/.github/workflows/valgrind-testing.yaml b/.github/workflows/valgrind-testing.yaml > >>> index e6606478..b3c7bc80 100644 > >>> --- a/.github/workflows/valgrind-testing.yaml > >>> +++ b/.github/workflows/valgrind-testing.yaml > >>> @@ -59,6 +63,9 @@ jobs: > >>> - VALGRIND_SCENARIO: malloc-free-fill-0xff > >>> VALGRIND_OPTS: --leak-check=no --malloc-fill=0xff --free-fill=0xff > >>> JOB_POSTFIX: "malloc/free-fill: 0xff" > >>> + - VALGRIND_SCENARIO: track-fds > >> According to documentation, the option "print out a list of open file > >> descriptors on exit or on request". > >> > >> So the fd leak detection is semi-automated. How it should work on CI? > > The fd not checked on exit without this flag. I suppose the wording in > > the Valgrind's documentation isn't perfect. > > > > You may test it locally with and without the corresponding flag in > > the`VALGRIND_OPTS` env variable. > > FD leak is detected but test is passed: > > > UpdateCTestConfiguration  from > :/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/DartConfiguration.tcl > UpdateCTestConfiguration  from > :/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/DartConfiguration.tcl > Test project > /home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64 > Constructing a list of tests > Done constructing a list of tests > Updating test list for fixtures > Added 0 tests to meet fixture requirements > Checking test dependency graph... > Checking test dependency graph end > test 154 >     Start 154: test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua > > 154: Test command: /bin/valgrind "--leak-check=no" "--track-fds=yes" > "--error-exitcode=1" > "--suppressions=/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj.supp" > "--suppressions=/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/lj_extra.supp" > "/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/src/luajit" > "-e" > "dofile[[/home/sergeyb/sources/MRG/tarantool/third_party/luajit/test/luajit-test-init.lua]]" > "/home/sergeyb/sources/MRG/tarantool/third_party/luajit/test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua" > 154: Working Directory: > /home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/test/tarantool-tests > 154: Environment variables: > 154: > LUA_PATH=/home/sergeyb/sources/MRG/tarantool/third_party/luajit/test/tarantool-tests/?.lua;/home/sergeyb/sources/MRG/tarantool/third_party/luajit/test/tarantool-tests/?/init.lua;/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/?.lua;/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/src/?.lua;; > 154:  LUAJIT_TEST_USE_VALGRIND=1 > 154: > LUA_CPATH=/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/test/tarantool-tests/utils/?.so; > 154: > LD_LIBRARY_PATH=/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/test/tarantool-tests/utils: > 154: Test timeout computed to be: 10000000 > 154: ==2176604== Memcheck, a memory error detector > 154: ==2176604== Copyright (C) 2002-2022, and GNU GPL'd, by Julian > Seward et al. > 154: ==2176604== Using Valgrind-3.22.0 and LibVEX; rerun with -h for > copyright info > 154: ==2176604== Command: > /home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/src/luajit > -e > dofile[[/home/sergeyb/sources/MRG/tarantool/third_party/luajit/test/luajit-test-init.lua]] > /home/sergeyb/sources/MRG/tarantool/third_party/luajit/test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua > 154: ==2176604== > 154: TAP version 13 > 154: 1..4 > 154: ok - correct status, OOM on filename creation > 154: ok - correct error message, OOM on filename creation > 154: ok - correct status, OOM on error message creation > 154: ok - correct error message, OOM on error message creation > 154: ==2176604== > 154: ==2176604== FILE DESCRIPTORS: 5 open (3 std) at exit. > 154: ==2176604== Open file descriptor 4: /dev > 154: ==2176604==    at 0x4ABB175: open (open64.c:41) > 154: ==2176604==    by 0x4A31B0E: _IO_file_open (fileops.c:188) > 154: ==2176604==    by 0x4A31E51: _IO_file_fopen@@GLIBC_2.2.5 > (fileops.c:281) > 154: ==2176604==    by 0x4A25EE1: __fopen_internal (iofopen.c:75) > 154: ==2176604==    by 0x4A25EE1: fopen@@GLIBC_2.2.5 (iofopen.c:86) > 154: ==2176604==    by 0x1FAB1E: luaL_loadfilex (src/lj_load.c:92) > 154: ==2176604==    by 0x217F18: lj_cf_loadfile (src/lib_base.c:384) > 154: ==2176604==    by 0x2A19B9: lj_BC_FUNCC > (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/src/lj_vm.S:899) > 154: ==2176604==    by 0x1E7C81: lua_pcall (src/lj_api.c:1173) > 154: ==2176604==    by 0x1D738F: docall (src/luajit.c:134) > 154: ==2176604==    by 0x1D6E56: handle_script (src/luajit.c:304) > 154: ==2176604==    by 0x1D615B: pmain (src/luajit.c:602) > 154: ==2176604==    by 0x2A19B9: lj_BC_FUNCC > (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/src/lj_vm.S:899) > 154: ==2176604== > 154: ==2176604== Open file descriptor 3: > /home/sergeyb/sources/MRG/tarantool/third_party/luajit/build/gc64/Testing/Temporary/LastTest.log.tmp > 154: ==2176604==    > 154: ==2176604== > 154: ==2176604== > 154: ==2176604== HEAP SUMMARY: > 154: ==2176604==     in use at exit: 472 bytes in 1 blocks > 154: ==2176604==   total heap usage: 1,253 allocs, 1,252 frees, 179,771 > bytes allocated > 154: ==2176604== > 154: ==2176604== For a detailed leak analysis, rerun with: --leak-check=full > 154: ==2176604== > 154: ==2176604== For lists of detected and suppressed errors, rerun with: -s > 154: ==2176604== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 67 > from 18) > 1/1 Test #154: test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua > ... Passed    0.77 sec > > The following tests passed: >     test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua > > 100% tests passed, 0 tests failed out of 1 > > Label Time Summary: > tarantool-tests    =   0.77 sec*proc (1 test) > > Total Test time (real) =   0.79 sec Hm, this is weird: | UpdateCTestConfiguration from :/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/DartConfiguration.tcl | UpdateCTestConfiguration from :/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/DartConfiguration.tcl | Test project /home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak | Constructing a list of tests | Done constructing a list of tests | Updating test list for fixtures | Added 0 tests to meet fixture requirements | Checking test dependency graph... | Checking test dependency graph end | test 154 | Start 154: test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua | | 154: Test command: /usr/bin/valgrind "--error-exitcode=1" "--suppressions=/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/src/lj.supp" "--suppressions=/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/src/lj_extra.supp" "/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/src/luajit" "-e" "dofile[[/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/luajit-test-init.lua]]" "/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua" | 154: Working Directory: /home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/tarantool-tests | 154: Environment variables: | 154: LUA_PATH=/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/tarantool-tests/?.lua;/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/tarantool-tests/?/init.lua;/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/src/?.lua;/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/src/?.lua;; | 154: LUAJIT_TEST_USE_VALGRIND=1 | 154: LUA_CPATH=/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/tarantool-tests/utils/?.so; | 154: LD_LIBRARY_PATH=/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/tarantool-tests/utils: | 154: Test timeout computed to be: 10000000 | 154: ==22564== Memcheck, a memory error detector | 154: ==22564== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al. | 154: ==22564== Using Valgrind-3.25.1 and LibVEX; rerun with -h for copyright info | 154: ==22564== Command: /home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/src/luajit -e dofile[[/home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/luajit-test-init.lua]] /home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua | 154: ==22564== | 154: TAP version 13 | 154: 1..4 | 154: ok - correct status, OOM on filename creation | 154: ok - correct error message, OOM on filename creation | 154: ok - correct status, OOM on error message creation | 154: ok - correct error message, OOM on error message creation | 154: ==22564== | 154: ==22564== FILE DESCRIPTORS: 6 open (5 inherited) at exit. | 154: ==22564== Open file descriptor 4: /dev | 154: ==22564== at 0x4BB6640: open (in /lib64/libc.so.6) | 154: ==22564== by 0x4B39825: _IO_file_open (in /lib64/libc.so.6) | 154: ==22564== by 0x4B399C4: _IO_file_fopen@@GLIBC_2.2.5 (in /lib64/libc.so.6) | 154: ==22564== by 0x4B2DECC: __fopen_internal (in /lib64/libc.so.6) | 154: ==22564== by 0x40268AE: luaL_loadfilex (lj_load.c:92) | 154: ==22564== by 0x403C433: lj_cf_loadfile (lib_base.c:384) | 154: ==22564== by 0x40AF0E8: lj_BC_FUNCC (buildvm_x86.dasc:852) | 154: ==22564== by 0x40168B8: lua_pcall (lj_api.c:1173) | 154: ==22564== by 0x4008C21: docall (luajit.c:134) | 154: ==22564== by 0x400963A: handle_script (luajit.c:304) | 154: ==22564== by 0x400A559: pmain (luajit.c:602) | 154: ==22564== by 0x40AF0E8: lj_BC_FUNCC (buildvm_x86.dasc:852) | 154: ==22564== | 154: ==22564== | 154: ==22564== HEAP SUMMARY: | 154: ==22564== in use at exit: 472 bytes in 1 blocks | 154: ==22564== total heap usage: 1,248 allocs, 1,247 frees, 179,415 bytes allocated | 154: ==22564== | 154: ==22564== For a detailed leak analysis, rerun with: --leak-check=full | 154: ==22564== | 154: ==22564== For lists of detected and suppressed errors, rerun with: -s | 154: ==22564== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 66 from 18) | 1/1 Test #154: test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua ...***Failed 1.05 sec | | 0% tests passed, 1 tests failed out of 1 | | Label Time Summary: | tarantool-tests = 1.05 sec*proc (1 test) | | Total Test time (real) = 1.07 sec | | The following tests FAILED: | 154 - test/tarantool-tests/lj-1249-loadfile-fd-leak.test.lua (Failed) tarantool-tests | Errors while running CTest | Output from these tests are in: /home/burii/builds_workspace/luajit/lj-1249-loadfile-fd-leak/Testing/Temporary/LastTest.log | Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely. As you can see, `ERROR SUMMARY` is different from yours -- 1 error from 1 context. Also, I've tried multiple configurations, but all works the same. My valgrind version. | $ valgrind --version | valgrind-3.25.1 > > >>> + VALGRIND_OPTS: --leak-check=no --track-fds=yes > >>> + JOB_POSTFIX: "track-fds" > >>> runs-on: [self-hosted, regular, Linux, x86_64] > >>> name: > > >>> LuaJIT with Valgrind (Linux/x86_64) -- Best regards, Sergey Kaplun