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 D363A6F153; Wed, 7 Sep 2022 14:59:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D363A6F153 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1662551944; bh=ckUWje+X55C6367SYf485vsKkS7Oybe6qQm7bwjIsUg=; 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=kBmN7WcWUS9g6B6fZMwWG4Cj7WNz2E56cmDmbvGJk88fMdfQueHY4YgbnY4Vozh49 elIi/Eq3JV0QKMyYBD17H3MAqQrStYLPfRFfZzVRCqB+TE+8ikY/3DoKQJHHcDpK4q JmOoOSCTjINgy4auJ4f5v7e8148HAutXf3+e+oxg= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (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 A42A56F153 for ; Wed, 7 Sep 2022 14:59:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A42A56F153 Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1oVths-0003kN-Pq; Wed, 07 Sep 2022 14:59:01 +0300 Date: Wed, 7 Sep 2022 14:56:21 +0300 To: Maxim Kokryashkin Message-ID: References: <20220823080659.16880-1-skaplun@tarantool.org> <1662472034.210882840@f736.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1662472034.210882840@f736.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9BB8703851B44C881223256335AE64E1B7A1819065FCFBBDF1313CFAB8367EF908E2BE116634AD74DC48DA36CFFB21F468702A0ED155A98BFA2C52483C85766107CBF1C18CED4D92F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70043D879A87EF1BCEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375D54B99ECAFA2F678638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D2C2AD9B3AFF3B7E6D7EF3AFAF65E207117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF77088377309FF52A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD186FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EECCD848CCB6FE560C07FB45A5F6E725C8D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3C6602A96AF88C695302FCEF25BFAB345C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637C970FD8DF19C51D2EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 9604B64F49C60606AD91A466A1DEF99B296C473AB1E142185AC9E3593CE4B31AB1881A6453793CE9274300E5CE05BD4401A9E91200F654B0C7A0BC55FA0FE5FC10164ED1FC2D6A678FB3EABA629DAD7D5519F9892FFA6975B1881A6453793CE9C32612AADDFBE06133F7A9E5587C79A693EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34D71B56C992F8AF196ABD8525C8E5933364FE75D8A3E7BD01FFB9D6B09C12EEDE8348449DD56465691D7E09C32AA3244C9BAB0D77EEF56DB27B800CD680A2FDB9435BF7150578642F927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojA35J4ZcS5QwidIc0liMEew== X-Mailru-Sender: F16D9CAFEEA6770E7B6EAD4ADB3BCAF0380C7A3A207A2395754DD251E01414457FADC677C6C102E0F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A84198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Fix overflow check in unpack(). 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: Maxim Kokryashkin , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Maxim! Thanks for the review! On 06.09.22, Maxim Kokryashkin wrote: > > Hi, Sergey! > Thanks for the patch! > Please consider my comments below: >   > >from Sergey Kaplun via Tarantool-patches : > >  > >From: Mike Pall > > > >Thanks to HybridDog. > > > >When build with optimization compiler may throw away overflow check in > >`unpack()` base library function. > Typo: s/build with optimization/built with optimization, > Also,  I think we should mention the specific optimization that causes the mentioned behavior > since it is not mentioned in both the LuaJIT’s issue and the original Lua issue. Fixed. The new commit message is the following: I mention the -fstrict-overflow flag as the crucial one (obviously some more are needed). | Fix overflow check in unpack(). | | Thanks to HybridDog. | | (cherry picked from commit 179cf2eb84fef2b9a524469c3c8cc49363b8fb10) | | When built with -O2 optimization flag (includes -fstrict-overflow) | compiler throws away overflow check in `unpack()` base library function. | | This patch prevents aforementioned error by comparing the unsigned | amount of values to unpack with `LUAI_MAXCSTACK` instead of 0. | | Sergey Kaplun: | * added the description and the test for the problem | | Part of tarantool/tarantool#7230 Branch is force-pushed. > > > >This patch prevents aforementioned error by comparing the unsigned > >amount of values to unpack with `LUAI_MAXCSTACK` instead of 0. > > > >Sergey Kaplun: > >* added the description and the test for the problem > > > >Part of tarantool/tarantool#7230 > >--- > > > >Issue/PR: > >* https://github.com/LuaJIT/LuaJIT/pull/574 > >* https://github.com/tarantool/tarantool/issues/7230 > >Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-574-overflow-unpack-full-ci > >PR: https://github.com/tarantool/tarantool/pull/7596 > > > > src/lib_base.c | 6 ++++-- > > test/tarantool-tests/lj-574-overflow-unpack.test.lua | 12 ++++++++++++ > >-- > >2.34.1 > -- > Best regards, > Maxim Kokryashkin -- Best regards, Sergey Kaplun