From: Rich Felker <firstname.lastname@example.org>
To: Alexey Izbyshev <email@example.com>
Subject: Re: [musl] [PATCH] set tid address in fork
Date: Thu, 20 Jul 2023 13:30:43 -0400 [thread overview]
Message-ID: <20230720173042.GP4163@brightrain.aerifal.cx> (raw)
On Thu, Jul 20, 2023 at 05:22:07PM +0300, Alexey Izbyshev wrote:
> On 2023-07-20 16:53, changdiankang wrote:
> >In pthrad_exit the exiting thread will hold the thread list lock,
> >and will unlock it in kernel by clear the tid address
> >A thread created by pthrad_create is created with clone syscall with
> >CLONE_CHILD_CLEARTID flag and &__thread_list_lock as child_tid
> >parameter. When the thread exits, the thread list lock can be woke up
> >(see man clone CLONE_CHILD_CLEARTID).
> >But in fork, the main thread is created with fork syscall or with
> >clone syscall without CLONE_CHILD_CLEARTID flag. The
> >is not be set to tid address. So when the main thread exits, the thread
> >list lock can't be woke up by kernel. This may lead some problems when
> >other child threads try to hold this lock. For example, a child thread
> >blocks at waiting thread list lock when joining the main thread.
> >To fix this issue, we should set &__thread_list_lock to the main
> >thread tid
> >address in fork.
> This bug has already been discovered, see
Yes, and the fix is in an unpushed commit. Sorry! I'll review queue
and push in a bit.
prev parent reply other threads:[~2023-07-20 17:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-20 13:53 changdiankang
2023-07-20 14:22 ` Alexey Izbyshev
2023-07-20 17:30 ` Rich Felker [this message]
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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.
Code repositories for project(s) associated with this public inbox
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 NNTP newsgroup(s).