From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 3/3] Refactor atfork handlers
Date: Tue, 20 Feb 2018 17:22:00 -0000 [thread overview]
Message-ID: <6d6bc007-7418-4667-bf2f-0ba2256cdbec@linaro.org> (raw)
In-Reply-To: <9a266bea-818d-64da-198e-64f1c19a7915@redhat.com>
On 20/02/2018 10:58, Florian Weimer wrote:
> On 02/20/2018 02:48 PM, Adhemerval Zanella wrote:
>
>> The atfork_run_prepare will instruct __run_fork_handlers to take the internal
>> atfork_lock handler:
>>
>> Â Â void
>> Â Â __run_fork_handlers (enum __run_fork_handler_type who)
>> Â Â {
>> Â Â Â Â struct fork_handler *runp;
>>
>> Â Â Â Â if (who == atfork_run_prepare)
>> Â Â Â Â Â Â {
>> Â Â Â Â Â Â Â Â lll_lock (atfork_lock, LLL_PRIVATE);
>>
>> And it will prevent to add new registration until either the parent or the child
>> call __run_fork_handlers with either 'atfork_run_child' or 'atfork_run_parent'
>> to release the lock.
>
> Oh, sorry, I missed that. So the patch does not have this problem. This does not settle the deadlock issue, though.
Aside of the two scenarios (callbacks issuing fork/pthread_atfork), the only
other scenario I see which might trigger a deadlock in this case is a signal
handler issuing fork/pthread_atfork.
Former is BZ#4737 and my understanding is this should be a EWONTFIX due
indication future POSIX specification to interpret fork as async-signal-unsafe
(comment #19 and I am not sure if fork could be made async-signal-safe with
ticket locks as Rich stated in comment #21).
Regarding later I think pthread_atfork is inherent async-signal-unsafe due
it might return ENOMEM indicating it might allocate memory and our malloc
is also async-signal-unsafe.
Am I missing a scenario you might be considering?
next prev parent reply other threads:[~2018-02-20 14:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-07 14:10 [PATCH 1/3] Refactor Linux ARCH_FORK implementation Adhemerval Zanella
2018-02-07 13:09 ` [PATCH 3/3] Refactor atfork handlers Adhemerval Zanella
2018-02-07 15:13 ` Florian Weimer
2018-02-07 17:38 ` Adhemerval Zanella
2018-02-08 11:26 ` Florian Weimer
2018-02-08 13:49 ` Adhemerval Zanella
2018-02-20 12:57 ` Florian Weimer
2018-02-20 13:26 ` Adhemerval Zanella
2018-02-20 13:27 ` Florian Weimer
2018-02-20 13:30 ` Adhemerval Zanella
2018-02-20 13:48 ` Florian Weimer
2018-02-20 13:58 ` Adhemerval Zanella
2018-02-20 13:59 ` Florian Weimer
2018-02-20 17:22 ` Adhemerval Zanella [this message]
2018-02-23 12:17 ` Florian Weimer
2018-02-23 17:42 ` Adhemerval Zanella
2018-02-27 12:03 ` Florian Weimer
2018-02-07 13:35 ` [PATCH 2/3] dynarray: Implement remove function Adhemerval Zanella
2018-02-07 15:07 ` Alexander Monakov
2018-02-07 17:16 ` Adhemerval Zanella
2018-03-07 16:51 ` [PATCH 1/3] Refactor Linux ARCH_FORK implementation Adhemerval Zanella
2018-03-08 12:05 ` Florian Weimer
2018-03-08 12:58 ` Adhemerval Zanella
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=6d6bc007-7418-4667-bf2f-0ba2256cdbec@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@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).