[lld] [lld-macho] Include branch extension thunks in linker map (PR #120496)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 16:03:39 PST 2025


tstellar wrote:

I'm seeing some failures on our i386 builds after this commit:
https://download.copr.fedorainfracloud.org/results/@fedora-llvm-team/llvm-snapshots-big-merge-20250110/fedora-40-i386/08497704-llvm/builder-live.log.gz

Stack trace from the log below, but it's possible that it is running out of memory.

```
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
 #0 0xef659802 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/lib/Support/Unix/Signals.inc:723:13
 #1 0xef659e16 PrintStackTraceSignalHandler(void*) /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/lib/Support/Unix/Signals.inc:797:3
 #2 0xef657024 llvm::sys::RunSignalHandlers() /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/lib/Support/Signals.cpp:105:20
 #3 0xef659ffd SignalHandler(int) /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0xf7fa15a0 (linux-gate.so.1+0x5a0)
 #5 0xf7fa1589 (linux-gate.so.1+0x589)
 #6 0xeeb0c28f __pthread_kill_implementation (/lib/libc.so.6+0x9628f)
 #7 0xeeab2321 gsignal (/lib/libc.so.6+0x3c321)
 #8 0xeea99258 abort (/lib/libc.so.6+0x23258)
 #9 0xeed28d0c (/lib/libstdc++.so.6+0x7fd0c)
#10 0xeed3fca8 (/lib/libstdc++.so.6+0x96ca8)
#11 0xeed287f2 std::unexpected() (/lib/libstdc++.so.6+0x7f7f2)
#12 0xeed3fff0 __cxa_rethrow (/lib/libstdc++.so.6+0x96ff0)
#13 0xef583d29 lock /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/bits/std_mutex.h:117:2
#14 0xef583d29 lock_guard /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/bits/std_mutex.h:250:19
#15 0xef583d29 llvm::report_bad_alloc_error(char const*, bool) /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/lib/Support/ErrorHandling.cpp:155:33
#16 0xef5d25ac getNewCapacity<unsigned int> /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/lib/Support/SmallVector.cpp:103:5
#17 0xef5d25ac llvm::SmallVectorBase<unsigned int>::grow_pod(void*, unsigned int, unsigned int) /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/lib/Support/SmallVector.cpp:148:24
#18 0xf7bba94f begin /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/ADT/SmallVector.h:267:45
#19 0xf7bba94f end /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/ADT/SmallVector.h:269:27
#20 0xf7bba94f push_back /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/ADT/SmallVector.h:563:43
#21 0xf7bba94f gatherMapInfo /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/MapFile.cpp:100:35
#22 0xf7bba94f lld::macho::writeMapFile() /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/MapFile.cpp:196:18
#23 0xf7c1cb2d _M_ptr /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/bits/unique_ptr.h:193:51
#24 0xf7c1cb2d get /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/bits/unique_ptr.h:464:21
#25 0xf7c1cb2d operator-> /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/bits/unique_ptr.h:457:9
#26 0xf7c1cb2d operator() /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/Writer.cpp:1361:32
#27 0xf7c1cb2d operator()<(lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/Writer.cpp:1357:30) &> /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/Support/thread.h:43:11
#28 0xf7c1cb2d __invoke_impl<void, (lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/Support/thread.h:42:9), (lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/Writer.cpp:1357:30) &> /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/bits/invoke.h:61:14
#29 0xf7c1cb2d __invoke<(lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/Support/thread.h:42:9), (lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/Writer.cpp:1357:30) &> /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/bits/invoke.h:96:14
#30 0xf7c1cb2d __apply_impl<(lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/Writer.cpp:1357:30)> &, 0U> /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/tuple:2921:14
#31 0xf7c1cb2d apply<(lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/Support/thread.h:42:9), std::tuple<(lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/Writer.cpp:1357:30)> &> /usr/bin/../lib/gcc/i686-redhat-linux/14/../../../../include/c++/14/tuple:2936:14
#32 0xf7c1cb2d GenericThreadProxy<std::tuple<(lambda at /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/MachO/Writer.cpp:1357:30)> > /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/Support/thread.h:41:5
#33 0xf7c1cb2d void* llvm::thread::ThreadProxy<std::tuple<void (anonymous namespace)::Writer::run<lld::macho::LP64>()::'lambda'()>>(void*) /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/include/llvm/Support/thread.h:55:5
#34 0xeeb09e73 start_thread (/lib/libc.so.6+0x93e73)
#35 0xeeb90d38 __GI___clone3 (/lib/libc.so.6+0x11ad38)
/builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/redhat-linux-build/tools/lld/test/MachO/Output/arm64-thunks.s.script: line 6: 605633 Aborted                 (core dumped) ld64.lld -arch x86_64 -platform_version macos 11.0 11.0 -syslibroot /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/lld/test/MachO/Inputs/MacOSX.sdk -lSystem -fatal_warnings -arch arm64 -dead_strip -lSystem -U _extern_sym -map /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/redhat-linux-build/tools/lld/test/MachO/Output/arm64-thunks.s.tmp/thunk.map -o /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/redhat-linux-build/tools/lld/test/MachO/Output/arm64-thunks.s.tmp/thunk /builddir/build/BUILD/llvm-project-0e1c5bfac8574bc8419968279069c76b55e5f270/llvm/redhat-linux-build/tools/lld/test/MachO/Output/arm64-thunks.s.tmp/input.o

```


https://github.com/llvm/llvm-project/pull/120496


More information about the llvm-commits mailing list