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 235FF15138F0; Tue, 9 Sep 2025 12:43:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 235FF15138F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1757411028; bh=zsPlEpHUpqte9/d9pVrxOygERcCCLASsF3f5RaFLT4k=; 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=AUo2A3RWzQrr4DFhLSOGwhhom1HFH0yaok5C1zaj/lYOEuRm7xqJ56HSlhMwVB1m/ W4IXPk5UdPF7eG3lQ1Ua2yLOkhPWZNM9G9tAad4MBXWC5zntD/8xpfLC17a/Xik5iG jjLJfyq9RLie9ZGoTCYwljNaG4THhP9fQ0lcaqpU= Received: from send264.i.mail.ru (send264.i.mail.ru [95.163.59.103]) (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 F341715138EC for ; Tue, 9 Sep 2025 12:43:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F341715138EC Received: by exim-smtp-c584fb9f-pt7nf with esmtpa (envelope-from ) id 1uvusz-00000000BdB-0z4W; Tue, 09 Sep 2025 12:43:37 +0300 Content-Type: multipart/alternative; boundary="------------0vLJfcbbnaaBvqQ5gNdamw0Y" Message-ID: <9103d5ac-8b04-419e-a782-e7dd4b8c7d65@tarantool.org> Date: Tue, 9 Sep 2025 12:43:37 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <20250819074020.12306-1-skaplun@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD92FE000A65CB8EE9CB9E7CA6DB40EC00CFD5AD8708A9F8500182A05F5380850404C228DA9ACA6FE279E8F0FC9645314563DE06ABAFEAF67054D1AC86A24CF07740AF92DB94B250613AC22AB14350DA595 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7FCFCB92DA8654BB0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375661343631359B0F9D9806A8A1E135E35A8D1842B761E01D7C50D5BDBBDD0A017F8389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07734D68A6916D8318941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6A50BD5087FBFCDAACC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224958C1606C78F2434E76E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8B6A4E49BB0F3BA1413AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735B17145F0B7815491C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5F3D4CF85473091035002B1117B3ED696F5E57374E65E6B441A1B8FE1FED62FE8823CB91A9FED034534781492E4B8EEAD37F46C620FF2CAEEBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF5AA9EC715B1FFF49D1B471D53BEAF835F1376EEA1931EEE716B9660F69D9349AB9228B76B87D064D1E832756A85E66F7CC7876CC73C32BB3C0E88DDF6302573479BEA9515AEA496D111DC66A97D0BFE2913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdVMtzNxwZu5pn87C/cfkJQ= X-Mailru-Sender: 811C44EDE0507D1FE3AB2BB2D6096E355145215E61FCE01704DE63E6493D4605E157F920AC103D55E468F43E1288D057645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Correctly close VM state after early OOM during open. 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------0vLJfcbbnaaBvqQ5gNdamw0Y Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit LGTM, thanks! On 9/9/25 12:44, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the review! > Fixed your comment and force-pushed the branch. > > On 09.09.25, Sergey Bronnikov wrote: >> Hi, Sergey, >> >> thanks for the patch! LGTM with a minor comment. >> >> Sergey >> >> On 8/19/25 10:40, Sergey Kaplun wrote: > > >>> + /* >>> + * Check that there is no crash and the limit is small enough. >>> + */ >>> + lua_State *L = lua_newstate(limited_alloc_f, NULL); >> s/lua_State/const lua_State/ > Fixed, thanks! > > =================================================================== > diff --git a/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c b/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c > index 6c9cb2ca..fe91d5e9 100644 > --- a/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c > +++ b/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c > @@ -49,7 +49,7 @@ static int limited_memory_on_lua_newstate(void *test_state) > /* > * Check that there is no crash and the limit is small enough. > */ > - lua_State *L = lua_newstate(limited_alloc_f, NULL); > + const lua_State *L = lua_newstate(limited_alloc_f, NULL); > assert_true(L == NULL); > return TEST_EXIT_SUCCESS; > #endif > =================================================================== > >>> + assert_true(L == NULL); >>> + return TEST_EXIT_SUCCESS; >>> +#endif >>> +} >>> + >>> +#ifndef LJ_NO_UNWIND >>> +# define LJ_NO_UNWIND 0 >>> +#endif >>> + >>> +int main(void) >>> +{ >>> + /*Seehttps://github.com/LuaJIT/LuaJIT/issues/1311. */ >>> + if (!LJ_NO_UNWIND) >>> + return skip_all("Disabled for external unwinding build due to #1311"); >>> + const struct test_unit tgroup[] = { >>> + test_unit_def(limited_memory_on_lua_newstate), >>> + }; >>> + return test_run_group(tgroup, NULL); >>> +} --------------0vLJfcbbnaaBvqQ5gNdamw0Y Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

LGTM, thanks!

On 9/9/25 12:44, Sergey Kaplun wrote:
Hi, Sergey!
Thanks for the review!
Fixed your comment and force-pushed the branch.

On 09.09.25, Sergey Bronnikov wrote:
Hi, Sergey,

thanks for the patch! LGTM with a minor comment.

Sergey

On 8/19/25 10:40, Sergey Kaplun wrote:
<snipped>

+	/*
+	 * Check that there is no crash and the limit is small enough.
+	 */
+	lua_State *L = lua_newstate(limited_alloc_f, NULL);
s/lua_State/const lua_State/
Fixed, thanks!

===================================================================
diff --git a/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c b/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c
index 6c9cb2ca..fe91d5e9 100644
--- a/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c
+++ b/test/tarantool-c-tests/lj-1248-close-state-early-OOM.test.c
@@ -49,7 +49,7 @@ static int limited_memory_on_lua_newstate(void *test_state)
         /*
          * Check that there is no crash and the limit is small enough.
          */
-        lua_State *L = lua_newstate(limited_alloc_f, NULL);
+        const lua_State *L = lua_newstate(limited_alloc_f, NULL);
         assert_true(L == NULL);
         return TEST_EXIT_SUCCESS;
 #endif
===================================================================

+	assert_true(L == NULL);
+	return TEST_EXIT_SUCCESS;
+#endif
+}
+
+#ifndef LJ_NO_UNWIND
+#  define LJ_NO_UNWIND 0
+#endif
+
+int main(void)
+{
+	/* Seehttps://github.com/LuaJIT/LuaJIT/issues/1311. */
+	if (!LJ_NO_UNWIND)
+		return skip_all("Disabled for external unwinding build due to #1311");
+	const struct test_unit tgroup[] = {
+		test_unit_def(limited_memory_on_lua_newstate),
+	};
+	return test_run_group(tgroup, NULL);
+}

    
--------------0vLJfcbbnaaBvqQ5gNdamw0Y--