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 B0EEE4922C4; Wed, 1 Nov 2023 12:01:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B0EEE4922C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1698829276; bh=gwq1lpYhxQEU2crJXUXg+cxRSHm8XOToG5QYd1Kio6M=; 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=NhMPEE/82/bG9BVsQ5G8r0RDS7qgM/XN8BXIXwaXPDWCdcQ3D0OU71ijW9q6eRR2b HmbNHyRzhu4VcjSGEbX78d4c2LMsYqpb5JL4b7Wx5cYSR9fbERM9M8peeqWMP+WrNO DvE91ncxQB9SsCFgpXvZHmawuDkMiubdDLBc9loY= Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [95.163.41.80]) (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 3C4C14922C4 for ; Wed, 1 Nov 2023 12:01:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3C4C14922C4 Received: by smtp39.i.mail.ru with esmtpa (envelope-from ) id 1qy769-005HiV-2Z; Wed, 01 Nov 2023 12:01:14 +0300 Date: Wed, 1 Nov 2023 11:56:42 +0300 To: Maksim Kokryashkin Message-ID: References: <20231027125738.29527-1-max.kokryashkin@gmail.com> <20231027125738.29527-3-max.kokryashkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231027125738.29527-3-max.kokryashkin@gmail.com> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9C931D0C4A91E713083557E3423ADEC5AE5E3E16383004B8A00894C459B0CD1B90EA6E306B19F7D2960FE45810D8379EA4DAFE46FE14389C7106F9462B0A16F6A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78E8764B5BC580342EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375045C080FAAE96148638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D867F86F6FC0881CF4BC85AB651CC3576D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC974A882099E279BDA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18E5D25F19253116ADD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE140C956E756FBB7A452896749CDDA0A6D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE32A336C651863509103F1AB874ED89028C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CD2DCF9CF1F528DBC2E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F616AD31D0D18CD5C262FEC7FBD7D1F5BB5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5C018D11CCC3E45C780F9CE34DB43F27FFAAE2A2F63348014F87CCE6106E1FC07E67D4AC08A07B9B01E44367C8E80A7B4CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF72A8BC04A0E938F1797B2FDC8DFD31E44D8F327736A3A03459D0C0EEA65CC9604A7F0923522A066ED8551B728A548A999B27292DF20323F7D6FFA44785D6EF6FA74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojixD2AZzOsmP2yFAxdoktTw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A7697ECF0299D8C75B74B2BFEB5AC76A67186ECF975C7BB2667FDEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] Fix last commit. 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, Maxim! Thanks for the patch! LGTM, just a few nits below. On 27.10.23, Maksim Kokryashkin wrote: > From: Mike Pall > > Reported by PluMGMK. > > (cherry-picked from commit 224129a8e64bfa219d35cd03055bf03952f167f6) > > The error handler for GC finalizers was not cleared from the It's not a handler itself, but "_VMEVENTS" table, where the handler is registered. > stack after the initialization. This commit adds stack cleanup. > > Maxim Kokryashkin: > * added the description and the test for the problem > > Part of tarantool/tarantool#9145 > --- > src/lib_aux.c | 2 ++ > .../fix-finalizer-error-handler-init.test.c | 30 +++++++++++++++++++ > 2 files changed, 32 insertions(+) > create mode 100644 test/tarantool-c-tests/fix-finalizer-error-handler-init.test.c > > diff --git a/src/lib_aux.c b/src/lib_aux.c > index d532a12f..ecdc67f9 100644 > --- a/src/lib_aux.c > +++ b/src/lib_aux.c > diff --git a/test/tarantool-c-tests/fix-finalizer-error-handler-init.test.c b/test/tarantool-c-tests/fix-finalizer-error-handler-init.test.c > new file mode 100644 > index 00000000..44c1d96b > --- /dev/null > +++ b/test/tarantool-c-tests/fix-finalizer-error-handler-init.test.c Please, add "lj-991-" prefix and mention the issue in the comment below. > @@ -0,0 +1,30 @@ > +#include "lua.h" > +#include "test.h" > +#include "utils.h" > + > +#include "lj_obj.h" > + > +/* > + * This test demonstrates an uncleared Lua stack after the > + * initialization of the error handler for GC finalizers. > + */ > + > +static int stack_is_clean(void *test_state) > +{ > + lua_State *L = test_state; > + assert_ptr_equal(L->top, L->base); I suppose, that there is no need for internals to be used here. We can just use `lua_gettop(L)` and compare its result to 0. Side note: Also, this helper may be usefull later. See also the comment in [1]. > + return TEST_EXIT_SUCCESS; > +} > + > +int main(void) > +{ > + lua_State *L = utils_lua_init(); > + > + const struct test_unit tgroup[] = { > + test_unit_def(stack_is_clean) > + }; > + > + const int test_result = test_run_group(tgroup, L); > + utils_lua_close(L); > + return test_result; > +} > -- > 2.39.3 (Apple Git-145) > [1]: https://github.com/LuaJIT/LuaJIT/commit/03cd5aa7 -- Best regards, Sergey Kaplun