RE: Bug#1126312: golang-1.25: FTBFS on s390x: TestTSAN: ThreadSanitizer: CHECK failed: tsan_platform_linux.cpp:571

Pranav P <[email protected]>
Newsgroups gmane.linux.debian.ports.s390
Message-ID <CO1PR15MB48416B41E74C520DABB75B89A075A@CO1PR15MB4841.namprd15.prod.outlook.com>
Hi Tianon,

Just a quick update.
We do have a patch for the issue. I will share its link once it is raised in LLVM.

Meanwhile, this is the patch for gcc.

diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
index 2b4934be0aa..ccc9ed42c5d 100644
--- a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -503,10 +503,10 @@ __attribute__((unused)) static void GetStaticTlsBoundary(uptr *addr, uptr *size,
   // loader places static TLS blocks this way not to waste space.
   uptr l = one;
   *align = ranges[l].align;
-  while (l != 0 && ranges[l].begin < ranges[l - 1].end + ranges[l].align)
+  while (l != 0 && ranges[l].begin <= ranges[l - 1].end + ranges[l].align)
     *align = Max(*align, ranges[--l].align);
   uptr r = one + 1;
-  while (r != len && ranges[r].begin < ranges[r - 1].end + ranges[r].align)
+  while (r != len && ranges[r].begin <= ranges[r - 1].end + ranges[r].align)
     *align = Max(*align, ranges[r++].align);
   *addr = ranges[l].begin;
   *size = ranges[r - 1].end - ranges[l].begin;

Thanks,
Pranav
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.