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 0580E6C1AE; Mon, 17 May 2021 11:43:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0580E6C1AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1621241009; bh=vDVHkTIk6Srtb5l/wobpL3EZ/tiBTXW4m1payl1Pr+4=; 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=d14Yl4KOSjsZtGtACpqGWEHGpkvsbfhQZER5IzTzf4DkuAgTTTpvMkzr3fs2lClDM sfynx0GATO9bXiWT/fFfl11aA04As8EbpsyvEsN+KbE3+KPG24byy/eGxdU84MNQ82 riT1jZDQVTM3xKYeYFBmLoDKQUJyBpRuTMib9Yco= 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 843E16C1AE for ; Mon, 17 May 2021 11:43:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 843E16C1AE Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1liYqU-0007ci-IH; Mon, 17 May 2021 11:43:26 +0300 Date: Mon, 17 May 2021 11:22:11 +0300 To: Cyrill Gorcunov Cc: tml , Vladislav Shpilevoy Message-ID: <20210517082211.GL3944@tarantool.org> References: <20210514101947.106581-1-gorcunov@gmail.com> <20210514104115.GI3944@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD95978C26455E69BE0AAE50420B6EFF6A4E51E23FC86C8E287182A05F5380850404654CB1BB1B9FFCB360A69EC56A5858102B9894E99095EAF988BF0767B616261 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75A6765C746F51968EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C8D8BCCD49BBA39A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8245D20D3A415EA471EF6692C004580B9117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC60CDF180582EB8FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FC26CFBAC0749D213D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6F7FD1A3A8AE6177F089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5ED7CBFE693FD99284696B6C3F6DE1575F7544978BF67EA83D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752546FE575EB473F1410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340D3A19269BBEBAAF9D621975D52BCDB105649F8990408F40F307225BD06BD16613F3C4E5B33729521D7E09C32AA3244C1EC4C058FE174D8ADFEC6AC7C74B08923A92A9747B6CC886927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojlIWKWc0dtJ3XqMAaw2OqAg== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638225D50932821E117FFCBA5F04E198B9A42A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3] lua/utils: fix fiber->fid print in cord_on_yield 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Cyrill, I've checked the patch into master. On 14.05.21, Cyrill Gorcunov wrote: > --- > From: Cyrill Gorcunov > Date: Fri, 14 May 2021 13:18:13 +0300 > > This fixes a nit in commit 6af4737789042b1e6673c421686bb4394a61f4a1 > ("fiber: use uint64_t for fiber IDs"). > > Since lua_pushfstring doesn't support %llu format [1] it > breaks the test > > app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua > > [1] https://www.lua.org/manual/5.1/manual.html#lua_pushfstring > > Signed-off-by: Cyrill Gorcunov > --- > src/lua/utils.c | 20 +++++++++++++------- > 1 file changed, 13 insertions(+), 7 deletions(-) > > diff --git a/src/lua/utils.c b/src/lua/utils.c > index 0fbe700fc..3ce821374 100644 > --- a/src/lua/utils.c > +++ b/src/lua/utils.c > @@ -1341,6 +1341,7 @@ void cord_on_yield(void) > * code misbehaviour and failures, so stop its execution. > */ > if (unlikely(tvref(g->jit_base))) { > + char buf[256]; > /* > * XXX: mcode is executed only in scope of Lua > * world and one can obtain the corresponding Lua > @@ -1348,10 +1349,12 @@ void cord_on_yield(void) > */ > struct lua_State *L = fiber()->storage.lua.stack; > assert(L != NULL); > - lua_pushfstring(L, "fiber %llu is switched while running the" > - " compiled code (it's likely a function with" > - " a yield underneath called via LuaJIT FFI)", > - (long long)fiber()->fid); > + snprintf(buf, sizeof(buf), > + "fiber %llu is switched while running the" > + " compiled code (it's likely a function with" > + " a yield underneath called via LuaJIT FFI)", > + (long long)fiber()->fid); > + lua_pushstring(L, buf); > if (g->panic) > g->panic(L); > exit(EXIT_FAILURE); > @@ -1376,11 +1379,14 @@ void cord_on_yield(void) > * GC hook is active and the platform is forced to stop. > */ > if (unlikely(g->hookmask & HOOK_GC)) { > + char buf[128]; > struct lua_State *L = fiber()->storage.lua.stack; > assert(L != NULL); > - lua_pushfstring(L, "fiber %d is switched while running GC" > - " finalizer (i.e. __gc metamethod)", > - fiber()->fid); > + snprintf(buf, sizeof(buf), > + "fiber %llu is switched while running GC" > + " finalizer (i.e. __gc metamethod)", > + (long long)fiber()->fid); > + lua_pushstring(L, buf); > if (g->panic) > g->panic(L); > exit(EXIT_FAILURE); > -- > 2.31.1 > -- Best regards, IM