[llvm-bugs] [Bug 50769] New: lld-linked dylib causes crash related to TLV and weak visibility

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 18 12:05:56 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50769

            Bug ID: 50769
           Summary: lld-linked dylib causes crash related to TLV and weak
                    visibility
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: gkm at fb.com, jezreel at gmail.com,
                    llvm-bugs at lists.llvm.org, smeenai at fb.com

repro:
https://drive.google.com/file/d/1ltewPgQCgRrznXHPnLiLx8lsYk8CfdRC/view?usp=sharing

The repro file links libabsl.dylib , the other binaries are prebuilt.


 % ld @response.txt
 % ./gl_unittests --gtest_filter=GLSurfaceEGLTest.SurfaceFormatTest
--single-process-tests

=> passes


Same with ld64.lld crashes:

 % ./gl_unittests --gtest_filter=GLSurfaceEGLTest.SurfaceFormatTest
--single-process-tests
[94027:775:ERROR:icu_util.cc(179)] icudtl.dat not found in bundle
[94027:775:ERROR:icu_util.cc(243)] Invalid file descriptor to ICU data
received.
Note: Google Test filter = GLSurfaceEGLTest.SurfaceFormatTest
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from GLSurfaceEGLTest
[ RUN      ] GLSurfaceEGLTest.SurfaceFormatTest
Received signal 11 <unknown> 000000000000
0   libbase.dylib                       0x00000001060af32f
base::debug::CollectStackTrace(void**, unsigned long) + 31
1   libbase.dylib                       0x0000000105d9e0d8
base::debug::StackTrace::StackTrace(unsigned long) + 72
2   libbase.dylib                       0x0000000105d9e15d
base::debug::StackTrace::StackTrace(unsigned long) + 29
3   libbase.dylib                       0x0000000105d9e135
base::debug::StackTrace::StackTrace() + 37
4   libbase.dylib                       0x00000001060af1d3
base::debug::(anonymous namespace)::StackDumpSignalHandler(int, __siginfo*,
void*) + 1331
5   libsystem_platform.dylib            0x00007fff728d25fd _sigtramp + 29
6   ???                                 0x0000000000000000 0x0 + 0
7   libabsl.dylib                       0x0000000108340936
absl::container_internal::ShouldInsertBackwards(unsigned long, signed char*) +
38
8   libGLESv2.dylib                     0x000000011dacdc2b
absl::container_internal::find_first_non_full(signed char*, unsigned long,
unsigned long) + 219



That code is this thread_local:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/abseil-cpp/absl/container/internal/raw_hash_set.cc;l=31?q=raw_hash_set.cc
(We go down the  ABSL_HAVE_THREAD_LOCAL branch)

libabsl.dylib is built with default visibility. All the other binaries were
built with -fvisibility=hidden. If we build the absl code with
-fvisibility-inlines-hidden, the crash goes away.



Downstrem bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1220100

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210618/45cca7ad/attachment.html>


More information about the llvm-bugs mailing list