public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: libffi-discuss@sourceware.org
Subject: is fork() supported?
Date: Wed, 04 Aug 2021 16:00:17 -0400	[thread overview]
Message-ID: <xn35rpou9a.fsf@greed.delorie.com> (raw)


I don't mean fork/exec (duh) but a fork() and keep going...

Consider a case where a process is using a file-backed mapping for
closures; a fork() doesn't isolate that backing between parent/child
so there's a chance (for example) the parent could deallocate a
closure that the child needs, etc...

I see four options...

1. Not supported.  Sorry.

2. Supported only if you have fork-able closure backings (mmap or
   maybe ktmpfile, but not file-backed) but this means documenting
   that (at least) selinux settings might affect this.  Caveat
   Programmer.

3. Some API that says "I need this" so it can fail in a more useful
   way than "segfault".

4. Fully supported, and we have some work to do to handle fork events.

Comments?

DJ


             reply	other threads:[~2021-08-04 20:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 20:00 DJ Delorie [this message]
2021-08-05  8:17 ` Andrew Haley
2021-08-05  8:27   ` Florian Weimer
2021-08-24 18:15     ` DJ Delorie
2021-08-24 18:27       ` Jay K
2021-08-24 18:45         ` DJ Delorie
2021-08-24 21:12           ` Kaz Kylheku (libffi)
2021-08-24 21:58             ` Jay K
2021-08-25  9:27               ` Andrew Haley
2021-08-25 15:58                 ` Jay K
2021-08-25 16:59                 ` Kaz Kylheku (libffi)
2021-08-25 21:17                   ` Andrew Haley
2021-08-05 18:13   ` DJ Delorie
2021-08-05 21:21     ` Jay K
2021-08-06  8:32       ` Andrew Haley

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=xn35rpou9a.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=libffi-discuss@sourceware.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).