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 EB1E2165DDE4; Mon, 30 Mar 2026 12:37:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EB1E2165DDE4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1774863441; bh=e6c4YCms2tSUlDfu2TXgcDet77F4wx3dHy7+CLOaYFY=; 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=DOm1QMVfnXBB9uyaj7+NyZt6DLsQlMs5mbBgMl1ag7mEC5KQnNHlOFboChqrho4YY 0nwE+vovQnyXOcbCpIEwBHAqowaQQ4S555xUDH6f6chR7JlhMB8/rlHE/qFN5x3Usv 7hAmhwZOwNGjzkqzZxvkfY3smKlgCPVu5J1IMnzg= Received: from send149.i.mail.ru (send149.i.mail.ru [89.221.237.244]) (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 293F1165DDE4 for ; Mon, 30 Mar 2026 12:37:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 293F1165DDE4 Received: by exim-smtp-74865f89dd-b8xpv with esmtpa (envelope-from ) id 1w793e-00000000OCQ-0Rz0; Mon, 30 Mar 2026 12:37:18 +0300 Date: Mon, 30 Mar 2026 12:38:15 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <7c96f2917ce5525a7799a1f327e0981d9a59f84f.1774711616.git.skaplun@tarantool.org> <9c87e62e-b75e-4713-be59-c6036eb9fc4b@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c87e62e-b75e-4713-be59-c6036eb9fc4b@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9BB347BE606964F7A08BD4DDDC91FFFAA2A8A1AD19D1BD35D182A05F538085040B88517EDADF3B9E03DE06ABAFEAF67055F049301C8541F60D477F7E85AEB65420CC985FF34F4B040 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F544D30F1A6FA191EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FE9EFE935CD7C6AE8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2469C940D2B51AA9E2E070BE324C7D3C4EDB0E3DB54CCB057F6B57BC7E64490618DEB871D839B73339E8FC8737B5C22495FF0BFC5AEE34BE6CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C05A64D9A1E9CA65708941B15DA834481F9449624AB7ADAF37BA3038C0950A5D3613377AFFFEAFD269176DF2183F8FC7C0872F3B397916FE8B7B076A6E789B0E97A8DF7F3B2552694AD5FFEEA1DED7F25D49FD398EE364050F140C956E756FBB7A452896749CDDA0A6B3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BAEB924C2B054B06E75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5D2BE706EA15CA4C95002B1117B3ED696A337DFCEC0AD5EC14869453249F34FA4823CB91A9FED034534781492E4B8EEAD4ECBDE8281F904F9BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D6591A83A196D2D0F9AD5AEFF7DD529CB8E7E7F0F96CFEA8B0A88874546433BC31D3430820914B41AF27B8341EE9D5BE9A0A2E29A6E907370E2C78D544550AC04E4674A0F23C3DCA11588CD93680B12512CF4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdx/hWl0/CTmG2bvKL96KU0= X-Mailru-Sender: 520A125C2F17F0B17094CDC02B85F11BD6792B7341A59ABC3DE06ABAFEAF67055F049301C8541F60B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] Run VM events and finalizers in separate state. 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 review! Fixed your comment and force-pushed the branch. On 30.03.26, Sergey Bronnikov wrote: > Hi, Sergey! > > thanks for the patch! LGTM with a minor comment below. > > Sergey > > On 3/28/26 18:31, Sergey Kaplun wrote: > > > > > > diff --git a/test/tarantool-tests/lj-1403-vmevent-crash-on-stkov.test.lua b/test/tarantool-tests/lj-1403-vmevent-crash-on-stkov.test.lua > > new file mode 100644 > > index 00000000..ad275e17 > > --- /dev/null > > +++ b/test/tarantool-tests/lj-1403-vmevent-crash-on-stkov.test.lua > > @@ -0,0 +1,47 @@ > > +local tap = require('tap') > > + > > +-- The test file to demonstrate LuaJIT crash during stack overflow > > +-- in the VM event handle. > > +-- See also,https://github.com/LuaJIT/LuaJIT/issues/1403. > > + > > +local test = tap.test('lj-1403-vmevent-crash-on-stkov'):skipcond({ > > + ['Test requires JIT enabled'] = not jit.status(), > > +}) > > + > > +test:plan(1) > > + > > +local jit_dump = require('jit.dump') > > + > > +-- XXX: Some specific stack usage without a stack top check by the > > +-- Lua function header. > > +local t = setmetatable({}, {__newindex = pcall, __call = type}) > > reproduced without __call metamethod, please add a comment with explanation > > why it is needed Removed: =================================================================== diff --git a/test/tarantool-tests/lj-1403-vmevent-crash-on-stkov.test.lua b/test/tarantool-tests/lj-1403-vmevent-crash-on-stkov.test.lua index ad275e17..6812c330 100644 --- a/test/tarantool-tests/lj-1403-vmevent-crash-on-stkov.test.lua +++ b/test/tarantool-tests/lj-1403-vmevent-crash-on-stkov.test.lua @@ -14,7 +14,7 @@ local jit_dump = require('jit.dump') -- XXX: Some specific stack usage without a stack top check by the -- Lua function header. -local t = setmetatable({}, {__newindex = pcall, __call = type}) +local t = setmetatable({}, {__newindex = pcall}) -- luacheck: no unused local function prober(...) -- Invokes `pcall(t, t, t)`. =================================================================== > > > +-- luacheck: no unused > > +local function prober(...) > > + -- Invokes `pcall(t, t, t)`. > > + t[t] = t > > +end > > + > > +jit.opt.start('hotloop=1') > > +-- Need the invocation of the VM event. > > +jit_dump.start('i', '/dev/null') > > + > > +-- The code below causes the stack overflow in the VM event > > +-- handler. The unwinding of the error breaks the JIT semantics > > +-- and leads to a crash. > > +local function looper() > > + local r = pcall(prober) > > + if not r then > > + local n = 1 > > + while n < 3 do > > + prober(1, 2) > > + n = n + 1 > > + end > > + end > > + looper() > > +end > > + > > +pcall(coroutine.wrap(looper)) > > + > > +test:ok(true, 'no crash') > > + > > +test:done(true) -- Best regards, Sergey Kaplun