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 2D87713E9545; Fri, 6 Jun 2025 16:42:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2D87713E9545 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1749217352; bh=57HVupPwUiVAhbQEw3AvJY1m50/nmA7UInAlaU8K3nE=; 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=NhElgoD+P9zrrTvSjooVIzogCCaN00Wd/U14En0n2m/iz/354S6VXzVAn9Tt56XJD F7cbOVDybUN/83xsGI42TbSe+jnSTKpCXB8OFLIwHlNfMZKz6zrLodp6tab4DzJpyV tZ4bZKGJc2V1xrs4jO2uAoUbQTQvchrnuvm8+MO0= Received: from send266.i.mail.ru (send266.i.mail.ru [95.163.59.105]) (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 8A97E13E9541 for ; Fri, 6 Jun 2025 16:42:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8A97E13E9541 Received: by exim-smtp-567cc788d4-fdwz5 with esmtpa (envelope-from ) id 1uNXL4-00000000FVf-3N1z; Fri, 06 Jun 2025 16:42:31 +0300 Content-Type: multipart/alternative; boundary="------------128F9qPK4MqS5bmcgkzdXyzv" Message-ID: Date: Fri, 6 Jun 2025 16:42:30 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <20250425134215.8184-1-skaplun@tarantool.org> <4c846b1b-e15e-49a8-86a7-da857c7a5a5b@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9186843A488DB0002F5E220F3556F92296BF3943151A02FCB1313CFAB8367EF908E2BE116634AD74D8BE6E83D03FB9A5F411046492FDDF806FAB0A2EDA3BB6E77005ED9BD883009CB19B76541BFBA1C79 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C6068CE86C2B75F5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB5533756680FD86C7FE90CFE5CA2B8C3A4565BBB96E5B9444BBCC6C06B853944F7B202E6C389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6957A4DEDD2346B42CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224958C1606C78F2434E76E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8B6A4E49BB0F3BA1413AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735D2457FAF19517CF2C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A577BC0CCADE629EFF5002B1117B3ED696BD042F9A51E52FC5F5FEB6EB1EB183FD823CB91A9FED034534781492E4B8EEADA91A6E18C88C5E2F X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D342B8615F5CFAD9D02682C207D5A73834F131936B1B7D058F80C7A31251A91F3ED4DD0DD865EDE08841D7E09C32AA3244CA221797AD6FD74A677DD89D51EBB77429CA7AB25B419E74AEA455F16B58544A2E30DDF7C44BCB90DA5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVSykAyseJQ6/B3XDymUDXkA= X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D61408BE6E83D03FB9A5F411046492FDDF806217C4E8E5734A4F50152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Rework stack overflow handling. 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. --------------128F9qPK4MqS5bmcgkzdXyzv Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, LGTM with a comment below. Sergey On 6/6/25 16:40, Sergey Kaplun wrote: >>> diff --git a/test/LuaJIT-tests/lang/stackov.lua b/test/LuaJIT-tests/lang/stackov.lua >>> index 8afa86b4..b052ad80 100644 >>> --- a/test/LuaJIT-tests/lang/stackov.lua >>> +++ b/test/LuaJIT-tests/lang/stackov.lua >> I don't get why we need this change. With reverted patch this test is >> passed. > With reverted -- yes. But after reworking the stack overflow handling, > it is possible that there is no place on the stack to call the error > handler (in that case, `debug.traceback`). Since this thing looks like > implementation-defined behaviour, I prefer to make the test less strict. > Please add a message to the test or/and to the commit message. >>> @@ -31,13 +31,17 @@ end >>> do --- Base test. >>> local err, s = xpcall(f, debug.traceback) >>> assert(err == false) >>> - test_error_msg(f, s) >>> + -- There is no place on the stack to invoke the handler. >>> + -- Just test the error reason. >>> + assert(string.match(s, "stack overflow")) >>> end >>> >>> do --- Stack overflow with non-empty arg list. >>> local err, s = xpcall(g, debug.traceback, 1) >>> assert(err == false) >>> - test_error_msg(g, s) >>> + -- There is no place on the stack to invoke the handler. >>> + -- Just test the error reason. >>> + assert(string.match(s, "stack overflow")) >>> end >>> >>> do --- Vararg tail call with non-empty arg list. +slow > > --------------128F9qPK4MqS5bmcgkzdXyzv Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hello,

LGTM with a comment below.

Sergey

On 6/6/25 16:40, Sergey Kaplun wrote:

<snipped>

diff --git a/test/LuaJIT-tests/lang/stackov.lua b/test/LuaJIT-tests/lang/stackov.lua
index 8afa86b4..b052ad80 100644
--- a/test/LuaJIT-tests/lang/stackov.lua
+++ b/test/LuaJIT-tests/lang/stackov.lua
I don't get why we need this change. With reverted patch this test is 
passed.
With reverted -- yes. But after reworking the stack overflow handling,
it is possible that there is no place on the stack to call the error
handler (in that case, `debug.traceback`). Since this thing looks like
implementation-defined behaviour, I prefer to make the test less strict.

Please add a message to the test or/and to the commit message.
@@ -31,13 +31,17 @@ end
  do --- Base test.
    local err, s = xpcall(f, debug.traceback)
    assert(err == false)
-  test_error_msg(f, s)
+  -- There is no place on the stack to invoke the handler.
+  -- Just test the error reason.
+  assert(string.match(s, "stack overflow"))
  end
  
  do --- Stack overflow with non-empty arg list.
    local err, s = xpcall(g, debug.traceback, 1)
    assert(err == false)
-  test_error_msg(g, s)
+  -- There is no place on the stack to invoke the handler.
+  -- Just test the error reason.
+  assert(string.match(s, "stack overflow"))
  end
  
  do --- Vararg tail call with non-empty arg list. +slow
<snipped>

--------------128F9qPK4MqS5bmcgkzdXyzv--