From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id E2A443858D29 for ; Fri, 1 Jan 2021 12:42:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E2A443858D29 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1kvJlT-0008HM-W3; Fri, 01 Jan 2021 12:42:43 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1kvJlT-00045c-T8; Fri, 01 Jan 2021 13:42:43 +0100 From: Florian Weimer To: Jan Kratochvil via Libc-alpha Cc: Jan Kratochvil Subject: Re: [patch] Make _thread_db_sizeof_pthread public for Sanitizers References: <20210101100818.GA368024@host1.jankratochvil.net> Date: Fri, 01 Jan 2021 13:42:43 +0100 In-Reply-To: <20210101100818.GA368024@host1.jankratochvil.net> (Jan Kratochvil via Libc-alpha's message of "Fri, 1 Jan 2021 11:08:18 +0100") Message-ID: <87sg7kesl8.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2021 12:42:48 -0000 * 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.