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 9C4316EC40; Thu, 1 Jul 2021 15:35:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9C4316EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625142906; bh=plcWCJUq4JvR+qFNkiZDpwoo8RFdPkLKONOxkUUkvjs=; 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=BNiBGnCsQvCSC2g7qbujHcc2c7oC8CfkObkQ/kh4AFGhyUscRzAwAJZdISrblDC3m XILamcOr8DN+0yoFnE0OPm+ZJHj1kPloKAYPFXmd5oTL2wPQEV+mwUkxbtvE0wKaFv A4wJgB32EboiCdf4x3ZXgVgRbop+XZLs3r/lNlOo= Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [94.100.177.109]) (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 5DEFF6EC40 for ; Thu, 1 Jul 2021 15:35:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5DEFF6EC40 Received: by smtp49.i.mail.ru with esmtpa (envelope-from ) id 1lyvuJ-0001ws-38; Thu, 01 Jul 2021 15:35:03 +0300 Date: Thu, 1 Jul 2021 15:34:34 +0300 To: Maria Khaydich Message-ID: <20210701123434.ezfp3bsmhny73jjf@tkn_work_nb> Received: from 213.87.148.100 by 127.0.0.3:7522 with IMAP Thu, 11 Jun 2020 07:50:22 +0000 (GMT) X-Mailru-Intl-Transport: d,41d7dec References: <1591698918.771792066@f423.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1591698918.771792066@f423.i.mail.ru> X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FB4F75AC5594ACDC16869A51A860A12816182A05F5380850409F53D619B10E0F53C6BBECD69436EEF917E5A1490B0EA27B6383A2F3ED00EC99 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7922E451CE6E839B1EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F10563012BA5CCB0EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BD6CF32B5F8F9D404EFD05BA9A1A27FE90A53497D02D45FCCCC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637B4C9D997413845C7D81D268191BDAD3DBD4B6F7A4D31EC0BEA7A3FFF5B025636D81D268191BDAD3D78DA827A17800CE7BFFE0AA609035320EC76A7562686271EEC990983EF5C03292E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C39472471D10B198B935872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C978311FD068D0C3D78CCD6805EF8F972D3E44 X-C1DE0DAB: 0D63561A33F958A570AE951AA17239CEADE19D4551512E65D718F240A13E64A0D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345DB600F8E858000F25D0E717AC1C7935F8C040AE87D53958C16F166921EF16AC9B6C5671F1667F9C1D7E09C32AA3244C64AAE919F6D4D17C27CEA1824BB1DB2E3C6EB905E3A8056B927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj1IeO6ekkXq3aCg7gEgoYkg== X-Mailru-Sender: FFAA8E4AEE17E37C3731A083A1A85ADE75ED626099D662096160EE75CF689037B7EA9FE7735C3DBFC664A44C781FCEA7C77752E0C033A69EDF9F2CE1E9CF805D8CD356D4F938FF726C18EFA0BB12DBB0 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] box: remove context from stack 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: Alexander Turenko via Tarantool-patches Reply-To: Alexander Turenko Cc: tarantool-patches Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Tue, Jun 09, 2020 at 01:35:18PM +0300, Maria Khaydich wrote: > > I suppose no tests are needed since this one is pretty straightforward. > ---------------------------------------------------------------------- >   > Lua stack was broken because we forgot to clear the context > in case of an error when return value of called function was > not serializable. >   > Closes #4617 > --- > Branch: > https://github.com/tarantool/tarantool/compare/eljashm/gh-4617-broken-lua-stack   > Issue: > https://github.com/tarantool/tarantool/issues/4617   >   > @ChangeLog > Remove context from lua stack in case of an error. Here we describe changes for a user (in the way a user may understand it). For complex bugs we can briefly describe a situation, when it occurs. It is now in the changelogs/ directory. >   >  src/box/lua/call.c | 1 + >  1 file changed, 1 insertion(+) > diff --git a/src/box/lua/call.c b/src/box/lua/call.c > index 6588ec2fa..7ab49983d 100644 > --- a/src/box/lua/call.c > +++ b/src/box/lua/call.c > @@ -436,6 +436,7 @@ port_lua_do_dump(struct port *base, struct mpstream *stream, >      int top = lua_gettop(L); >      if (lua_cpcall(L, handler, &ctx) != 0) { >          luaT_toerror(port->L); > +        lua_pop(L, 1);  There are several doubts and thoughts around it: 1. lua_cpcall() always removes arguments from the Lua stack (in case of an error too). How we can observe this ctx userdata on tarantool_L without yield in encode_lua_call()? 2. luaT_toerror() leans on luaT_tolstring(), so it duplicates a string with the error message. Should not we pop two elements in the case? I would just call lua_settop(). 3. The clash is due to tarantool_L usage (see 1.10.1-48-g18d87adf3). Is there any real reason why we can't use port->L here? CCed Igor and Sergey to think around together. >          return -1; >      } >      lua_settop(L, top); > --  > 2.24.0