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 B0B13B883B3; Mon, 27 May 2024 10:26:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B0B13B883B3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1716794783; bh=nvWN93IDqMLo7WO3DKn70OWQQ/mXaWYFnaoSX6XCEfs=; 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=d7O3rgZPuHUHj/eVWeILstiVj51wNou60iXnqbf2Bt3odfG5Y35Abs5xbbsl1p6Wp zC60Z4ZYyknYVUp/Db3OgTZTSbcqeMyvIp6Az6TbDTZsbV4rdCXkdO9UQitYcm3bCz aQ/kCEUbgIjKUSSgrgNHsDdWw8bYwRjQTlgXffEM= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [95.163.41.84]) (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 7C520B88380 for ; Mon, 27 May 2024 10:26:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7C520B88380 Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1sBUkP-00000005vf6-1iFp; Mon, 27 May 2024 10:26:21 +0300 Date: Mon, 27 May 2024 10:22:08 +0300 To: Maxim Kokryashkin Message-ID: References: <6f8a08e1823bfceebb4057207ee2f2bdb7d2d47c.1715776117.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD99EF2330544E8CB05F795AA0250BFCD7D5D460F8E89A61DA5182A05F5380850404CC8984246CD3409D27678DDAA8063149BF7CFF43891B1EF7865EC7097EB959C3AAAE87D35EC1BE5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78FF511FAAD1B1E98C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7BF6702EC5472AA0FEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B043BF0FB74779F36980B8C2934072BC614D0732EDA4DEFFE9294142F8448D82CA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3ED8438A78DFE0A9E117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF02A9A2C0506BD8D3BA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B6964B8366DC5BCEDF76E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C224936DA1BED736F9328E827F84554CEF50127C277FBC8AE2E8B3A703B70628EAD7BAAAE862A0553A39223F8577A6DFFEA7CB1724D34C644744043847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A542C4BDB85CCAB7375002B1117B3ED696F0D87114BD40D10A8D59E407A97E9958823CB91A9FED034534781492E4B8EEAD0AA277257C6A5E3DBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D344888A9AABCDD3225BCE3BB478A8B8977105CE93A217684079CCFF43A9D8A5D084F82B651036FC67C1D7E09C32AA3244C2C679E47C268BB2F2887F5EA2DDCF3442625E56BB845DB69EA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnJlDmFYFlmFRw3OjYI0IwQ== X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B59A39A8DC3FDE87CE8D27678DDAA8063149BF7CFF43891B1EFB7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 1/2] build: introduce LUAJIT_USE_UBSAN 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the review! On 26.05.24, Maxim Kokryashkin wrote: > Hi, Sergey! > See my thoughts below. > > On Thu, May 16, 2024 at 01:14:14PM UTC, Sergey Kaplun wrote: > > Hi, folks! > > Some more thoughts below. > > > > On 15.05.24, Sergey Kaplun wrote: > > > > > > > > > + string(JOIN "," UBSAN_IGNORE_OPTIONS > > > + # Misaligned pseudo-pointers are used to determine internal > > > + # variable names inside the `for` cycle. > > > + alignment > > > + # Not interested in float cast overflow errors. > > > + float-cast-overflow > > > + # NULL checking is disabled because this is not a UB and > > > + # raises lots of false-positive fails. > > > + null > > > > Maybe it is worth to add also "nonnull-attribute" to the ignore options: > > > > ``` > > LSAN_OPTIONS="abort_on_error=1" src/luajit -e 'error("bad usage", 3)' > > /home/burii/builds_workspace/luajit/gh-8473-ubsan/src/lj_buf.h:75:25: runtime error: null pointer passed as argument 1, which is declared to never be null > > /usr/include/string.h:44:28: note: nonnull attribute specified here > > ``` > > > > Here, `memcpy()` gets the NULL pointer as the first argument and the > > `len` == 0. So there are no problems here. Also, the nullability > > violation is not a UB, as mentioned in the documentation. > > It is UB, though: https://en.cppreference.com/w/cpp/string/byte/memcpy > Even with the zero len it may still cause issues, so I don't think we > should disable this check. But there are no such words in the `memcpy` man page. The only one mentioned UB is about overlapping memory chunks. Also, I suppose that the first point applies only to the case, when the bytes are actually copied (i.e., when size is not zero). > > > Thoughts? > > > > > + # Not interested in checking arithmetic with NULL. > > > + pointer-overflow > > > + # Shifts of negative numbers are widely used in parsing ULEB, > > > + # cdata arithmetic, vmevent hash calculation, etc. > > > + shift-base > > > + ) > > > > -- > > Best regards, > > Sergey Kaplun -- Best regards, Sergey Kaplun