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 9DDED6EC55; Fri, 11 Jun 2021 11:09:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9DDED6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623398962; bh=UfqZXXb4huMlYYCX0pT3tWabMUaS4J+rdESsWunTeSQ=; 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=CuNH3IYcMf26imordJrxhpqoNxD1kWeZFWv1PjsOEvtEzN40mxe0DA205iwApbTxZ OUQyTAuCYCecbh83YnEkXV+yfBrP+ZiA6Avf0NckuOv+8F6LH9q3ROsARFzd+UkF50 nMdtqwlV1J4PUA3kM+FW71sB1M6kdOMORKXeplaE= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 731A86EC55 for ; Fri, 11 Jun 2021 11:09:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 731A86EC55 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lrcEC-0003IE-Hl; Fri, 11 Jun 2021 11:09:20 +0300 Date: Fri, 11 Jun 2021 11:08:08 +0300 To: Igor Munkin Message-ID: References: <20210610135243.GA3944@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210610135243.GA3944@tarantool.org> X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D5B0DA836B685C54907A7AE9C1BA82BC67C1327DFB87C6A6182A05F538085040C4482E2BEB4E4DB2841727A41D1DD7132A225DC8D1069D9731E418E150FCDA48 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7BCC85671EC7A750CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D4360D888D8F9BE48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8263ADBE9E0F79505011C753EDB58E51B117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B67393CE827C55B5F775ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A54BFDC84181AE707D88BFDAE0961D9218BB3503D33234BEECD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AF61ACC197BF517A5CD59D252C5DFBA764D4299686B04652AC5F32BFFACB0D910672B7D26F65C43B1D7E09C32AA3244C860C28D4130AF0D75B1D6B68C52B109C250262A5EE9971B0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojCpYK6nkTlbEV98rYW9zcxQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822C536C77C177E37BEA61B77B95F0E01AA0FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED567EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 4/4] ARM64: Fix xpcall() error case (really). 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, Igor! Thanks for the review! On 10.06.21, Igor Munkin wrote: > Sergey, > > Thanks for the patch! There are still typos left after fixing Sergos > review comments (the commit message is taken from the branch). > Otherwise, LGTM. > > | ARM64: Fix xpcall() error case (really). > | > | Thanks to François Perrad and Stefan Pejic. > | > | (cherry picked from commit d417ded17945b4211608d497d50b509e0274f5e0) > | > | Premature decrement of VM's RC register before switch to fff_fallback > | handler during processing `xpcall()` fast function leads to incorrect > | stack layout (not enough arguments on stack), when `xpcall()` calls > > Typo: s/calls/is called/. > > | without a second argument or if it is not a function (see > | > > Typo: looks like line underfull (in LaTeX terms). > > | test in lua-Harness test suite). While further error processing it leads > | to incorrect error message, due to stack inconsistency. > | > | This patch stores intermediate result into TMP1 register (it does not > | determine fallback's behaviour and there is no way to return from > | fallback back to xpcall processing with spoiled TMP1) and moves RC > | setting after the switch to the fallback handler. > | > | Sergey Kaplun: > | * added the description for the problem > | > | Resolves tarantool/tarantool#6093 > | Part of tarantool/tarantool#5629 Fixed. Branch is force-pushed: The new commit message is: =================================================================== ARM64: Fix xpcall() error case (really). Thanks to François Perrad and Stefan Pejic. (cherry picked from commit d417ded17945b4211608d497d50b509e0274f5e0) Premature decrement of VM's RC register before switch to fff_fallback handler during processing `xpcall()` fast function leads to incorrect stack layout (not enough arguments on stack), when `xpcall()` is called without a second argument or if it is not a function (see test in lua-Harness test suite). While further error processing it leads to incorrect error message, due to stack inconsistency. This patch stores intermediate result into TMP1 register (it does not determine fallback's behaviour and there is no way to return from fallback back to xpcall processing with spoiled TMP1) and moves RC setting after the switch to the fallback handler. Sergey Kaplun: * added the description for the problem Resolves tarantool/tarantool#6093 Part of tarantool/tarantool#5629 =================================================================== > > -- > Best regards, > IM -- Best regards, Sergey Kaplun