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 4BDB368CACB; Tue, 3 Oct 2023 21:54:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4BDB368CACB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1696359265; bh=Fg52iHNjQYuJCRELJdI1hXcH7Ahe7f2e3ukT01yqoZE=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=lsr425NDeiKNTHOhBFvu1WYpQwph6QyZtmMRgy/Jrchs+Wr4JuN6S6rc1fZo4iGJZ qAT7/Ms/Gw+XbWonMibWl7mgWVLWf3oLEmpg7QpzmryHvw+l5qK8jG9rV9jj754Twt l3wF1W4EMWzBSddjpYbr4oc7wpeuXhuHVAYckBv0= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [95.163.41.95]) (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 13D3068CACB for ; Tue, 3 Oct 2023 21:54:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 13D3068CACB Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1qnkXG-00CDjs-28; Tue, 03 Oct 2023 21:54:23 +0300 Message-ID: <9fa6ba12-517a-0250-502f-5485ac580171@tarantool.org> Date: Tue, 3 Oct 2023 21:54:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US To: Maxim Kokryashkin , tarantool-patches@dev.tarantool.org, skaplun@tarantool.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD94A796AF4779ECFCE1E04A5A72FB95B15BF5B6D56DAADA3F2182A05F53808504010297F7427163C4DA97672AA126A873CE5E6BBE520973490CD6AA3923A42FFF2 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78CB87876C5D626D4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063719899BAB9B61B3948638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E074DC79CB8CF44274C4566EAFE43CDB117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC1BE95B8C87527B4BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE140C956E756FBB7AC0837EA9F3D197644AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3643C8550F848550276E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C3B6C7E47A292E8D043847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5418333662ECF9CDEA392B6550ECCDC9EF47370ED49A4725AF87CCE6106E1FC07E67D4AC08A07B9B064E7220B7C550592CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFDB5F77A0AA1FC7AD18353A490630A157AC55C51B582834AF597965BF77A81816212E5196DFD6A13FCC231B5D63B17C6B78A8DB36E4C79F02A19570E914A12187A74DFFEFA5DC0E7F02C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojH0UbTrDsBkDAgs0cvowG5A== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884585D839B37290FAD11D930906812B637DBBBCCA95F1F5B2760282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30B0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2 1/5] Revert "Fix cur_L tracking on exceptional path" 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" Hi, Max please see my comment below On 9/29/23 09:20, Maxim Kokryashkin wrote: > This reverts commit 97699d9ee2467389b6aea21a098e38aff3469b5f. > > As was mentioned in tarantool/tarantool#6189, throwing an error > not on the currently executed coroutine is a violation of the > Lua/C API. Could you add a source of this statement? There is a section "3.6 – Error Handling in C" in Lua 5.1 Reference Manual, but there is no such statement there [1]. Could you clarify? 1. https://www.lua.org/manual/5.1/manual.html > This patch is a part of the patchset that supports > this violation and is reverted because of it. > > Part of tarantool/tarantool#6323 > --- > src/vm_x64.dasc | 9 ++++----- > src/vm_x86.dasc | 8 ++++---- > 2 files changed, 8 insertions(+), 9 deletions(-) > > diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc > index 09bf67e5..116716ac 100644 > --- a/src/vm_x64.dasc > +++ b/src/vm_x64.dasc > @@ -533,11 +533,11 @@ static void build_subroutines(BuildCtx *ctx) > | mov eax, CARG2d // Error return status for vm_pcall. > | mov rsp, CARG1 > |->vm_unwind_c_eh: // Landing pad for external unwinder. > - | mov L:DISPATCH, SAVE_L > - | mov GL:RB, L:DISPATCH->glref > - | mov GL:RB->cur_L, L:DISPATCH > + | mov L:RB, SAVE_L > + | mov GL:RB, L:RB->glref > + | mov [GL:RB->cur_L], L:RB > | mov dword GL:RB->vmstate, ~LJ_VMST_CFUNC > - | mov DISPATCH, L:DISPATCH->glref // Setup pointer to dispatch table. > + | mov DISPATCH, GL:RB // Setup pointer to dispatch table. > | add DISPATCH, GG_G2DISP > | jmp ->vm_leave_unw > | > @@ -561,7 +561,6 @@ static void build_subroutines(BuildCtx *ctx) > | add DISPATCH, GG_G2DISP > | mov PC, [BASE-8] // Fetch PC of previous frame. > | mov_false RA > - | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB > | mov RB, [BASE] > | mov [BASE-16], RA // Prepend false to error message. > | mov [BASE-8], RB > diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc > index f16ade1a..e3fbf751 100644 > --- a/src/vm_x86.dasc > +++ b/src/vm_x86.dasc > @@ -681,11 +681,11 @@ static void build_subroutines(BuildCtx *ctx) > |.endif > |.endif > |->vm_unwind_c_eh: // Landing pad for external unwinder. > - | mov L:DISPATCH, SAVE_L > - | mov GL:RB, L:DISPATCH->glref > - | mov dword GL:RB->cur_L, L:DISPATCH > + | mov L:RB, SAVE_L > + | mov GL:RB, L:RB->glref > + | mov dword GL:RB->cur_L, L:RB > | mov dword GL:RB->vmstate, ~LJ_VMST_CFUNC > - | mov DISPATCH, L:DISPATCH->glref // Setup pointer to dispatch table. > + | mov DISPATCH, GL:RB // Setup pointer to dispatch table. > | add DISPATCH, GG_G2DISP > | jmp ->vm_leave_unw > |