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 ADF57673961; Mon, 23 Oct 2023 12:26:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ADF57673961 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1698053198; bh=jaWYBXWF3YIG5LWZfefyJ4/Hfgzk3aZJslRR5qTcics=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=jyedDtOAtqW1i6SAbD1mRW9zNDP9OdlPzHd0EbRmvh6+jwSaVOHwwI0aCMBBEGxNY 8pI89dnpouSmX7SZCjuNO29ig1DyGvLcYoSw2siL8oCyK8Jopgmv97o7Bcc6cNVCmg NqwyNeNHuCmS6LFMlVVBJeW/5/GGDDUv+FsLRbwg= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 25C5666C07F for ; Mon, 23 Oct 2023 12:26:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 25C5666C07F Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1qurCm-0007cl-4l; Mon, 23 Oct 2023 12:26:36 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Mon, 23 Oct 2023 12:22:00 +0300 Message-ID: X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9C197A170B57C5E43F7474F4ECFA9392267A44C609B53F3BE00894C459B0CD1B91E5CAE50CCEC67468628780082DC793908F89D8EC0FEE90FB51ED77CA72DA256 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE702C8878A98595F58EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063794BAA5DA89D799D78638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8BB48ABF6DA53F3AEDE317AF4CF07C1D7117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3A703B70628EAD7BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18BDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269176DF2183F8FC7C0C70DDB8F70474A6A68655334FD4449CB33AC447995A7AD1857739F23D657EF2BD5E8D9A59859A8B679E85A9FDE02C04A75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5BE40CE0E8F52EB06F5A1C08BD931AD5FD1183A95BB7D6BF1F87CCE6106E1FC07E67D4AC08A07B9B065B78C30F681404D9C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742DC8270968E61249B1004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D346EDE9E12965E8CD57AFDC9D2BD57A24152234B564B352D46EDFF5AE859EA5503DA1ED59414E170721D7E09C32AA3244CFB9CE55409D61B8008901A116D3B0EFB250262A5EE9971B0BAD658CF5C8AB4025DA084F8E80FEBD3202CD0F03380D9577A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXiRfZOux3JH3CGkQa/QUzUZ X-DA7885C5: 7151158F76C336337C62A0077695275C64891E93C094ACD5A8EC1FB796A5C68E262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986BFEE39FC835F5360F0326D75A20B544880FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 0/6] FFI fixes 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" This patchset is an umbrella for all FFI fixes and refactoring to be done in #9145. The first patch is a refactoring, and it will be useful for us when we do #4738. The next two patches are just some FFI bugs to be fixed. The last three patches are minor fixes use-after-free references of the `cts->tab` objects. Branch: https://github.com/tarantool/luajit/tree/skaplun/ffi-fixes Tarantool PR: https://github.com/tarantool/tarantool/pull/9285 Related issues: * https://github.com/LuaJIT/LuaJIT/issues/745 * https://github.com/LuaJIT/LuaJIT/issues/920 * https://github.com/LuaJIT/LuaJIT/issues/1108 * https://github.com/tarantool/tarantool/issues/9145 * https://github.com/tarantool/tarantool/issues/4738 Mike Pall (6): Abstract out on-demand loading of FFI library. FFI: Fix missing cts->L initialization in argv2ctype(). FFI: Ensure returned string is alive in ffi.typeinfo(). FFI: Fix dangling reference to CType. FFI: Fix dangling reference to CType. Improve checks. FFI: Fix dangling reference to CType in carith_checkarg(). src/lib_ffi.c | 1 + src/lib_jit.c | 6 +- src/lj_bcread.c | 6 +- src/lj_carith.c | 4 + src/lj_cconv.c | 2 + src/lj_crecord.c | 6 +- src/lj_ctype.c | 12 +++ src/lj_ctype.h | 10 +++ src/lj_lex.c | 6 +- .../fix-argv2ctype-cts-L-init.test.lua | 15 ++++ .../fix-argv2ctype-cts-L-init/script.lua | 14 ++++ .../fix-dangling-reference-to-ctype.test.lua | 59 ++++++++++++++ ...8-fix-dangling-reference-to-ctype.test.lua | 67 ++++++++++++++++ .../lj-745-ffi-typeinfo-dead-names.test.lua | 28 +++++++ ...0-fix-dangling-reference-to-ctype.test.lua | 77 +++++++++++++++++++ 15 files changed, 297 insertions(+), 16 deletions(-) create mode 100644 test/tarantool-tests/fix-argv2ctype-cts-L-init.test.lua create mode 100644 test/tarantool-tests/fix-argv2ctype-cts-L-init/script.lua create mode 100644 test/tarantool-tests/fix-dangling-reference-to-ctype.test.lua create mode 100644 test/tarantool-tests/lj-1108-fix-dangling-reference-to-ctype.test.lua create mode 100644 test/tarantool-tests/lj-745-ffi-typeinfo-dead-names.test.lua create mode 100644 test/tarantool-tests/lj-920-fix-dangling-reference-to-ctype.test.lua -- 2.42.0