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 5D2776EC11B; Thu, 23 Nov 2023 09:40:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5D2776EC11B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1700721646; bh=ZrwfBvOQJhrJYTt7IPcQolfr1E4wn0ZoCaw0W3Mc9v0=; 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=bwfQjTtrfeGKy9lIYf14TugG/QhNUH3HFamuxJ7PXGm9wmyNkwTZ1ZSvVoCCL51ss J/XMK3+ZAAZnCm/KbSN6TxqP1bmoSFZiK1haO7zP9Ce5hjTDZojVxAcPf3s0o0rkQa SyNhtEpXveWasINr/VVETHQ9B3GD2PB6/JkYCnME= Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [95.163.41.66]) (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 722886EC10C for ; Thu, 23 Nov 2023 09:37:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 722886EC10C Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1r63Kj-00EfIu-1Z; Thu, 23 Nov 2023 09:37:06 +0300 Date: Thu, 23 Nov 2023 06:32:41 +0000 To: Maxim Kokryashkin Message-ID: References: <20230710122818.22221-1-m.kokryashkin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230710122818.22221-1-m.kokryashkin@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92D71B79D2A671AE64597814FE8FCBD2082FA3AFD976005DC182A05F53808504058F0E35F615C983848C09F8ACC6699D3AA9FE121BA58A26494C76D720CF2E207 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78BAADB77C21FF6F2EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637EDC9855826FBDF5A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D881FE56743E62BF38E2979CEFDF242D16117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC974A882099E279BDA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD186FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE0AC5B80A05675ACD4D0DA9BD313A0613D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE3F8BD4E506CFA3D882D242C3BD2E3F4C6C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB861051D4BA689FC2E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FB26E97DCB74E6252CE5475246E174218B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A5181125D41B8188573131136A798B3C3BBC9D70AD38F4B40CF87CCE6106E1FC07E67D4AC08A07B9B04B3849D6E5CCBAFDBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34AC6E62257D6CD1C9C214D7DA15904F661C6C5792F50F8696DCB03E968180CE2B655C356E7FDDFE481D7E09C32AA3244C3D6494DDD99EF3020F1C8E999980F96E63871F383B54D9B3BAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojOz05VK5QHNqWfh+CF568qg== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D531C10A5B2FA7DC0EC6C7FFB07C2BF07C11E7D750CB4E4087D82326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v3] sysprof: fix crash during FFUNC stream 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Max, I've checked the patchset into all long-term branches in tarantool/luajit and bumped a new version in master, release/2.11 and release/2.10. On 10.07.23, Maxim Kokryashkin via Tarantool-patches wrote: > Sometimes, the Lua stack can be inconsistent during > the FFUNC execution, which may lead to a sysprof > crash during the stack unwinding. > > This patch replaces the `top_frame` property of `global_State` > with `lj_sysprof_topframe` structure, which contains `top_frame` > and `ffid` properties. `ffid` property makes sense only when the > LuaJIT VM state is set to `FFUNC`. That property is set to the > ffid of the fast function that VM is about to execute. > In the same time, `top_frame` property is not updated now, so > the top frame of the Lua stack can be streamed based on the ffid, > and the rest of the Lua stack can be streamed as usual. > > Also, this patch fixes build with plain makefile, by adding > the `LJ_HASSYSPROF` flag support to it. > > Resolves tarantool/tarantool#8594 > --- > Changes in v3: > - Fixed comments as per review by Sergey > > Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-8594-sysprof-ffunc-crash > PR: https://github.com/tarantool/tarantool/pull/8737 > src/Makefile.original | 3 ++ > src/lj_obj.h | 7 +++- > src/lj_sysprof.c | 26 ++++++++++++--- > src/vm_x64.dasc | 22 +++++++++++-- > src/vm_x86.dasc | 31 ++++++++++++++--- > .../gh-8594-sysprof-ffunc-crash.test.lua | 33 +++++++++++++++++++ > 6 files changed, 109 insertions(+), 13 deletions(-) > create mode 100644 test/tarantool-tests/gh-8594-sysprof-ffunc-crash.test.lua > > -- > 2.40.1 > -- Best regards, IM