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 2B1C0BDDCD7; Thu, 15 Feb 2024 16:52:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2B1C0BDDCD7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1708005142; bh=sS3JPLskg5cMInhR2ISLolY90YaTdqyeFRtn/CUx7Oc=; 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=I9luvXFUXR3CAcxkmFXjk/aodiuNScvRiv+kLIx4ivARwtsy2ditsR6unE9/nr12u W+gSwMfsDf+IhA3xWApx4+lF9Ee0dAutDSqappCr6CH0rC5wI//Ee6b4h3Ge+FaiCY jYwqimnUOpxPBw4S1GFpKxSXMDZv4BuAV6uX2G8o= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [95.163.41.97]) (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 698E4BDDCC9 for ; Thu, 15 Feb 2024 16:52:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 698E4BDDCC9 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1rac9f-0000000Cvcd-1QTP; Thu, 15 Feb 2024 16:51:59 +0300 Date: Thu, 15 Feb 2024 13:40:32 +0000 To: Maksim Kokryashkin Message-ID: References: <20231208061023.89512-1-max.kokryashkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231208061023.89512-1-max.kokryashkin@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9001F8F2F6BAD2021F5DFE3806F3A3DF1421ED8B206DEDB9600894C459B0CD1B92823D026485B06350571F2AE12DCC204E01D787510C27905C22E05930F76FB4722E3706512C1278F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE721B3E54BB37EA0B4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063753275FB77F6A31628638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84D5DBE5E55F31E091A37E441C106577FCB345426AC68A052CC7F00164DA146DAFE8445B8C89999728AA50765F790063793270F7220657A0A389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8989FD0BDF65E50FBF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C67F1C1C3ABB44F3A6E0066C2D8992A164AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3302A61B22DEE7324BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF17B107DEF921CE791DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3AA8C68A3574AB3B435872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5955DE2BAA5BC4E625002B1117B3ED696DACC9FB42837DE7F22DFD5397F446790823CB91A9FED034534781492E4B8EEAD09122B91796FF21FBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34A2EC120135420F90A7B5F5ADD491DC6245194144F1E1F75E90024715E7E94B942B066B4BDAE3CD991D7E09C32AA3244C3B8A9833DB12B5614EB7DF677E51682D04285F3B9D1D6B0CEA455F16B58544A2D06CB91D864A7BD2E9CAF2BECF134D6894F255A82739648EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojQ9gr3ZFpXEl8R7k4sNbd6Q== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D53163C5C84F018F3BD29B464708D7791FD7ACAE83D7CC4DFFCC745EF8D0EC24967EF5EE5212A79745119D086FC03DADA47A24EDF3BD9585A06DEEABBE9EE6587A054198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] sysprof: disable runtime host symtab updates 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/3.0 and release/2.11. On 08.12.23, Maksim Kokryashkin via Tarantool-patches wrote: > From: Maxim Kokryashkin > > The symtab update for newly loaded shared libraries requires > memory allocation, which is not signal-safe and can cause > crashes. Updating symtab in a VM hook is not a viable option > either, as there are no guarantees that the symbol will be > dumped before its address is streamed. This patch completely > disables the runtime updates of the symtab for host symbols. > That means all Lua-C modules, FFI modules, and shared libraries > must be loaded before starting the profiler. > > There is no test along with the patch for two main reasons: > 1. The signal should land on an instruction inside the allocator > such that the second allocator call would cause a crash because of > an inconsistent inner state. Although we have ptrace-based > machinery for testing, the control is not that fine-grained. The > only option we have left is to rely on empirical offsets, which > is not a robust solution. Moreover, it is possible to build LuaJIT > with `malloc` as an allocator, and the test should be adapted to > that too. Needless to say, malloc sources may differ from > platform to platform, making the test unreliable. > > 2. Regression is unlikely here since this patch removes the only > call that could allocate memory inside the signal handler. > > Resolves tarantool/tarantool#8140 > --- > Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-8140-crash-in-allocator > Issue: https://github.com/tarantool/tarantool/issues/8140 > PR: https://github.com/tarantool/tarantool/pull/9460 > > src/lj_sysprof.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > -- > 2.39.3 (Apple Git-145) > -- Best regards, IM