public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Fangrui Song <i@maskray.me>
Cc: libc-alpha@sourceware.org
Subject: Re: dlpi_tls_data is incorrect NULL when dlpi_tls_modid>0
Date: Sat, 03 Apr 2021 11:14:15 +0200	[thread overview]
Message-ID: <87a6qf3f2w.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <MWHPR1201MB0110F384A42A68BA9B7A5620CB7A9@MWHPR1201MB0110.namprd12.prod.outlook.com> (Fangrui Song's message of "Fri, 2 Apr 2021 16:06:01 -0700")

* Fangrui Song:

> I was trying to clean up llvm-project/compiler-rt sanitizers GetTls
> function https://reviews.llvm.org/D98926 and my change was reverted
> due to an annoying Ubuntu 16.04 glibc 2.23 bug (seem so on both amd64
> and ppc64le)
> dlpi_tls_data is incorrect NULL when dlpi_tls_modid>0.
>
> Thread 1 "tls_race.cpp.tm" hit Breakpoint 6,
> __sanitizer::CollectStaticTlsRanges (info=0x7fffffffe8d0, size=64,
> data=0x7fffffffe9d0) at
> /tmp/llvm/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:294
> 294       if (!info->dlpi_tls_data)
> (gdb) p *info
> $5 = {dlpi_addr = 0, dlpi_name = 0x7ffff7ffe6f8 "", dlpi_phdr =
> 0x400040, dlpi_phnum = 10, dlpi_adds = 10, dlpi_subs = 0,
> dlpi_tls_modid = 1, dlpi_tls_data = 0x0}
>
> This works fine on glibc 2.31.

How have you verified this on glibc 2.31?  As far as I can tell, the
TLS block address assignment happens lazily, and dl_iterate_phdr does
not trigger it.  So it could be the result of different TLS access
patterns.

  reply	other threads:[~2021-04-03  9:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 23:06 Fangrui Song
2021-04-03  9:14 ` Florian Weimer [this message]
2021-04-04  7:05   ` Fangrui Song
2021-04-06 10:38     ` Szabolcs Nagy

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=87a6qf3f2w.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=i@maskray.me \
    --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).