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 51086CDFC86; Tue, 17 Sep 2024 09:31:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 51086CDFC86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1726554692; bh=wvPtqKbiV5DlWaPUSWpkxGFQ9wikH19yvI5FdM++Ljk=; 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=j8ohDpjY5QkZOwcr3BHskJjrbOaZqjzoz/Heb0R6eb535y9CwmJIhHb1nE7dj1OHl DlAP6bRbcaJ8epXs2r/583akXgZOc7MajF3In94yKG9/2weG/EdvpgdOiDuPhM7fUG KSo+czasvw3RSoE1Gnmvv6amBGPxo3MjFIbqYCdI= Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [95.163.41.68]) (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 3FBFECDFC82 for ; Tue, 17 Sep 2024 09:31:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3FBFECDFC82 Received: by smtp29.i.mail.ru with esmtpa (envelope-from ) id 1sqRkH-00000001mBL-4BAw; Tue, 17 Sep 2024 09:31:30 +0300 Content-Type: multipart/alternative; boundary="------------dQHyF5E58fvl3cYJF0WCNQQV" Message-ID: Date: Tue, 17 Sep 2024 09:31:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun References: <20240913080550.22599-1-skaplun@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD921D24E727BB09B71366869A92641C104A6FB5B7BAAF46A79182A05F53808504081BA4FC9F99357D49487ABAC94A94B5452AC587A85088DD608B718F93C6351FA4C0C6A52ECAB1499 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B9FBA884A7C9B8BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376602C647E39EFA3A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D839D4F4CD3AAE01B294B64793B6AE2592C56C7A252CC148D5CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637D5C459977C9415A4D81D268191BDAD3DBD4B6F7A4D31EC0BE2F48590F00D11D6D81D268191BDAD3D78DA827A17800CE7D79F9D3F79DAD512EC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5278DA827A17800CE76631511D42670FFE2EB15956EA79C166176DF2183F8FC7C04E672349037D5FA5725E5C173C3A84C360781E301B93023135872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A57191D750FFDA16455002B1117B3ED6964BDDC015B9E1960430E4A65F242F5898823CB91A9FED034534781492E4B8EEAD831CA35E4C50C31B X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D342E8FEDBD32DECB6D2F6BC2A66E1CDC0CA568C129573413496A728187CA9C7A31FE6A6F97EBF0AF141D7E09C32AA3244C5E1387493A823891A9A6C043C55A4F634A7477816A2DEA68EA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojK9mC3H63xFbGrxj+5u56kw== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D614002EB3B21A15CCC0174D848876F8BA395F6C232E79CECC5410152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------dQHyF5E58fvl3cYJF0WCNQQV Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey, On 13.09.2024 18:32, Sergey Kaplun wrote: > 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: Thanks! LGTM > > | 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 >>> --- --------------dQHyF5E58fvl3cYJF0WCNQQV Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey,

On 13.09.2024 18:32, Sergey Kaplun wrote:
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 <mike>

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:
Thanks! LGTM

| 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
---

    
--------------dQHyF5E58fvl3cYJF0WCNQQV--