Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] FFI: Workaround for platform dlerror() returning NULL.
Date: Fri, 13 Sep 2024 18:32:39 +0300	[thread overview]
Message-ID: <ZuRbFzwGcb1bkPW7@root> (raw)
In-Reply-To: <f1544982-c02c-4986-942d-f8b6b9927134@tarantool.org>

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:

| 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

  reply	other threads:[~2024-09-13 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13  8:05 Sergey Kaplun via Tarantool-patches
2024-09-13 14:45 ` Sergey Bronnikov via Tarantool-patches
2024-09-13 15:32   ` Sergey Kaplun via Tarantool-patches [this message]
2024-09-17  6:31     ` Sergey Bronnikov via Tarantool-patches
2024-09-19  8:53     ` Maxim Kokryashkin via Tarantool-patches
2024-10-18 15:09 ` Sergey Kaplun via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZuRbFzwGcb1bkPW7@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] FFI: Workaround for platform dlerror() returning NULL.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox