mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Dominic Chen <d.c.ddcc@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] Incorrect thread TID caching
Date: Wed, 03 Feb 2021 08:16:30 +0100	[thread overview]
Message-ID: <87zh0ltycx.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <62be4b85-4a42-413e-a83f-866eab4d601a@gmail.com> (Dominic Chen's message of "Tue, 2 Feb 2021 23:04:23 -0500")

* Dominic Chen:

> From a quick skim of other libc implementations, both bionic and glibc
> don't seem to cache TID, and directly call the gettid system call
> inside raise().

Of course glibc has a TID cache.  It doesn't use it in raise (mostly to
get abort working after vfork), but it's definitely needed in other
places.

If you use the clone system call wrapper in threading (not fork/vfork)
mode, you cannot call any libc functions afterwards, including the
syscall function.  Instead, you have to issue direct system calls.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


  reply	other threads:[~2021-02-03  7:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03  4:04 Dominic Chen
2021-02-03  7:16 ` Florian Weimer [this message]
2021-02-03 19:21 ` Rich Felker
2021-02-03 20:21   ` Dominic Chen
2021-02-03 21:01     ` Rich Felker
2021-02-03 22:30       ` Dominic Chen
2021-02-03 22:55         ` Rich Felker
2021-02-15 16:56           ` Rich Felker
2021-02-17 19:49             ` Dominic Chen
2021-02-17 20:11               ` Rich Felker
2021-02-17 21:07                 ` Rich Felker
2021-03-12 21:14                   ` Dominic Chen
2021-02-04  3:28     ` Carlos O'Donell
2021-02-04  4:22       ` Dominic Chen
2021-02-04 16:15         ` Rich Felker

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=87zh0ltycx.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=d.c.ddcc@gmail.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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