Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: lld randomly crashing since update to 16.0.0 #15867

Closed
finagolfin opened this issue Mar 30, 2023 · 22 comments
Closed

[Bug]: lld randomly crashing since update to 16.0.0 #15867

finagolfin opened this issue Mar 30, 2023 · 22 comments
Labels
bug report Something is not working properly help wanted Help is wanted in order to solve the issue

Comments

@finagolfin
Copy link
Member

Problem description

I see random crashes when linking, that always go away if I run the same command again, ie it's usually not reproducible. This is only since the LLVM 16 update, LLVM 15 worked well.

Sometimes, it'll just segfault:

error: link command failed with exit code 1 (use -v to see invocation)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /data/data/com.termux/files/usr/bin/ld.lld --sysroot=/data/data/com.termux/files -pie -EL --fix-cortex-a53-843419 -z now -z relro -z max-page-size=4096 --hash-style=gnu -rpath=/data/data/com.termux/files/usr/lib --eh-frame-hdr -m aarch64linux -dynamic-linker /system/bin/linker64 -o ...
clang-16: error: unable to execute command: Segmentation fault
clang-16: error: linker command failed due to signal (use -v to see invocation)

Other times, it'll claim issues with memory tagging:

error: link command failed with exit code 1 (use -v to see invocation)
Pointer tag for 0xe2a9a7d900000000 was truncated, see 'https://source.android.com/devices/tech/debug/tagged-pointers'.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
clang-16: error: unable to execute command: Aborted
clang-16: error: linker command failed due to signal (use -v to see invocation)

Posting this here so that others can chime in, and maybe we can track it down.

What steps will reproduce the bug?

Linking various software

What is the expected behavior?

No crashes

System information

termux-info:

Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Updatable packages:
All packages up to date
termux-tools version:
1.37.0
Android version:
13
Kernel build information:
Linux localhost 4.19.113-25884040 #1 SMP PREEMPT Wed Mar 1 10:29:01 +07 2023 aarch64 Android
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@finagolfin finagolfin added bug report Something is not working properly untriaged help wanted Help is wanted in order to solve the issue and removed untriaged labels Mar 30, 2023
@landfillbaby
Copy link
Member

does it still happen with 16.0.1?

@finagolfin
Copy link
Member Author

Yep, but maybe a little less.

@licy183
Copy link
Member

licy183 commented Apr 7, 2023

MTE can be disabled just like what we have done in java, see #7332.

@finagolfin
Copy link
Member Author

I'd rather find the problem and fix it.

@xtkoba
Copy link
Contributor

xtkoba commented Apr 7, 2023

Trying to narrowing down a bit. My guess is this is not just an issue of tagged pointers but an instance of more general memory issue. Tests suggested on older Android that does not care for tagged pointers.

Pointer tag for 0xe2a9a7d900000000 was truncated, see 'https://source.android.com/devices/tech/debug/tagged-pointers'.

This address value is peculiar at a glance. The lower 32 bits are zeroed.

@finagolfin
Copy link
Member Author

I think you are right, this is probably some kind of memory leak in lld, that is occasionally being caught by tagged pointers. Right now, Bionic's malloc always sets B4 as the top byte of every pointer to an allocation: for it to be changed so much to E2 suggests some kind of memory overrun.

@finagolfin
Copy link
Member Author

I opened an issue upstream and found that I could only reproduce on Snapdragon devices. Could others with Snapdragon devices try this out and let me know what you find?

pkg install swift git
git clone --depth 1 https://github.com/apple/swift-nio.git
cd swift-nio
swift build --build-tests

If that shows no linker crash, a swift package clean followed by buillding again, then cycling those two commands about 20-30 times should be a good test.

@xtkoba
Copy link
Contributor

xtkoba commented Apr 22, 2023

To voluntary testers,

I recommend using a debug build of LLD. PR #16395 provides a build of LLD with assertions, debug symbols and ASan. Please share the full stack trace output of the crashing command. Also sharing the output of

cat /proc/cpuinfo

command is suggested when reporting a crash, along with termux-info output.

@licy183
Copy link
Member

licy183 commented Apr 25, 2023

I cannot reproduce this issue on my Snapdragon device, but swift sometimes hangs on my device.

~ $ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x2
CPU part        : 0xd05
CPU revision    : 0

processor       : 1
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x2
CPU part        : 0xd05
CPU revision    : 0

processor       : 2
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x2
CPU part        : 0xd05
CPU revision    : 0

processor       : 3
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x2
CPU part        : 0xd05
CPU revision    : 0

processor       : 4
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd41
CPU revision    : 0

processor       : 5
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd41
CPU revision    : 0

processor       : 6
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd41
CPU revision    : 0

processor       : 7
BogoMIPS        : 38.40
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x1
CPU part        : 0xd44
CPU revision    : 0

Hardware        : Odin based on Qualcomm Technologies, Inc SM8350
~ $ termux-info
Termux Variables:
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=29933
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.dev/apt/termux-main stable main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.dev/apt/termux-x11 x11 main
Updatable packages:
command-not-found/stable 2.1.0-20 aarch64 [upgradable from: 2.1.0-19]
nodejs-16/tur-packages 16.20.0 aarch64 [upgradable from: 16.19.1-1]
python-numpy/stable 1.24.3 aarch64 [upgradable from: 1.24.2]
python-pip/stable 23.1.1 all [upgradable from: 23.1]
termux-tools version:
1.38.1
Android version:
12
Kernel build information:
Linux localhost 5.4.147-qgki-g4ae49e8272b4 #1 SMP PREEMPT Thu Jul 28 01:15:51 CST 2022 f2fs-hash:9f5701dafc aarch64 Android
Device manufacturer:
Xiaomi
Device model:
2106118C
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
~ $

@finagolfin
Copy link
Member Author

@licy183, how many times did you run the swift build command to check? Any one run is unlikely to trigger this linker segfault, the failure rate is less than 5%.

Where does swift hang, does it usually say something like "wrapping the AST for..." and get stuck? That is a known race in the swift build that happens 5-10% of the time.

@licy183
Copy link
Member

licy183 commented Apr 26, 2023

@licy183, how many times did you run the swift build command to check? Any one run is unlikely to trigger this linker segfault, the failure rate is less than 5%.

I tried 30 times using bash script, but I cannot reproduce this linker crash.

Where does swift hang, does it usually say something like "wrapping the AST for..." and get stuck? That is a known race in the swift build that happens 5-10% of the time.

Yes, it sometimes hangs after outputing "wrapping the AST for".

@finagolfin
Copy link
Member Author

I tried 30 times using bash script, but I cannot reproduce this linker crash.

Did you run swift package clean after each build, otherwise it won't rebuild? Which lld did you try: the debug one that was specially built and linked above? If you only tried one, can you try the other now, ie the normal lld package or the debug lld?

@licy183
Copy link
Member

licy183 commented May 5, 2023

Did you run swift package clean after each build, otherwise it won't rebuild? Which lld did you try: the debug one that was specially built and linked above? If you only tried one, can you try the other now, ie the normal lld package or the debug lld?

I've tried lld and lld-debug, but with neither of them I can reproduce the crash on Xiaomi MIX4 (Android 12). I'll try on my other Snapdragon devices later.

@finagolfin
Copy link
Member Author

I have reported this upstream. @xtkoba, you said you were not able to reproduce, can you let us know what CPUs you tried? cat /proc/cpuinfo | grep Hardware will list the model number.

@xtkoba
Copy link
Contributor

xtkoba commented May 17, 2023

Not yet reproduced on:

  • SDM632 (Qualcomm Snapdragon 632)
  • MT6765H (MediaTek Helio G37)

@finagolfin
Copy link
Member Author

Thanks, will let them know. Let me know if anything changes on the Snapdragon.

@finagolfin
Copy link
Member Author

I'm able to reproduce with the debug build of lld 16, but it is somewhat useless as it simply trips an assertion on the few occasions that it fails:

/home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:294: llvm::SmallVectorTemplateCommon::reference llvm::SmallVectorTemplateCommon<llvm::SmallVector<lld::elf::DynamicReloc, 0>>::operator[](llvm::SmallVectorTemplateCommon::size_type) [T = llvm::SmallVector<lld::elf::DynamicReloc, 0>]: assertion "idx < size()" failed
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Aborted

When I tried to run it in lldb to get a backtrace, it immediately errors out and prints a message that the LeakSanitizer cannot be run under a debugger:

==6520==LeakSanitizer has encountered a fatal error.
==6520==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==6520==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

I'm going to rebuild lld-debug without the sanitizer, so I can actually run this in lldb, will report what I find.

@finagolfin
Copy link
Member Author

@licy183, would you try the procedure I just detailed upstream on your MIX4 and any other Snapdragon devices you have?

@licy183
Copy link
Member

licy183 commented May 22, 2023

Yeah, I can reproduce the crash on following devices:

  1. Snapdragon 870 (Xiaomi Pad 5 Pro, Android 13)
=================================================================
==24534==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x003e86131988 at pc 0x005a867b5cd8 bp 0x0077c8eecf90 sp 0x0077c8eecf88
READ of size 4 at 0x003e86131988 thread T7
    #0 0x5a867b5cd4 in size /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:91:32
    #1 0x5a867b5cd4 in reserveForParamAndGetAddressImpl<llvm::SmallVectorTemplateBase<lld::elf::DynamicReloc, true> > /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:234:28
    #2 0x5a867b5cd4 in reserveForParamAndGetAddress /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:534:12
    #3 0x5a867b5cd4 in push_back /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:566:23
    #4 0x5a867b5cd4 in addReloc<true> /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:560:47
    #5 0x5a867b5cd4 in void lld::elf::RelocationBaseSection::addReloc<true>(lld::elf::DynamicReloc::Kind, unsigned int, lld::elf::InputSectionBase&, unsigned long, lld::elf::Symbol&, long, lld::elf::RelExpr, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:530:5
    #6 0x5a867b548c in addRelativeReloc<true> /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:514:5
    #7 0x5a867b548c in void addRelativeReloc<true>(lld::elf::InputSectionBase&, unsigned long, lld::elf::Symbol&, long, lld::elf::RelExpr, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:867:17
    #8 0x5a867b12b4 in (anonymous namespace)::RelocationScanner::processAux(lld::elf::RelExpr, unsigned int, unsigned long, lld::elf::Symbol&, long) const /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1094:7
    #9 0x5a867c1508 in scanOne<llvm::object::ELFType<llvm::support::little, true>, const llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::support::little, true>, true> > /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1431:3
    #10 0x5a867c1508 in scan<llvm::object::ELFType<llvm::support::little, true>, llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::support::little, true>, true> > /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1488:5
    #11 0x5a867c1508 in void (anonymous namespace)::RelocationScanner::scanSection<llvm::object::ELFType<(llvm::support::endianness)1, true>>(lld::elf::InputSectionBase&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1507:5
    #12 0x5a867d0e34 in operator() /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1529:28
    #13 0x5a867d0e34 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1523:15) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #14 0x5a867d0e34 in __call<(lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1523:15) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__functional_base:348:9
    #15 0x5a867d0e34 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1557:16
    #16 0x5a867d0e34 in std::__ndk1::__function::__func<void lld::elf::scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>>()::'lambda'(), std::__ndk1::allocator<void lld::elf::scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>>()::'lambda'()>, void ()>::operator()() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1731:12
    #17 0x78728a71d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1884:16
    #18 0x78728a71d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:2556:12
    #19 0x78728a71d8 in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:177:7
    #20 0x78728a71d8 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:49) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #21 0x78728a71d8 in __call<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:49) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__functional_base:348:9
    #22 0x78728a71d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1557:16
    #23 0x78728a71d8 in std::__ndk1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>)::$_0, std::__ndk1::allocator<llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>)::$_0>, void ()>::operator()() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1731:12
    #24 0x78728a4c18 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1884:16
    #25 0x78728a4c18 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:2556:12
    #26 0x78728a4c18 in llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:117:7
    #27 0x78728a4fe0 in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:36
    #28 0x78728a4fe0 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #29 0x78728a4fe0 in __thread_execute<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct> >, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:273:5
    #30 0x78728a4fe0 in void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct>>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()>>(void*) /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:284:5
    #31 0x7866afa5c8 in __pthread_start(void*) pthread_create.cpp
    #32 0x7866a93fbc in __start_thread clone.cpp

0x003e86131988 is located 8 bytes to the right of 96-byte region [0x003e86131920,0x003e86131980)
allocated by thread T0 here:
    #0 0x7869b5423c in malloc out/lib/compiler-rt-aarch64/out/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:69:3
    #1 0x78728e096c in safe_malloc /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/MemAlloc.h:26:18
    #2 0x78728e096c in llvm::SmallVectorBase<unsigned int>::mallocForGrow(void*, unsigned long, unsigned long, unsigned long&) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/SmallVector.cpp:130:19
    #3 0x5a868eac74 in mallocForGrow /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:447:48
    #4 0x5a868eac74 in llvm::SmallVectorTemplateBase<llvm::SmallVector<lld::elf::DynamicReloc, 0u>, false>::growAndAssign(unsigned long, llvm::SmallVector<lld::elf::DynamicReloc, 0u> const&) /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:397:18
    #5 0x5a8689c14c in SmallVector /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:1211:11
    #6 0x5a8689c14c in RelocationBaseSection /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.cpp:1589:7
    #7 0x5a8689c14c in lld::elf::RelocationSection<llvm::object::ELFType<(llvm::support::endianness)1, true>>::RelocationSection(llvm::StringRef, bool, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.cpp:1678:7
    #8 0x5a869bf1d4 in make_unique<lld::elf::RelocationSection<llvm::object::ELFType<llvm::support::little, true> >, llvm::StringRef &, bool &, const unsigned int &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:3092:32
    #9 0x5a869bf1d4 in void lld::elf::createSyntheticSections<llvm::object::ELFType<(llvm::support::endianness)1, true>>() /home/builder/.termux-build/lld-debug/src/lld/ELF/Writer.cpp:357:22
    #10 0x5a8656ab68 in lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2807:3
    #11 0x5a865476ac in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:621:5
    #12 0x5a86544acc in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:145:19
    #13 0x5a8634a294 in lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:168:12
    #14 0x5a86349144 in lld_main(int, char**) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:230:12
    #15 0x7866a8a9b8 in __libc_init (/apex/com.android.runtime/lib64/bionic/libc.so+0x859b8) (BuildId: 449f781894033dce6346794a1ee593e0)
    #16 0x5a863484e4 in _start_main crtbegin.c

Thread T7 created by T1 here:
    #0 0x7869b4c260 in pthread_create out/lib/compiler-rt-aarch64/out/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
    #1 0x78728a404c in __libcpp_thread_create /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__threading_support:471:10
    #2 0x78728a404c in thread<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30), void> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:300:16
    #3 0x78728a404c in construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1921:31
    #4 0x78728a404c in __construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1784:21
    #5 0x78728a404c in construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1605:14
    #6 0x78728a404c in __construct_one_at_end<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/vector:924:5
    #7 0x78728a404c in emplace_back<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/vector:1683:9
    #8 0x78728a404c in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:17
    #9 0x78728a404c in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #10 0x78728a404c in __thread_execute<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct> >, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:273:5
    #11 0x78728a404c in void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct>>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()>>(void*) /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:284:5
    #12 0x7866afa5c8 in __pthread_start(void*) pthread_create.cpp
    #13 0x7866a93fbc in __start_thread clone.cpp

Thread T1 created by T0 here:
    #0 0x7869b4c260 in pthread_create out/lib/compiler-rt-aarch64/out/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
    #1 0x78728a2d48 in __libcpp_thread_create /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__threading_support:471:10
    #2 0x78728a2d48 in thread<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30), void> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:300:16
    #3 0x78728a2d48 in ThreadPoolExecutor /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:18
    #4 0x78728a2d48 in llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::Creator::call() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:91:38
    #5 0x78728935a0 in llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/ManagedStatic.cpp:34:19
    #6 0x78728a1f90 in operator* /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/ManagedStatic.h:89:7
    #7 0x78728a1f90 in getDefaultExecutor /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:151:53
    #8 0x78728a1f90 in llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:5
    #9 0x78728a2688 in llvm::parallelFor(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:212:10
    #10 0x5a86563eac in parallelForEach<lld::elf::ELFFileBase **, (lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:36)> /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/Parallel.h:234:3
    #11 0x5a86563eac in parallelForEach<llvm::SmallVector<lld::elf::ELFFileBase *, 0U> &, (lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:36)> /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/Parallel.h:262:3
    #12 0x5a86563eac in lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:3
    #13 0x5a865476ac in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:621:5
    #14 0x5a86544acc in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:145:19
    #15 0x5a8634a294 in lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:168:12
    #16 0x5a86349144 in lld_main(int, char**) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:230:12
    #17 0x7866a8a9b8 in __libc_init (/apex/com.android.runtime/lib64/bionic/libc.so+0x859b8) (BuildId: 449f781894033dce6346794a1ee593e0)
    #18 0x5a863484e4 in _start_main crtbegin.c

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:91:32 in size
Shadow bytes around the buggy address:
  0x0017d0c262e0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c262f0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c26300: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c26310: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c26320: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0017d0c26330: fa[fa]fa fa 00 00 00 00 00 00 00 00 00 fa fa fa
  0x0017d0c26340: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c26350: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c26360: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c26370: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
  0x0017d0c26380: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==24534==ABORTING
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Aborted
  1. Snapdragon 888+ (Xiaomi MIX4, Android 12)
=================================================================
==19400==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x00416a551ff8 at pc 0x005b6abcdcd8 bp 0x007814817f90 sp 0x007814817f88
READ of size 4 at 0x00416a551ff8 thread T8
    #0 0x5b6abcdcd4 in size /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:91:32
    #1 0x5b6abcdcd4 in reserveForParamAndGetAddressImpl<llvm::SmallVectorTemplateBase<lld::elf::DynamicReloc, true> > /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:234:28
    #2 0x5b6abcdcd4 in reserveForParamAndGetAddress /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:534:12
    #3 0x5b6abcdcd4 in push_back /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:566:23
    #4 0x5b6abcdcd4 in addReloc<true> /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:560:47
    #5 0x5b6abcdcd4 in void lld::elf::RelocationBaseSection::addReloc<true>(lld::elf::DynamicReloc::Kind, unsigned int, lld::elf::InputSectionBase&, unsigned long, lld::elf::Symbol&, long, lld::elf::RelExpr, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:530:5
    #6 0x5b6abcd48c in addRelativeReloc<true> /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:514:5
    #7 0x5b6abcd48c in void addRelativeReloc<true>(lld::elf::InputSectionBase&, unsigned long, lld::elf::Symbol&, long, lld::elf::RelExpr, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:867:17
    #8 0x5b6abc92b4 in (anonymous namespace)::RelocationScanner::processAux(lld::elf::RelExpr, unsigned int, unsigned long, lld::elf::Symbol&, long) const /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1094:7
    #9 0x5b6abd9508 in scanOne<llvm::object::ELFType<llvm::support::little, true>, const llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::support::little, true>, true> > /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1431:3
    #10 0x5b6abd9508 in scan<llvm::object::ELFType<llvm::support::little, true>, llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::support::little, true>, true> > /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1488:5
    #11 0x5b6abd9508 in void (anonymous namespace)::RelocationScanner::scanSection<llvm::object::ELFType<(llvm::support::endianness)1, true>>(lld::elf::InputSectionBase&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1507:5
    #12 0x5b6abe8e34 in operator() /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1529:28
    #13 0x5b6abe8e34 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1523:15) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #14 0x5b6abe8e34 in __call<(lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1523:15) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__functional_base:348:9
    #15 0x5b6abe8e34 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1557:16
    #16 0x5b6abe8e34 in std::__ndk1::__function::__func<void lld::elf::scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>>()::'lambda'(), std::__ndk1::allocator<void lld::elf::scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>>()::'lambda'()>, void ()>::operator()() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1731:12
    #17 0x78bcddc1d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1884:16
    #18 0x78bcddc1d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:2556:12
    #19 0x78bcddc1d8 in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:177:7
    #20 0x78bcddc1d8 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:49) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #21 0x78bcddc1d8 in __call<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:49) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__functional_base:348:9
    #22 0x78bcddc1d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1557:16
    #23 0x78bcddc1d8 in std::__ndk1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>)::$_0, std::__ndk1::allocator<llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>)::$_0>, void ()>::operator()() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1731:12
    #24 0x78bcdd9c18 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1884:16
    #25 0x78bcdd9c18 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:2556:12
    #26 0x78bcdd9c18 in llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:117:7
    #27 0x78bcdd9fe0 in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:36
    #28 0x78bcdd9fe0 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #29 0x78bcdd9fe0 in __thread_execute<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct> >, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:273:5
    #30 0x78bcdd9fe0 in void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct>>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()>>(void*) /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:284:5
    #31 0x78b4911b14 in __pthread_start(void*) pthread_create.cpp
    #32 0x78b48ae35c in __start_thread clone.cpp

0x00416a551ff8 is located 8 bytes to the right of 112-byte region [0x00416a551f80,0x00416a551ff0)
allocated by thread T0 here:
    #0 0x78b358b1d0 in malloc out/lib/compiler-rt-aarch64/out/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x78bce1596c in safe_malloc /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/MemAlloc.h:26:18
    #2 0x78bce1596c in llvm::SmallVectorBase<unsigned int>::mallocForGrow(void*, unsigned long, unsigned long, unsigned long&) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/SmallVector.cpp:130:19
    #3 0x5b6ad02c74 in mallocForGrow /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:447:48
    #4 0x5b6ad02c74 in llvm::SmallVectorTemplateBase<llvm::SmallVector<lld::elf::DynamicReloc, 0u>, false>::growAndAssign(unsigned long, llvm::SmallVector<lld::elf::DynamicReloc, 0u> const&) /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:397:18
    #5 0x5b6acb414c in SmallVector /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:1211:11
    #6 0x5b6acb414c in RelocationBaseSection /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.cpp:1589:7
    #7 0x5b6acb414c in lld::elf::RelocationSection<llvm::object::ELFType<(llvm::support::endianness)1, true>>::RelocationSection(llvm::StringRef, bool, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.cpp:1678:7
    #8 0x5b6add71d4 in make_unique<lld::elf::RelocationSection<llvm::object::ELFType<llvm::support::little, true> >, llvm::StringRef &, bool &, const unsigned int &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:3092:32
    #9 0x5b6add71d4 in void lld::elf::createSyntheticSections<llvm::object::ELFType<(llvm::support::endianness)1, true>>() /home/builder/.termux-build/lld-debug/src/lld/ELF/Writer.cpp:357:22
    #10 0x5b6a982b68 in lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2807:3
    #11 0x5b6a95f6ac in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:621:5
    #12 0x5b6a95cacc in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:145:19
    #13 0x5b6a762294 in lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:168:12
    #14 0x5b6a761144 in lld_main(int, char**) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:230:12
    #15 0x78b48a536c in __libc_init (/apex/com.android.runtime/lib64/bionic/libc.so+0x8336c)
    #16 0x5b6a7604e4 in _start_main crtbegin.c

Thread T8 created by T1 here:
    #0 0x78b35834e8 in pthread_create out/lib/compiler-rt-aarch64/out/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
    #1 0x78bcdd904c in __libcpp_thread_create /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__threading_support:471:10
    #2 0x78bcdd904c in thread<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30), void> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:300:16
    #3 0x78bcdd904c in construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1921:31
    #4 0x78bcdd904c in __construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1784:21
    #5 0x78bcdd904c in construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1605:14
    #6 0x78bcdd904c in __construct_one_at_end<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/vector:924:5
    #7 0x78bcdd904c in emplace_back<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/vector:1683:9
    #8 0x78bcdd904c in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:17
    #9 0x78bcdd904c in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #10 0x78bcdd904c in __thread_execute<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct> >, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:273:5
    #11 0x78bcdd904c in void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct>>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()>>(void*) /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:284:5
    #12 0x78b4911b14 in __pthread_start(void*) pthread_create.cpp
    #13 0x78b48ae35c in __start_thread clone.cpp

Thread T1 created by T0 here:
    #0 0x78b35834e8 in pthread_create out/lib/compiler-rt-aarch64/out/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
    #1 0x78bcdd7d48 in __libcpp_thread_create /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__threading_support:471:10
    #2 0x78bcdd7d48 in thread<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30), void> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:300:16
    #3 0x78bcdd7d48 in ThreadPoolExecutor /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:18
    #4 0x78bcdd7d48 in llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::Creator::call() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:91:38
    #5 0x78bcdc85a0 in llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/ManagedStatic.cpp:34:19
    #6 0x78bcdd6f90 in operator* /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/ManagedStatic.h:89:7
    #7 0x78bcdd6f90 in getDefaultExecutor /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:151:53
    #8 0x78bcdd6f90 in llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:5
    #9 0x78bcdd7688 in llvm::parallelFor(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:212:10
    #10 0x5b6a97beac in parallelForEach<lld::elf::ELFFileBase **, (lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:36)> /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/Parallel.h:234:3
    #11 0x5b6a97beac in parallelForEach<llvm::SmallVector<lld::elf::ELFFileBase *, 0U> &, (lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:36)> /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/Parallel.h:262:3
    #12 0x5b6a97beac in lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:3
    #13 0x5b6a95f6ac in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:621:5
    #14 0x5b6a95cacc in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:145:19
    #15 0x5b6a762294 in lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:168:12
    #16 0x5b6a761144 in lld_main(int, char**) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:230:12
    #17 0x78b48a536c in __libc_init (/apex/com.android.runtime/lib64/bionic/libc.so+0x8336c)
    #18 0x5b6a7604e4 in _start_main crtbegin.c

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:91:32 in size
Shadow bytes around the buggy address:
  0x00182d4aa3a0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x00182d4aa3b0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
  0x00182d4aa3c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x00182d4aa3d0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x00182d4aa3e0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
=>0x00182d4aa3f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa[fa]
  0x00182d4aa400: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x00182d4aa410: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
  0x00182d4aa420: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x00182d4aa430: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x00182d4aa440: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==19400==ABORTING
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Aborted
  1. Snapdragon 845 (Xiaomi MIX2s, Android 10)
=================================================================
==20359==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x00409e77c0b8 at pc 0x005a9edf1cd8 bp 0x00788b26aff0 sp 0x00788b26afe8
READ of size 4 at 0x00409e77c0b8 thread T8
    #0 0x5a9edf1cd4 in size /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:91:32
    #1 0x5a9edf1cd4 in reserveForParamAndGetAddressImpl<llvm::SmallVectorTemplateBase<lld::elf::DynamicReloc, true> > /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:234:28
    #2 0x5a9edf1cd4 in reserveForParamAndGetAddress /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:534:12
    #3 0x5a9edf1cd4 in push_back /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:566:23
    #4 0x5a9edf1cd4 in addReloc<true> /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:560:47
    #5 0x5a9edf1cd4 in void lld::elf::RelocationBaseSection::addReloc<true>(lld::elf::DynamicReloc::Kind, unsigned int, lld::elf::InputSectionBase&, unsigned long, lld::elf::Symbol&, long, lld::elf::RelExpr, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:530:5
    #6 0x5a9edf148c in addRelativeReloc<true> /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.h:514:5
    #7 0x5a9edf148c in void addRelativeReloc<true>(lld::elf::InputSectionBase&, unsigned long, lld::elf::Symbol&, long, lld::elf::RelExpr, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:867:17
    #8 0x5a9eded2b4 in (anonymous namespace)::RelocationScanner::processAux(lld::elf::RelExpr, unsigned int, unsigned long, lld::elf::Symbol&, long) const /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1094:7
    #9 0x5a9edfd508 in scanOne<llvm::object::ELFType<llvm::support::little, true>, const llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::support::little, true>, true> > /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1431:3
    #10 0x5a9edfd508 in scan<llvm::object::ELFType<llvm::support::little, true>, llvm::object::Elf_Rel_Impl<llvm::object::ELFType<llvm::support::little, true>, true> > /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1488:5
    #11 0x5a9edfd508 in void (anonymous namespace)::RelocationScanner::scanSection<llvm::object::ELFType<(llvm::support::endianness)1, true>>(lld::elf::InputSectionBase&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1507:5
    #12 0x5a9ee0ce34 in operator() /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1529:28
    #13 0x5a9ee0ce34 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1523:15) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #14 0x5a9ee0ce34 in __call<(lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Relocations.cpp:1523:15) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__functional_base:348:9
    #15 0x5a9ee0ce34 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1557:16
    #16 0x5a9ee0ce34 in std::__ndk1::__function::__func<void lld::elf::scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>>()::'lambda'(), std::__ndk1::allocator<void lld::elf::scanRelocations<llvm::object::ELFType<(llvm::support::endianness)1, true>>()::'lambda'()>, void ()>::operator()() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1731:12
    #17 0x78b01331d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1884:16
    #18 0x78b01331d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:2556:12
    #19 0x78b01331d8 in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:177:7
    #20 0x78b01331d8 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:49) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #21 0x78b01331d8 in __call<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:49) &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__functional_base:348:9
    #22 0x78b01331d8 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1557:16
    #23 0x78b01331d8 in std::__ndk1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>)::$_0, std::__ndk1::allocator<llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>)::$_0>, void ()>::operator()() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1731:12
    #24 0x78b0130c18 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:1884:16
    #25 0x78b0130c18 in operator() /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/functional:2556:12
    #26 0x78b0130c18 in llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:117:7
    #27 0x78b0130fe0 in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:36
    #28 0x78b0130fe0 in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #29 0x78b0130fe0 in __thread_execute<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct> >, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:273:5
    #30 0x78b0130fe0 in void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct>>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()>>(void*) /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:284:5
    #31 0x78ba6db110 in __pthread_start(void*) pthread_create.cpp
    #32 0x78ba679314 in __start_thread clone.cpp

0x00409e77c0b8 is located 8 bytes to the right of 112-byte region [0x00409e77c040,0x00409e77c0b0)
allocated by thread T0 here:
    #0 0x78aa8c61a4 in malloc /toolchain/compiler-rt/lib/asan/asan_malloc_linux.cc:145:3
    #1 0x78b016c96c in safe_malloc /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/MemAlloc.h:26:18
    #2 0x78b016c96c in llvm::SmallVectorBase<unsigned int>::mallocForGrow(void*, unsigned long, unsigned long, unsigned long&) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/SmallVector.cpp:130:19
    #3 0x5a9ef26c74 in mallocForGrow /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:447:48
    #4 0x5a9ef26c74 in llvm::SmallVectorTemplateBase<llvm::SmallVector<lld::elf::DynamicReloc, 0u>, false>::growAndAssign(unsigned long, llvm::SmallVector<lld::elf::DynamicReloc, 0u> const&) /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:397:18
    #5 0x5a9eed814c in SmallVector /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:1211:11
    #6 0x5a9eed814c in RelocationBaseSection /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.cpp:1589:7
    #7 0x5a9eed814c in lld::elf::RelocationSection<llvm::object::ELFType<(llvm::support::endianness)1, true>>::RelocationSection(llvm::StringRef, bool, unsigned int) /home/builder/.termux-build/lld-debug/src/lld/ELF/SyntheticSections.cpp:1678:7
    #8 0x5a9effb1d4 in make_unique<lld::elf::RelocationSection<llvm::object::ELFType<llvm::support::little, true> >, llvm::StringRef &, bool &, const unsigned int &> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:3092:32
    #9 0x5a9effb1d4 in void lld::elf::createSyntheticSections<llvm::object::ELFType<(llvm::support::endianness)1, true>>() /home/builder/.termux-build/lld-debug/src/lld/ELF/Writer.cpp:357:22
    #10 0x5a9eba6b68 in lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2807:3
    #11 0x5a9eb836ac in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:621:5
    #12 0x5a9eb80acc in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:145:19
    #13 0x5a9e986294 in lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:168:12
    #14 0x5a9e985144 in lld_main(int, char**) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:230:12
    #15 0x78ba672bc4 in __libc_init (/apex/com.android.runtime/lib64/bionic/libc.so+0x6ebc4)
    #16 0x5a9e9844e4 in _start_main crtbegin.c

Thread T8 created by T1 here:
    #0 0x78aa8b45b8 in pthread_create /toolchain/compiler-rt/lib/asan/asan_interceptors.cc:209:3
    #1 0x78b013004c in __libcpp_thread_create /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__threading_support:471:10
    #2 0x78b013004c in thread<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30), void> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:300:16
    #3 0x78b013004c in construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1921:31
    #4 0x78b013004c in __construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1784:21
    #5 0x78b013004c in construct<std::__ndk1::thread, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/memory:1605:14
    #6 0x78b013004c in __construct_one_at_end<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/vector:924:5
    #7 0x78b013004c in emplace_back<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/vector:1683:9
    #8 0x78b013004c in operator() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:60:17
    #9 0x78b013004c in __invoke<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/type_traits:3874:1
    #10 0x78b013004c in __thread_execute<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct> >, (lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30)> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:273:5
    #11 0x78b013004c in void* std::__ndk1::__thread_proxy<std::__ndk1::tuple<std::__ndk1::unique_ptr<std::__ndk1::__thread_struct, std::__ndk1::default_delete<std::__ndk1::__thread_struct>>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()>>(void*) /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:284:5
    #12 0x78ba6db110 in __pthread_start(void*) pthread_create.cpp
    #13 0x78ba679314 in __start_thread clone.cpp

Thread T1 created by T0 here:
    #0 0x78aa8b45b8 in pthread_create /toolchain/compiler-rt/lib/asan/asan_interceptors.cc:209:3
    #1 0x78b012ed48 in __libcpp_thread_create /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/__threading_support:471:10
    #2 0x78b012ed48 in thread<(lambda at /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:30), void> /home/builder/.termux-build/_cache/android-r25c-api-24-v2/sysroot/usr/include/c++/v1/thread:300:16
    #3 0x78b012ed48 in ThreadPoolExecutor /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:58:18
    #4 0x78b012ed48 in llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::Creator::call() /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:91:38
    #5 0x78b011f5a0 in llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/ManagedStatic.cpp:34:19
    #6 0x78b012df90 in operator* /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/ManagedStatic.h:89:7
    #7 0x78b012df90 in getDefaultExecutor /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:151:53
    #8 0x78b012df90 in llvm::parallel::TaskGroup::spawn(std::__ndk1::function<void ()>) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:176:5
    #9 0x78b012e688 in llvm::parallelFor(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>) /home/builder/.termux-build/lld-debug/src/llvm/lib/Support/Parallel.cpp:212:10
    #10 0x5a9eb9feac in parallelForEach<lld::elf::ELFFileBase **, (lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:36)> /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/Parallel.h:234:3
    #11 0x5a9eb9feac in parallelForEach<llvm::SmallVector<lld::elf::ELFFileBase *, 0U> &, (lambda at /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:36)> /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/Support/Parallel.h:262:3
    #12 0x5a9eb9feac in lld::elf::LinkerDriver::link(llvm::opt::InputArgList&) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:2605:3
    #13 0x5a9eb836ac in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:621:5
    #14 0x5a9eb80acc in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/builder/.termux-build/lld-debug/src/lld/ELF/Driver.cpp:145:19
    #15 0x5a9e986294 in lldMain(int, char const**, llvm::raw_ostream&, llvm::raw_ostream&, bool) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:168:12
    #16 0x5a9e985144 in lld_main(int, char**) /home/builder/.termux-build/lld-debug/src/lld/tools/lld/lld.cpp:230:12
    #17 0x78ba672bc4 in __libc_init (/apex/com.android.runtime/lib64/bionic/libc.so+0x6ebc4)
    #18 0x5a9e9844e4 in _start_main crtbegin.c

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/builder/.termux-build/lld-debug/src/llvm/include/llvm/ADT/SmallVector.h:91:32 in size
Shadow bytes around the buggy address:
  0x001813cef7c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x001813cef7d0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x001813cef7e0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
  0x001813cef7f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x001813cef800: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
=>0x001813cef810: 00 00 00 00 00 00 fa[fa]fa fa fa fa fa fa fa fa
  0x001813cef820: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x001813cef830: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x001813cef840: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
  0x001813cef850: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x001813cef860: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==20359==ABORTING
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Aborted
  1. Snapdragon 660AIE (Xiaomi Pad 4 Plus, Android 8.1)

On this device, I got some weird errors. The lld-debug package complains about CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/opt/lld-debug/bin/lld": library "libclang_rt.asan-aarch64-android.so" not found Aborted, so I symlinks $PREFIX/lib/clang/16/libclang_rt.asan-aarch64-android.so to $PREFIX/opt/lld-debug/lib.

==27182==Shadow memory range interleaves with an existing memory mapping. ASan cannot proceed correctly. ABORTING.
==27182==ASan shadow was supposed to be located in the [0x000ffffff000-0x001fffffffff] range.
==27182==This might be related to ELF_ET_DYN_BASE change in Linux 4.12.
==27182==See https://github.com/google/sanitizers/issues/856 for possible workarounds.
==27182==Process memory map follows:
        0x001080d4f000-0x001080fc7000   /data/data/com.termux/files/usr/opt/lld-debug/bin/lld
        0x001080fc7000-0x001081951000   /data/data/com.termux/files/usr/opt/lld-debug/bin/lld
        0x001081951000-0x00108199c000   /data/data/com.termux/files/usr/opt/lld-debug/bin/lld
        0x00108199c000-0x001081a09000   /data/data/com.termux/files/usr/opt/lld-debug/bin/lld
        0x001081a09000-0x001081a0e000
        0x007dd2cb2000-0x007dd3040000   [anon:AddrHashMap]
        0x007dd3040000-0x007dd3087000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007dd3087000-0x007dd312c000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007dd312c000-0x007dd312f000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007dd312f000-0x007dd3132000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007dd3132000-0x007dd377d000   [anon:.bss]
        0x007dd3795000-0x007dd37a3000   /data/data/com.termux/files/usr/lib/liblzma.so.5.4.3
        0x007dd37a3000-0x007dd37bc000   /data/data/com.termux/files/usr/lib/liblzma.so.5.4.3
        0x007dd37bc000-0x007dd37be000   /data/data/com.termux/files/usr/lib/liblzma.so.5.4.3
        0x007dd37ed000-0x007dd38df000   /data/data/com.termux/files/usr/lib/libc++_shared.so
        0x007dd38df000-0x007dd38e9000   /data/data/com.termux/files/usr/lib/libc++_shared.so
        0x007dd38e9000-0x007dd38ea000   /data/data/com.termux/files/usr/lib/libc++_shared.so
        0x007dd38ea000-0x007dd38f1000   [anon:.bss]
        0x007dd3902000-0x007dd8cf9000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007dd8cf9000-0x007de1c04000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007de1c04000-0x007de2686000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007de2686000-0x007de2e8b000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007de2e8b000-0x007de2f3a000   [anon:.bss]
        0x007de2f6e000-0x007de305b000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de305b000-0x007de3072000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de3072000-0x007de3075000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de3075000-0x007de3076000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de30a3000-0x007de30a4000   /data/data/com.termux/files/usr/lib/libtermux-exec.so
        0x007de30a4000-0x007de30a6000   /data/data/com.termux/files/usr/lib/libtermux-exec.so
        0x007de30a6000-0x007de30a7000   /data/data/com.termux/files/usr/lib/libtermux-exec.so
        0x007de30cf000-0x007de3136000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de3136000-0x007de31e1000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de31e1000-0x007de31ec000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de31ec000-0x007de31ed000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de31ed000-0x007de31ee000   [anon:.bss]
        0x007de3229000-0x007de32ee000   /system/lib64/libc.so
        0x007de32ee000-0x007de32ef000
        0x007de32ef000-0x007de32f5000   /system/lib64/libc.so
        0x007de32f5000-0x007de32f7000   /system/lib64/libc.so
        0x007de32f7000-0x007de3300000   [anon:.bss]
        0x007de3329000-0x007de332c000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de332c000-0x007de332d000
        0x007de332d000-0x007de333e000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de333e000-0x007de333f000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de333f000-0x007de3340000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de3362000-0x007de3368000   /data/data/com.termux/files/usr/lib/libz.so.1.2.13
        0x007de3368000-0x007de3374000   /data/data/com.termux/files/usr/lib/libz.so.1.2.13
        0x007de3374000-0x007de3375000   /data/data/com.termux/files/usr/lib/libz.so.1.2.13
        0x007de3396000-0x007de33c2000   /data/data/com.termux/files/usr/lib/libncursesw.so.6.4
        0x007de33c2000-0x007de33ee000   /data/data/com.termux/files/usr/lib/libncursesw.so.6.4
        0x007de33ee000-0x007de33f3000   /data/data/com.termux/files/usr/lib/libncursesw.so.6.4
        0x007de33f3000-0x007de33f4000   /data/data/com.termux/files/usr/lib/libncursesw.so.6.4
        0x007de33f4000-0x007de33f5000   [anon:.bss]
        0x007de3404000-0x007de3417000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de3417000-0x007de3475000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de3475000-0x007de3477000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de3477000-0x007de3478000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de348f000-0x007de3491000   /system/lib64/libdl.so
        0x007de3491000-0x007de3492000   /system/lib64/libdl.so
        0x007de3492000-0x007de3493000   /system/lib64/libdl.so
        0x007de3493000-0x007de3494000   [anon:.bss]
        0x007de34bd000-0x007de34c5000   [anon:ReadFileToBuffer]
        0x007de34c5000-0x007de34fc000   /system/lib64/libm.so
        0x007de34fc000-0x007de34fd000
        0x007de34fd000-0x007de34fe000   /system/lib64/libm.so
        0x007de34fe000-0x007de34ff000   /system/lib64/libm.so
        0x007de3505000-0x007de3515000   [anon:AppendToErrorMessageBuffer]
        0x007de3515000-0x007de351d000   [anon:ReadFileToBuffer]
        0x007de351d000-0x007de3521000   [anon:Allocate]
        0x007de3521000-0x007de3522000   [anon:ReadFileToBuffer]
        0x007de3522000-0x007de3523000   [anon:linker_alloc]
        0x007de3523000-0x007de3524000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de3524000-0x007de3525000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de3525000-0x007de3526000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de3526000-0x007de3527000   [anon:linker_alloc_vector]
        0x007de3527000-0x007de3528000   [anon:linker_alloc_small_objects]
        0x007de3528000-0x007de3529000   [anon:linker_alloc]
        0x007de3529000-0x007de352b000   /data/data/com.termux/files/usr/lib/liblzma.so.5.4.3
        0x007de352b000-0x007de352d000   /data/data/com.termux/files/usr/lib/liblzma.so.5.4.3
        0x007de352d000-0x007de352e000   /data/data/com.termux/files/usr/lib/liblzma.so.5.4.3
        0x007de352e000-0x007de352f000   /data/data/com.termux/files/usr/lib/liblzma.so.5.4.3
        0x007de352f000-0x007de3538000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de3538000-0x007de3539000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de3539000-0x007de353b000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de353b000-0x007de353c000   /data/data/com.termux/files/usr/lib/libxml2.so
        0x007de353c000-0x007de3540000   /data/data/com.termux/files/usr/lib/libncursesw.so.6.4
        0x007de3540000-0x007de3543000   /data/data/com.termux/files/usr/lib/libncursesw.so.6.4
        0x007de3543000-0x007de3544000   /data/data/com.termux/files/usr/lib/libncursesw.so.6.4
        0x007de3544000-0x007de3546000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de3546000-0x007de3547000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de3547000-0x007de3549000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de3549000-0x007de354a000   /data/data/com.termux/files/usr/lib/libffi.so
        0x007de354a000-0x007de354d000   /system/lib64/libm.so
        0x007de354d000-0x007de354f000   /system/lib64/libm.so
        0x007de354f000-0x007de3551000   /system/lib64/libm.so
        0x007de3551000-0x007de3552000   /system/lib64/libm.so
        0x007de3552000-0x007de3554000   /system/lib64/libdl.so
        0x007de3554000-0x007de3556000   /system/lib64/libdl.so
        0x007de3556000-0x007de3557000   /system/lib64/libdl.so
        0x007de3557000-0x007de3558000   /data/data/com.termux/files/usr/lib/libiconv.so
        0x007de3558000-0x007de3559000   [anon:linker_alloc_small_objects]
        0x007de3559000-0x007de3576000   /data/data/com.termux/files/usr/lib/libc++_shared.so
        0x007de3576000-0x007de357a000   /data/data/com.termux/files/usr/lib/libc++_shared.so
        0x007de357a000-0x007de357b000   /data/data/com.termux/files/usr/lib/libc++_shared.so
        0x007de357b000-0x007de357c000   [anon:linker_alloc]
        0x007de357c000-0x007de357d000   [anon:linker_alloc_vector]
        0x007de357d000-0x007de357e000   [anon:linker_alloc_small_objects]
        0x007de357e000-0x007de382e000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007de382e000-0x007de3830000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007de3830000-0x007de3832000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007de3832000-0x007de3833000   /data/data/com.termux/files/usr/opt/lld-debug/lib/libLLVM-16.so
        0x007de3833000-0x007de3837000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de3837000-0x007de3838000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de3838000-0x007de383a000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de383a000-0x007de383b000   /data/data/com.termux/files/usr/lib/libzstd.so.1.5.5
        0x007de383b000-0x007de383c000   /data/data/com.termux/files/usr/lib/libz.so.1.2.13
        0x007de383c000-0x007de383e000   /data/data/com.termux/files/usr/lib/libz.so.1.2.13
        0x007de383e000-0x007de3840000   /data/data/com.termux/files/usr/lib/libz.so.1.2.13
        0x007de3840000-0x007de3841000   /data/data/com.termux/files/usr/lib/libz.so.1.2.13
        0x007de3841000-0x007de3846000   /system/lib64/libc.so
        0x007de3846000-0x007de3848000   /system/lib64/libc.so
        0x007de3848000-0x007de3849000   /system/lib64/libc.so
        0x007de3849000-0x007de384a000   /system/lib64/libc.so
        0x007de384a000-0x007de3855000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007de3855000-0x007de3857000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007de3857000-0x007de385a000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007de385a000-0x007de385b000   /data/data/com.termux/files/usr/lib/clang/16/lib/linux/libclang_rt.asan-aarch64-android.so
        0x007de385b000-0x007de385c000   [anon:linker_alloc_small_objects]
        0x007de385c000-0x007de385f000   /data/data/com.termux/files/usr/lib/libtermux-exec.so
        0x007de385f000-0x007de387f000   /dev/__properties__/u:object_r:default_prop:s0
        0x007de387f000-0x007de3880000   [anon:linker_alloc_vector]
        0x007de3880000-0x007de3881000   /data/data/com.termux/files/usr/lib/libtermux-exec.so
        0x007de3881000-0x007de3882000   /data/data/com.termux/files/usr/lib/libtermux-exec.so
        0x007de3882000-0x007de38a2000   /dev/__properties__/u:object_r:debug_prop:s0
        0x007de38a2000-0x007de38a3000
        0x007de38a3000-0x007de38a4000
        0x007de38a4000-0x007de38a5000
        0x007de38a5000-0x007de38c5000   /dev/__properties__/properties_serial
        0x007de38c5000-0x007de38c6000   [anon:linker_alloc_vector]
        0x007de38c6000-0x007de38c7000   /system/lib64/libdl.so
        0x007de38c7000-0x007de38cb000   [anon:linker_alloc_small_objects]
        0x007de38cb000-0x007de38cc000   [anon:linker_alloc_vector]
        0x007de38cc000-0x007de38ce000   [anon:linker_alloc_small_objects]
        0x007de38ce000-0x007de38cf000   [anon:linker_alloc]
        0x007de38cf000-0x007de38d0000   [anon:linker_alloc_lob]
        0x007de38d0000-0x007de38d1000   [anon:linker_alloc]
        0x007de38d1000-0x007de38d2000   [anon:linker_alloc_vector]
        0x007de38d2000-0x007de38d3000   [anon:linker_alloc_small_objects]
        0x007de38d3000-0x007de38d4000   [anon:linker_alloc]
        0x007de38d4000-0x007de38d5000   [anon:linker_alloc_small_objects]
        0x007de38d5000-0x007de38d6000   [anon:atexit handlers]
        0x007de38d6000-0x007de38d7000   [anon:thread signal stack guard page]
        0x007de38d7000-0x007de38db000   [anon:thread signal stack]
        0x007de38db000-0x007de38dc000   [anon:bionic TLS guard]
        0x007de38dc000-0x007de38df000   [anon:bionic TLS]
        0x007de38df000-0x007de38e0000   [anon:bionic TLS guard]
        0x007de38e0000-0x007de38e1000   [vvar]
        0x007de38e1000-0x007de38e2000   [vdso]
        0x007de38e2000-0x007de39d6000   /system/bin/linker64
        0x007de39d6000-0x007de39d7000   [anon:arc4random data]
        0x007de39d7000-0x007de39db000   /system/bin/linker64
        0x007de39db000-0x007de39dc000   /system/bin/linker64
        0x007de39dc000-0x007de3a48000
        0x007de3a48000-0x007de3a49000
        0x007de3a49000-0x007de3a50000
        0x007ff8cd6000-0x007ff8cf7000   [stack]
==27182==End of process memory map.

@finagolfin
Copy link
Member Author

Thanks a lot, @licy183, any non-Snapdragon devices you can try on? I could not reproduce on an Exynos 2100 phone, would also help if we could provide some more negative evidence that this is only a Qualcomm issue.

@licy183
Copy link
Member

licy183 commented May 22, 2023

any non-Snapdragon devices you can try on?

I'm afraid not. The CPU model of all my mobile phones is Snapdragon... Maybe I could test it out on my roommate's device, but I'm not sure he'd agree or not.

@finagolfin
Copy link
Member Author

Should be worked around by e4dd29c, please reopen if you still see crashes with 16.0.4-1 or later, going to track the underlying issue upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly help wanted Help is wanted in order to solve the issue
Projects
None yet
Development

No branches or pull requests

4 participants