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 717EB562817; Thu, 3 Aug 2023 10:51:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 717EB562817 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691049117; bh=v4qvgPRs3CTa1BII0lnHgz5ji+UUEC37LRT90LyNUCY=; 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=ov4YHOaVjCpn6RU4D6Wk75kR3IrbnHDT9TBDuKoAdIGUdhN18Lpn3plAyhGlWUWwA tFsIX1WLeiu69tKFM9W1lAdiQeL1X9HmmSI2W6/eZWktSLbaj3XsC6Oa9bkv9Ge1nT WKjEp7LoHas9RWpWZmj7/5MKyQVjDaYLrhQFJkiI= Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [95.163.41.92]) (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 1CD4E56237D for ; Thu, 3 Aug 2023 10:45:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1CD4E56237D Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1qRT13-009pyv-19; Thu, 03 Aug 2023 10:45:02 +0300 Date: Thu, 3 Aug 2023 07:31:48 +0000 To: Sergey Kaplun , Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD93761F2630DFFAF419FF9F365118383038215B45E24F6DA4B182A05F538085040C795BD019FB3A9805DE779368FBF51C50A2EF8B43DE506D6EEF42D1A144FC2F9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE789066434B85BF7C7EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375E280A1EC162AD7D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8840BEA5390F6D15EBE18CF0C89629B7E117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCE2CCD8F0CAA010FB389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC825D43C09D2508269F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C67F1C1C3ABB44F3A6E0066C2D8992A164AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3302A61B22DEE7324BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFED8438A78DFE0A9E1DD303D21008E298D5E8D9A59859A8B6957A4DEDD2346B4275ECD9A6C639B01B78DA827A17800CE70BB89B22BF4660DC731C566533BA786AA5CC5B56E945C8DA X-B7AD71C0: 6FEFE4C63DFE2D8532C3C7A134B807951D49B9A4D3932D29834459D11680B505DF50B9B7DE6EDB930B4D65AC112D81AA X-C1DE0DAB: 0D63561A33F958A5955D35F2765626C9893B5B31293B791787106498244DF2DCF87CCE6106E1FC07E67D4AC08A07B9B0DB8A315C1FF4794DBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC71106E36FF2641B7B8424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D341ADA1A41A420E9B24F06ACB03C251F4EAB21DCB032880E59E82E37B2D9308711F72762C5A78914871D7E09C32AA3244C3283F4023753193B2650A7E5C5640D645595C85A795C7BAEBAD658CF5C8AB4025DA084F8E80FEBD376A4ED3E9341DC2FCD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojcir52QaMQ8052a/hS8EljA== X-Mailru-Sender: 2FEBA92C8E508479FE7B9A1DF348D53196BF3A8A1900EC0453F6A3FACB5A185F7858117E43CC4A102326FE6F2A341ACE0FB9F97486540B4CD9E8847AB8CFED4D9ABF8A61C016C2CFB0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2 0/5] Add ASan support in LuaJIT 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" Pals, thanks for your reviews! 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 21.07.23, Igor Munkin wrote: > This series implements the second attempt to enable ASan support back > for LuaJIT repository. > > The only thing that was missing the whole time was the option per se > (and the corresponding compile flags, obviously). Anyway, when the > option has been finally added, the dedicated CI workflow has been added > too in scope of the second patch in the series. All other info can be > found in the corresponding patches. > > Besided, internal LuaJIT memory allocator is not instrumented yet > unfortunately, so to find any memory faults it's better to build LuaJIT > with system provided memory allocator (i.e. run CMake configuration > phase with -DLUAJIT_USE_SYSMALLOC=ON). However, LUAJIT_USE_SYSMALLOC > cannot be enabled on x64 without GC64, since realloc usually doesn't > return addresses in the right address range. For more info, see root > CMakeLists.txt. > > Surprisingly, some hidden bugs were found while testing the > aforementioned configuration. > > 1. The assertions in memprof initialization, checking the state of the > allocator against NULL, can fail if this allocator requires no internal > state (e.g. glibc functions for allocating dynamic memory). In fact, > when building LuaJIT with LUAJIT_USE_SYSMALLOC option enabled, NULL is > given as the second parameter to and these assertions > fail as a result. Hence, they are simply removed. > > 2. Before the patch all tests in tarantool-tests suite (except > ) terminate their execution via > with the status depending on the test results. However, the > second argument of was omitted and Lua universe was not > properly finalized as a result. This behaviour becomes a problem, when > LuaJIT is build with LUAJIT_USE_SYSMALLOC option and AddressSanitizer > support enabled, since the sanitizer starts reporting false positive > errors about the memory allocations without the corresponding memory > releases. To resolve these errors, the second parameter to each > call terminating the test has to be added. To avoid loss of > the aforementioned parameter in future, helper has been > added to the TAP module. Depending on the single parameter, the new > helper either properly finalize the test being run, or simply checks all > the test assertions and raises an error if any of them fail. The latter > case is added especially to handle > specifics and still check that everything works fine. > > > Last but not least: for all ARM64 jobs in exotic builds testing pipeline > non-GC64 configurations were disabled, since LUAJIT_ENABLE_GC64 takes no > effect for this arch (GC64 is the only option). > > Issue: https://github.com/tarantool/tarantool/issues/5878 > Branch: https://github.com/tarantool/luajit/tree/hackaton/gh-5878-enable-ASAN > Tarantool related changes and CI can be found in #8846[1]. > > v1: https://lists.tarantool.org/tarantool-patches/cover.1689195028.git.imun@tarantool.org/T/#t > > Changes in v2: > * Fixed comments as per review by Sergey B. and Sergey K > * Enabled LUAJIT_USE_SYSMALLOC option in sanitizers-testing.yml > * Removed two invalid assertions in memprof sources (found via > enabling LUAJIT_USE_SYSMALLOC option) > * Introduced test:done helper for proper test finalization (found via > enabling both LUAJIT_USE_ASAN and LUAJIT_USE_SYSMALLOC) > * Little maintenance of exotic builds workflow > > Igor Munkin (5): > ci: clean up workflow for exotic builds > memprof: remove invalid assertions > test: introduce test:done TAP helper > build: introduce LUAJIT_USE_ASAN option > ci: introduce testing workflow with sanitizers > > > [1]: https://github.com/tarantool/tarantool/pull/8846 > > -- > 2.30.2 > -- Best regards, IM