public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Jan Kratochvil via Libc-alpha <libc-alpha@sourceware.org>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [patch] Make _thread_db_sizeof_pthread public for Sanitizers
Date: Fri, 01 Jan 2021 13:42:43 +0100	[thread overview]
Message-ID: <87sg7kesl8.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20210101100818.GA368024@host1.jankratochvil.net> (Jan Kratochvil via Libc-alpha's message of "Fri, 1 Jan 2021 11:08:18 +0100")

* Jan Kratochvil via Libc-alpha:

> Sanitizers currently contain ugly list of glibc versions and their
> sizeof(struct pthread).
> 	https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp#L276
>
> This list is not much maintained causing SEGVs of Sanitizers:
> 	$ echo 'int main(){}'|clang -g -fsanitize=leak -x c++ -;./a.out
> 	Tracer caught signal 11: addr=0x7f1087f51f40 pc=0x4222c8 sp=0x7f1086effd40
> 	==234624==LeakSanitizer has encountered a fatal error.
> 	==234624==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
> 	==234624==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
>
> I would find better if just glibc made the value public, Sanitizers can then
> read it by dlsym():

Do you know why the GetTLS function needs to know the size of the
thread descriptor?  And why it adds it to the start address of the TLS
area, without subtracting it from the area size?  I think this
identifies the wrong memory region as TLS.

  reply	other threads:[~2021-01-01 12:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-01 10:08 Jan Kratochvil
2021-01-01 12:42 ` Florian Weimer [this message]
2021-01-01 13:36   ` Carlos O'Donell
2021-01-02  8:24   ` Jan Kratochvil
2021-03-05 12:54 ` Florian Weimer

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=87sg7kesl8.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=jan.kratochvil@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).