From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Sergey Kaplun <skaplun@tarantool.org>, Sergey Bronnikov <sergeyb@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit v2 0/5] Add ASan support in LuaJIT Date: Thu, 3 Aug 2023 07:31:48 +0000 [thread overview] Message-ID: <ZMtX5MScczCl94jc@tarantool.org> (raw) In-Reply-To: <cover.1689925402.git.imun@tarantool.org> 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 <lua_newstate> and these assertions > fail as a result. Hence, they are simply removed. > > 2. Before the patch all tests in tarantool-tests suite (except > <lj-603-err-snap-restore.test.lua>) terminate their execution via > <os.exit> with the status depending on the test results. However, the > second argument of <os.exit> 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 > <os.exit> call terminating the test has to be added. To avoid loss of > the aforementioned parameter in future, <test:done> 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 <lj-603-err-snap-restore.test.lua> > 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 > <snipped> > > [1]: https://github.com/tarantool/tarantool/pull/8846 > > -- > 2.30.2 > -- Best regards, IM
prev parent reply other threads:[~2023-08-03 7:51 UTC|newest] Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-21 8:12 Igor Munkin via Tarantool-patches 2023-07-21 8:12 ` [Tarantool-patches] [PATCH luajit v2 1/5] ci: clean up workflow for exotic builds Igor Munkin via Tarantool-patches 2023-07-24 10:36 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 9:37 ` Sergey Kaplun via Tarantool-patches 2023-07-21 8:12 ` [Tarantool-patches] [PATCH luajit v2 2/5] memprof: remove invalid assertions Igor Munkin via Tarantool-patches 2023-07-24 10:46 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 9:41 ` Sergey Kaplun via Tarantool-patches 2023-07-21 8:12 ` [Tarantool-patches] [PATCH luajit v2 3/5] test: introduce test:done TAP helper Igor Munkin via Tarantool-patches 2023-07-24 10:53 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 10:43 ` Sergey Kaplun via Tarantool-patches 2023-07-26 12:42 ` Igor Munkin via Tarantool-patches 2023-07-21 8:12 ` [Tarantool-patches] [PATCH luajit v2 4/5] build: introduce LUAJIT_USE_ASAN option Igor Munkin via Tarantool-patches 2023-07-24 11:41 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 13:06 ` Igor Munkin via Tarantool-patches 2023-07-25 12:26 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 12:54 ` Igor Munkin via Tarantool-patches 2023-07-27 11:06 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 11:03 ` Sergey Kaplun via Tarantool-patches 2023-07-21 8:12 ` [Tarantool-patches] [PATCH luajit v2 5/5] ci: introduce testing workflow with sanitizers Igor Munkin via Tarantool-patches 2023-07-24 11:54 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 14:53 ` Igor Munkin via Tarantool-patches 2023-07-27 11:13 ` Sergey Bronnikov via Tarantool-patches 2023-07-26 11:29 ` Sergey Kaplun via Tarantool-patches 2023-07-26 16:35 ` Igor Munkin via Tarantool-patches 2023-08-03 7:31 ` Igor Munkin via Tarantool-patches [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ZMtX5MScczCl94jc@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=imun@tarantool.org \ --cc=sergeyb@tarantool.org \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit v2 0/5] Add ASan support in LuaJIT' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox