From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 A2A7C4696C3 for ; Sat, 4 Apr 2020 00:39:19 +0300 (MSK) Date: Sat, 4 Apr 2020 00:32:59 +0300 From: Igor Munkin Message-ID: <20200403213259.GB30022@tarantool.org> References: <119286fe-c957-ea8d-df54-3ccaf92f4e5f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <119286fe-c957-ea8d-df54-3ccaf92f4e5f@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH luajit 0/2] Trace abort on FFI sandwich or mode change List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Vlad, Thanks for the review! On 03.04.20, Vladislav Shpilevoy wrote: > Hi! Thanks for the patch! > > I am getting build errors here: > > Undefined symbols for architecture x86_64: > "__Unwind_DeleteException", referenced from: > _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > "__Unwind_GetCFA", referenced from: > _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > "__Unwind_RaiseException", referenced from: > _lj_err_throw in libluajit.a(lj_err.o) > "__Unwind_SetGR", referenced from: > _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > "__Unwind_SetIP", referenced from: > _lj_err_unwind_dwarf in libluajit.a(lj_err.o) > > I think they are not related to your patch, but > probably you know how to fix them? Did I miss a build > option? I used 'make -j'. Hm, it totally doesn't relate to the patch. AFAIR you use MacOS, so the problems might be related to the external unwinder ([1], sec. 6.2) used by luajit. Could you please share your build environment configuration? > > I saw you fixed some things requested by Sergey, but I don't > see them on the branch. Did you push the latest version? For > example, in the first commit you had a typo in the commit > message - 'whe' instead of 'when'. I still see 'whe', on github > too. Sorry, my fault. I had been waiting for Sergos comments related to my post-review fixes, avoiding several force pushes. Our discussion had been stalled for a while, and I've just received his LGTM and I've pushed the fixed patches to the remote branch. Next time I'll update the upstream ASAP. Please, let me know, whether I need to send the actual series version. > > On 27/03/2020 11:47, Igor Munkin wrote: > > This series closes two issues related to the JIT machinery behaviour: > > * "FFI sandwich"(*) detection is introduced. If sandwich is detected > > while trace recording the recording is aborted. The sandwich detected > > while mcode execution leads to the platform panic. > > * luaJIT_setmode call is prohibited while mcode execution and leads to > > the platform panic. > > > > (*) The following stack mix is called FFI sandwich. > > | Lua-FFI -> ะก routine -> Lua-C API -> Lua VM > > This sort of re-entrancy is explicitly not supported by LuaJIT > > compiler. For more info see [1]. > > > > Branch: https://github.com/tarantool/luajit/tree/imun/ffi-sandwich > > > > [1]: https://github.com/tarantool/tarantool/issues/4427 > > > > Igor Munkin (2): > > jit: abort trace recording and execution for C API > > jit: abort trace execution on JIT mode change > > > > src/lj_api.c | 35 ++++++++++---- > > src/lj_dispatch.c | 5 ++ > > src/lj_errmsg.h | 2 + > > test/gh-4427-ffi-sandwich/CMakeLists.txt | 1 + > > test/gh-4427-ffi-sandwich/libsandwich.c | 59 ++++++++++++++++++++++++ > > test/gh-4427-ffi-sandwich/test.lua | 26 +++++++++++ > > test/lj-flush-on-trace/CMakeLists.txt | 1 + > > test/lj-flush-on-trace/libflush.c | 31 +++++++++++++ > > test/lj-flush-on-trace/test.lua | 25 ++++++++++ > > 9 files changed, 176 insertions(+), 9 deletions(-) > > create mode 100644 test/gh-4427-ffi-sandwich/CMakeLists.txt > > create mode 100644 test/gh-4427-ffi-sandwich/libsandwich.c > > create mode 100644 test/gh-4427-ffi-sandwich/test.lua > > create mode 100644 test/lj-flush-on-trace/CMakeLists.txt > > create mode 100644 test/lj-flush-on-trace/libflush.c > > create mode 100644 test/lj-flush-on-trace/test.lua > > [1]: https://www.uclibc.org/docs/psABI-x86_64.pdf -- Best regards, IM