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 13C3965341F; Wed, 25 Oct 2023 13:51:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 13C3965341F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1698231062; bh=hG/4tjPUu9irrKdDmOeHi8wR7IGC0EzRCp0ZNvIztd4=; 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=CjdwbsgYx9AxoG56V2kPn2Rb3FBbEVSt03hAg4P8ef3tgNPgChtRUYOW4V2gpti+q tOCNPbqOwAXWDfhkC0k7E7QBl2O+NWWLOASJf95Z4qWr5Ul/tuhpoYvDv79UywNJn3 ztYqQQ4Gg0BFnkfNFW77tAFq0vf+DBd9Rd080D98= 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 6FB7765341F for ; Wed, 25 Oct 2023 13:51:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6FB7765341F Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1qvbTX-0003tl-AK; Wed, 25 Oct 2023 13:50:59 +0300 Date: Wed, 25 Oct 2023 13:46:29 +0300 To: Maxim Kokryashkin 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: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9315D6E1B1B5C3D6DC232CB6F24005D11807874EA19E1CCF400894C459B0CD1B97F77B8B48885215AE6EB8A04E8575F4DFFC1AB2505DEBAB9E87099420498248C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7370F4F695FFFC24BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AAF0FBE7E77B7ED78638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D85C64D943959E496250F6EDA42EAA77C0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD182CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269176DF2183F8FC7C0C70DDB8F70474A6A68655334FD4449CB33AC447995A7AD186D8C47C27EEC5E9FD5E8D9A59859A8B699FC562817B5DAD0089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A547B1CA0B4253A2962E25512FB1578CB9748168BDDF06547FF87CCE6106E1FC07E67D4AC08A07B9B082B967D547A19D2FCB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D347215713CF3EEE9D1C49E4B9C447746A848113A567BEA191073823D41716455A4FAD958A4DCEBB7681D7E09C32AA3244CF504D96ABE1EEF4028C56472E7888C1955E75C8D0ED9F6EE85A42E4C463514DC5DA084F8E80FEBD3202CD0F03380D9577A83BD0C44CE203720ABEDE4BBDD9CDD X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj7UiV2qa299o31G7OwlZS+Q== X-DA7885C5: 9B6A6140F457DEBF6C3B4493B31FF9537D9045D01EAF8C507C70D517DD61EA05262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73930F533AC2B33E986B8D277AE806A9151A4EC864DE76607D000FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 5/6] FFI: Fix dangling reference to CType. Improve checks. 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, Maxim! Thanks for the review! On 25.10.23, Maxim Kokryashkin wrote: > Hi, Sergey! > Thanks for the patch! > LGTM, after answering the same questions as for the previous patch. > On Mon, Oct 23, 2023 at 12:22:05PM +0300, Sergey Kaplun wrote: See the iterative patch below, branch is force pushed: =================================================================== diff --git a/test/tarantool-tests/lj-920-fix-dangling-reference-to-ctype.test.lua b/test/tarantool-tests/lj-920-fix-dangling-reference-to-ctype.test.lua index a7e35888..0b8be04f 100644 --- a/test/tarantool-tests/lj-920-fix-dangling-reference-to-ctype.test.lua +++ b/test/tarantool-tests/lj-920-fix-dangling-reference-to-ctype.test.lua @@ -11,7 +11,7 @@ test:plan(1) -- This test demonstrates LuaJIT's incorrect behaviour when the -- reallocation of `cts->tab` strikes during the recording of the -- cdata metamethod arithmetic. --- The test fails under ASAN. +-- Before the patch, the test failed only under ASAN. -- XXX: Just some C functions to be casted. There is no need to -- declare their prototypes correctly. @@ -38,6 +38,9 @@ local _ = ffi.new('struct {int a; long b; float c; double d;}', 0) -- Anchor table to prevent cdata objects from being collected. local anchor = {} -- Each call to this function grows `cts->top` by 3. +-- `lj_ctype_new()` and `lj_ctype_intern()` during the parsing of +-- the `CType` declaration in the `ffi.cast()` plus +-- `lj_ctype_intern()` during the conversion to another `CType`. local function save_new_func(func) anchor[#anchor + 1] = ffi.cast('void (*)(void)', func) end =================================================================== -- Best regards, Sergey Kaplun