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 42EAB6EC40; Thu, 19 Aug 2021 11:48:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 42EAB6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629362920; bh=rrW6kYvhmqL7xqN+sLR05F5Y6kNtUwPFnOuPkK86HWI=; 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=kkB6QNFPOfjmCiKp0+hm/VuECSl+et6vZSkXDk6kF12eAeUH3t+mYyo3BK7QJ85co mmMpMKI4ftbyriHolZky4K1BgOjqkn8MD8GudA8yGmftuQM1MZIcJYg3vyo2xNQrtO p/IrojdkaCGDFD+mI9Wc+vohNe8pr20AqWnHdWiA= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 C40A56EC40 for ; Thu, 19 Aug 2021 11:48:38 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C40A56EC40 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mGdj3-00059x-HV; Thu, 19 Aug 2021 11:48:38 +0300 Date: Thu, 19 Aug 2021 11:23:27 +0300 To: Sergey Kaplun Message-ID: <20210819082327.GO5743@tarantool.org> References: <20210816101949.25035-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD910164DC12A5633065676A9727AC27C74182A05F538085040B0752EB9BBF5690C176A3243674AA742BB21BF4E4A72B31B4FAAFFCE6FC4E97D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A3295C83650092F9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F907CB39E8CA2E228638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8F2F70ED00C3878C76CF02B3486F6A28D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C2C2559B29ED8195043847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5FD3CA7A5DA4245DD99449409BE7C652093D315419F4F5627D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758B25CD4253D1D611410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D6AC337C1E637B8AC241D882AF60A89C8AD80844092388E266EF2B55EBAEFA5D2D57FA5F2440641B1D7E09C32AA3244C9CBF21280A038587B365A2BD1F942406F2F5F14F68F1805B927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojGSxK+6r6oBENwkHSqfb2/A== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D00C0DB7A2DA138997296C9DD18C84B0DA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2] core: fix cur_L restoration on error throw 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" Sergey, I've checked the patch into tarantool branch in tarantool/luajit and bumped a new version in master. On 18.08.21, Sergey Kaplun wrote: > Implement cur_L restoration only for arm64 architecture, due to FreeBSD > issue. > > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-6189-curL-v2 > Issues: > * https://github.com/tarantool/tarantool/issues/6189 > * https://github.com/tarantool/tarantool/issues/6323 > * https://github.com/tarantool/tarantool/issues/1516 > > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-6189-curL-v2 > > Enable test-run tests on arm64, Odroid with bump to show their > coverage. > > P.S. this problem is JIT-related, however, when I turn on `jit.dump()` > in CI [1], it is disappeared :(. Also, can't reproduce it inside > sh4/sh8 VM, test fails only in the CI. Red test-run.py suite due to > fiber.top issue, see also [2]. > > I suppose it would be nice to have a FreeBSD test machine like we have > for M1 and Odroid. It may be helpful to research the console issue [3] > too. > > =================================================================== > commit 0f555bf79fefa1016849577500aec52719378ca5 > Author: Sergey Kaplun > Date: Sun Aug 15 15:47:13 2021 +0300 > > arm64: fix cur_L restoration on error throw > > This change is a kind of follow-up of commits > ed412cd9f55fe87fd32a69c86e1732690fc5c1b0 ('Update cur_L on exceptional > path') and 97699d9ee2467389b6aea21a098e38aff3469b5f ('Fix cur_L tracking > on exceptional path'). > > When an error is thrown on the coroutine that is not the one being > currently executed, `cur_L` is not set up. Hence, when the running trace > exits at assertion guard right after the error is caught, Lua state is > restored from the incorrect `cur_L`. As a result the resulting stack is > inconsistent and the crash occurs. > > Aforementioned patches fix the behaviour only for x86/x64 architectures. > This patch updates the `cur_L` for arm64 architecture too. > > Nevertheless, throwing an error at non-currently executed coroutine is a > violation of Lua/C API. So, in the nearest possible future this patch > should be replaced within the corresponding assert in `lj_err_throw()`. > > Resolves tarantool/tarantool#6189 > Relates to tarantool/tarantool#6323 > Follows up tarantool/tarantool#1516 > > =================================================================== > > [1]: https://github.com/tarantool/tarantool/runs/3349429293#step:5:4569 > [2]: https://github.com/tarantool/tarantool/pull/6303 > [3]: https://github.com/tarantool/tarantool/issues/6231 > > -- > Best regards, > Sergey Kaplun -- Best regards, IM