From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 367A4385828E for ; Tue, 5 Jul 2022 09:14:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 367A4385828E Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 10D1B66A69; Tue, 5 Jul 2022 05:13:58 -0400 (EDT) Message-ID: <47f0d09798bcdb7ac7ea4e462307337db5a0afec.camel@xry111.site> Subject: Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN From: Xi Ruoyao To: Fangrui Song , Dimitrije Milosevic Cc: "gcc-patches@gcc.gnu.org" , Djordje Todorovic Date: Tue, 05 Jul 2022 17:13:56 +0800 In-Reply-To: References: <7e4db89fea59f636afd7abce981cc625d940b5cd.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, LIKELY_SPAM_FROM, SPF_HELO_PASS, SPF_PASS, TXREP, T_PDS_OTHER_BAD_TLD, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2022 09:14:02 -0000 On Mon, 2022-07-04 at 21:21 -0700, Fangrui Song wrote: > > >=20 > > > > FAIL: c-c++-common/tsan/tls_race.c=C2=A0=C2=A0 -O0=C2=A0 output pat= tern test > > > > Output was: > > > > ThreadSanitizer: CHECK failed: tsan_platform_linux.cpp:452 > > > > "((thr_end)) <=3D ((tls_addr + tls_size))" (0xffec35f8c0, > > > > 0xffec35f784) (tid=3D748216) > > > > =C2=A0=C2=A0=C2=A0 #0 __tsan::CheckUnwind() > > > > ../../../../gcc/libsanitizer/tsan/tsan_rtl.cpp:627 > > > > (libtsan.so.2+0xa30ec) > > > > =C2=A0=C2=A0=C2=A0 #1 __sanitizer::CheckFailed(char const*, int, ch= ar const*, > > > > unsigned long long, unsigned long long) > > > > ../../../../gcc/libsanitizer/sanitizer_common/sanitizer_termination= . > > > > cpp:86 (libtsan.so.2+0xeb8cc) > > > > =C2=A0=C2=A0=C2=A0 #2 __tsan::ImitateTlsWrite(__tsan::ThreadState*,= unsigned long, > > > > unsigned long) > > > > ../../../../gcc/libsanitizer/tsan/tsan_platform_linux.cpp:452 > > > > (libtsan.so.2+0xa0cac) > > > > =C2=A0=C2=A0=C2=A0 #3 __tsan::ThreadStart(__tsan::ThreadState*, uns= igned int, > > > > unsigned long long, __sanitizer::ThreadType) > > > > ../../../../gcc/libsanitizer/tsan/tsan_rtl_thread.cpp:197 > > > > (libtsan.so.2+0xc0e88) > > > > =C2=A0=C2=A0=C2=A0 #4 __tsan_thread_start_func > > > > ../../../../gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:1009 > > > > (libtsan.so.2+0x3e5dc) > > > > =C2=A0=C2=A0=C2=A0 #5 start_thread /sources/glibc-2.35/nptl/pthread= _create.c:442 > > > > (libc.so.6+0xc75f4) > > > >=20 > > > > I've tried to diagnose the root cause but failed. > > >=20 > > > Hi Xi, thanks for looking into this. I've tried running the testsuite > > > on a cross-toolchain (as I do not currently have access to a physical > > > machine) > > > for a MIPS64R6 and the test passes successfully. Could you please > > > verify that the test fails solely based on this change? I've got a clue about why this happens. See https://reviews.llvm.org/D129112. It depends on how the dynamic linker arranges TLS blocks so different version of Glibc may produce different results. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University