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 525D2CCE241; Fri, 13 Sep 2024 18:32:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 525D2CCE241 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1726241572; bh=rQ8vEqDzuhEeUoA0kf6Gq1Cb31oe8otiKKp+y4cO4hI=; 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=Xnd+lkv4SPuzR9pN74oEMceGyQwnemk2voM57vJryzr/NKfryynS082/vGZmhRIXK JFY68QTYIyJe7hcNuCT0opS5tzWIl5CTAdNGHmEYk7KXaS56o2RkORfJnVxp3KzWnu f5R+BkK4rpP5dkyKTVf8eUwF/IdWZhR6dmcjtIHQ= Received: from smtp47.i.mail.ru (smtp47.i.mail.ru [95.163.41.85]) (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 8B209CCE241 for ; Fri, 13 Sep 2024 18:32:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8B209CCE241 Received: by smtp47.i.mail.ru with esmtpa (envelope-from ) id 1sp8Hx-00000001VQM-2edu; Fri, 13 Sep 2024 18:32:50 +0300 Date: Fri, 13 Sep 2024 18:32:39 +0300 To: Sergey Bronnikov Message-ID: References: <20240913080550.22599-1-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: 4F1203BC0FB41BD9149934E261B3C8500E4E5EB06CFCEAC4CDC392E6E4038E5A182A05F538085040F013DDDE42C847919487ABAC94A94B54469EB913FA75EE18E2A0F106E43FE015CF2D425F2FC6F947 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7370F4F695FFFC24BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D4360D888D8F9BE48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D851160DC5213D3D3A432138BC0F6A36677B2C67905FA6CA11CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7350555CCFDA08FA3FAC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A582E8379A0B902DCA5002B1117B3ED6967536CBC5D45E8A61C81EEE05487B0209823CB91A9FED034534781492E4B8EEAD1A3F3A3731258CC5BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34F6CC1FD336696336BD7B8F8388ED76A79C9405CE40ECE2DA837A3E8D186737D993056539F6FD9DCB1D7E09C32AA3244CEE43015650D67CE1A9A6C043C55A4F63289B555CEF20FC2CEA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmn7hiCWKTuhXjTvuz2hNCA== X-DA7885C5: D6EE183C007BE346F255D290C0D534F98EF7A136EA0591E8A5F2E6740062F0CA27B0170ACCE994E95B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393C6D0B12EA33CAA9BEEF2840815AA1C3DEE37ADEE5144E72D6373F8C5C05047F6E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] FFI: Workaround for platform dlerror() returning NULL. 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, Sergey! Thanks for the review! On 13.09.24, Sergey Bronnikov wrote: > Hi, Sergey, > > thanks for the patch! LGTM with a minor comment below. > > On 13.09.2024 11:05, Sergey Kaplun wrote: > > From: Mike Pall > > > > Contributed by mcclure. > > > > (cherry picked from commit 478bcfe52a653bf338f17690147fa9f5793f5b42) > > > > The `ffi.load()` implementation assumes the string returned from > > `dlerror()` is non-NULL and immediately dereferences it. This may lead > > to a crash on some platforms like Android (Oculus Quest) where it is > > possible. > > According to a POSIX standard, it is not Android-specific behaviour [1]: > > > If no dynamic linking errors have occurred since the last invocation > of /dlerror/(), /dlerror/() shall return NULL. > > 1. https://pubs.opengroup.org/onlinepubs/009695399/functions/dlerror.html Updated the commit message to the following and force-pushed the branch: | FFI: Workaround for platform dlerror() returning NULL. | | Contributed by mcclure. | | (cherry picked from commit 478bcfe52a653bf338f17690147fa9f5793f5b42) | | The `ffi.load()` implementation assumes the string returned from | `dlerror()` is non-NULL and immediately dereferences it. This may lead | to a crash on POSIX platforms [1] where it is possible. | | This patch adds the corresponding check and the default "dlopen failed" | error message. | | Sergey Kaplun: | * added the description and the test for the problem | | [1]: https://pubs.opengroup.org/onlinepubs/009695399/functions/dlerror.html | | Part of tarantool/tarantool#10199 > > > > > This patch adds the corresponding check and the default "dlopen failed" > > error message. > > > > Sergey Kaplun: > > * added the description and the test for the problem > > > > Part of tarantool/tarantool#10199 > > --- -- Best regards, Sergey Kaplun