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 7A64F5426C4; Mon, 24 Jul 2023 14:41:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7A64F5426C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1690198871; bh=oyJaI3i2VGgAth9txKPlija9JToO0nUsk8lIPVcbe78=; 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=CM9oYlFHKZqLXJVBoPEfIUILq537oIguUgbDnbt2gb5THxZBP13i6WaFMvgNbXe5c 8CaLbtKE453atvNtywegv8epv+308cjuYtXGpKOkvyO7D/sI6gOEWgEycEZsGeLuHu V7COq+7qJm+pPko67uDTU2Ul73KISJgz3L27nbPs= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [95.163.41.81]) (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 292F953B85B for ; Mon, 24 Jul 2023 14:41:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 292F953B85B Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1qNtw5-00FHzx-TV; Mon, 24 Jul 2023 14:41:10 +0300 Message-ID: <1330e6f3-18f1-c180-9de5-3db1fd52757c@tarantool.org> Date: Mon, 24 Jul 2023 14:41:09 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Igor Munkin , Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9227D43F3CB451B416C6CF32F71973666A6CA7D30FA526308182A05F5380850408AD554BE89FBAEB1ED6C3A4DDAF4DE07EB79340145C8E5FC40139BF09A9FA8EF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CD66154F29C6D537EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D038D3D3B22CF2FA8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8203FFD56FE238A6E9C9A4D10C43041A2117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520902A1BE408319B29F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE26055571C92BF10F96C9B5BF839F39F6D8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE3D166953D3EA3826B040F9FF01DFDA4A8C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CC2B5EEE3591E0D352E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F616AD31D0D18CD5CC6EABA9B74D0DA47B5C8C57E37DE458BEDA766A37F9254B7 X-B7AD71C0: BCAA75B3C340DBBEEF3A853C90EA8D50F01536074D6990B7EE9D5CB6078CC77CBFF768C03D9ACC60135824B3FEAB4495 X-C1DE0DAB: 0D63561A33F958A511B2EF3BB00E2303B9B48765403EEE4AB06C81D3AFFA15DEF87CCE6106E1FC07E67D4AC08A07B9B0E753FA5741D1AD02CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0AD75DCE07D45A749953FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFFD829888381CB3BACA5A8370BFBF388F527848ED46BDCCC06DA9A1718534C87945F8ED8E1771A93DC81315DA36159FFB58937A1898BA51A18C3B81522C677ACCE48CAC7CA610320002C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojHVt7enifY/vfu3O+5lVnlQ== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76976D520502385C5B1ED6C3A4DDAF4DE07EC9A243AB1C8B1BCEBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2 4/5] build: introduce LUAJIT_USE_ASAN option 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for the patch! See comments below. On 7/21/23 11:12, Igor Munkin wrote: > There was neither a special option nor a variable to configure the > sanitizers support via the build system since the commit > 052c1a32a5e74b337686eee229d089d576775931 ("Add preliminary ASAN > support") where ASan support had been introduced. We finally decided to > use this feature in LuaJIT CI, so for convenient build configuration > LUAJIT_USE_ASAN option is added to the root CMakeLists.txt. > > Resolves tarantool/tarantool#5878 > > Co-authored-by: Sergey Kaplun > Signed-off-by: Igor Munkin > --- > CMakeLists.txt | 33 ++++++++++++++++++++++++--------- > 1 file changed, 24 insertions(+), 9 deletions(-) > > diff --git a/CMakeLists.txt b/CMakeLists.txt > index 6ef24bba..c4664cf9 100644 > --- a/CMakeLists.txt > +++ b/CMakeLists.txt > +# ASan enabled. > +option(LUAJIT_USE_ASAN "Build LuaJIT with AddressSanitizer" OFF) > +if(LUAJIT_USE_ASAN) > + if(NOT LUAJIT_USE_SYSMALLOC) > + message(WARNING > + "Unfortunately, internal LuaJIT memory allocator is not instrumented yet," > + " so to find any memory errors it's better to build LuaJIT with system" > + " provided memory allocator (i.e. run CMake configuration phase with" > + " -DLUAJIT_USE_SYSMALLOC=ON)." > + ) > + endif() > + # Use all recomendations described in AddressSanitize docs: typo: recomendations -> recommendations With applied patch tests below failed: LUA_PATH="test/tarantool-tests/?.lua;src/?.lua;;./src/jit/?.lua;./tools/?.lua;" ./src/luajit test/tarantool-tests/lj-128-fix-union-init.test.lua ================================================================= ==558476==ERROR: LeakSanitizer: detected memory leaks Direct leak of 2048 byte(s) in 1 object(s) allocated from:     #0 0x55f75b19c1f5 in realloc (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0xd81f5) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #1 0x55f75b230295 in mem_alloc lib_aux.c     #2 0x55f75b205066 in lj_mem_realloc (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x141066) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #3 0x55f75b2aa6fb in lj_ir_growbot lj_ir.c     #4 0x55f75b2a78de in lj_ir_kgc (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x1e38de) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #5 0x55f75b37f7c7 in lj_record_constify (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x2bb7c7) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #6 0x55f75b398876 in rec_upvalue lj_record.c     #7 0x55f75b3923db in lj_record_ins (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x2ce3db) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #8 0x55f75b2ae826 in trace_state lj_trace.c     #9 0x55f75b335eb4 in lj_vm_cpcall (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x271eb4) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e) SUMMARY: AddressSanitizer: 2048 byte(s) leaked in 1 allocation(s). $ LUA_PATH="test/tarantool-tests/?.lua;src/?.lua;;./src/jit/?.lua;./tools/?.lua;" ./src/luajit test/tarantool-tests/lj-1024-varg-maxslot.test.lua TAP version 13 1..2 ok - BC_VARG recording 0th frame depth ok - BC_VARG recording with VARG slots defined on trace ================================================================= ==558552==ERROR: LeakSanitizer: detected memory leaks Direct leak of 2048 byte(s) in 1 object(s) allocated from:     #0 0x55db03d981f5 in realloc (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0xd81f5) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #1 0x55db03e2c295 in mem_alloc lib_aux.c     #2 0x55db03e01066 in lj_mem_realloc (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x141066) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #3 0x55db03ea66fb in lj_ir_growbot lj_ir.c     #4 0x55db03ea38de in lj_ir_kgc (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x1e38de) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #5 0x55db03f8c4f2 in lj_record_ins (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x2cc4f2) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e)     #6 0x55db03eaa826 in trace_state lj_trace.c     #7 0x55db03f31eb4 in lj_vm_cpcall (/home/sergeyb/sources/MRG/tarantool/third_party/luajit/src/luajit+0x271eb4) (BuildId: 3f595aa9bf0b93395cadf9c7246b933ded2a6a0e) SUMMARY: AddressSanitizer: 2048 byte(s) leaked in 1 allocation(s).