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 A1319554FC7; Sun, 26 May 2024 12:56:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A1319554FC7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1716717392; bh=U9GCU2uYvJWkDwMPpHAqTptUWAAMgzGANwPxep2Nids=; 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=FQtd9jvIPx5oYZRm85FOSP2FvPvKNTKFUWksJFFFvuUUJV7L3T7q6wt4pnvEzjAdX 4/YldXY5KHz+QC4sVJOCAjjfVGyZR9wOMQJ2h4HxIFavprz2+vjWFz1qYqFoGSeoU3 guXNMQoLm2k2iBVJaXKrWMWDn+0QTvkEEcT5wHY4= Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [95.163.41.91]) (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 C47C2554FC7 for ; Sun, 26 May 2024 12:56:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C47C2554FC7 Received: by smtp49.i.mail.ru with esmtpa (envelope-from ) id 1sBAc9-0000000DqaS-2eZg; Sun, 26 May 2024 12:56:30 +0300 Date: Sun, 26 May 2024 12:56:28 +0300 To: Sergey Kaplun 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: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD92D983CBBFCCE46A610D6A40DB028435587882D25530685061313CFAB8367EF908E2BE116634AD74DD8CB296585314AFFC85F2F29F745D2B964493372F35C21CAE4CC6768B3DB06466412C2FA36F3267F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76EFCC492048C0D13EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637829D9538242026C38638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D86F4BC322E17B05E8CD74B9DFAD5916EA11CD8BF94F9C1F7FCC7F00164DA146DAFE8445B8C89999728AA50765F7900637F3E38EE449E3E2AE389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8062BEEFFB5F8EA3EF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CE753FA5741D1AD022D242C3BD2E3F4C64AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C308A335BCDFF8BE43BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE78E7FE8CC7D0C7735731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A57E92A9041FAC5E965002B1117B3ED6964540344BA1192CE9466072E6821086B3823CB91A9FED034534781492E4B8EEAD0942DC5495D0595EBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34BC3EEE75EF3BACCFCA7E51EC7CA65B672DA58459C82704462FAF6CB01859FD175BB9B60E42D79F5F1D7E09C32AA3244C61DCD8697C068EDB459F46583F07963CAA3B92C031FE9AF1EA455F16B58544A2557BDE0DD54B3590965026E5D17F6739C77C69D99B9914278E50E1F0597A6FD5CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnJlDmFYFlmFiGy8g12grSQ== X-Mailru-Sender: 00097D31F91C944B27477D5EE6B524EBC068D32CDC344D28D77739F4E260083E4827F19F6BE3CC959B487D016DE17056D51284F0FE6F529ABC7555A253F5B200DF104D74F62EE79D27EC13EC74F6107F4198E0F3ECE9B5443453F38A29522196 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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. > 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