llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.7k stars 11.87k forks source link

clang fails to start with "realloc(): invalid old size" on ppc64el #47372

Open sylvestre opened 3 years ago

sylvestre commented 3 years ago
Bugzilla Link 48028
Version trunk
OS Linux
CC @ecnelises,@nemanjai

Extended Description

Reported here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972333

It seems it was caused by a new version of binutils (2.35.1-2 probably): https://tracker.debian.org/news/1181645/accepted-binutils-2351-2-source-into-unstable/

Maybe these patches? https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=4d8ee860737005517be588f4771c358593fa421c https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=e6f04d55f681149a69102a73937d0987719c3f16;hp=55b8e31a7a109bbd4efd7a59408c3c59dcf62ee0

% /home/sylvestre/llvm-toolchain-11-11.0.0/build-llvm/tools/clang/stage2-bins/bin/clang++ realloc(): invalid old size

sylvestre commented 3 years ago

Moving from gold to bfd as linker fixed the issue (ie NOT using -fuse-ld=gold)

sylvestre commented 3 years ago

Please note that it is happening only on this arch on Debian.

And happening from version 8: https://buildd.debian.org/status/package.php?p=llvm-toolchain-8 to 11: https://buildd.debian.org/status/package.php?p=llvm-toolchain-11

sylvestre commented 3 years ago

The backtrace:

​0 0x00007fffef4575b8 in raise () from /lib/powerpc64le-linux-gnu/libc.so.6

​1 0x00007fffef437ce8 in abort () from /lib/powerpc64le-linux-gnu/libc.so.6

​2 0x00007fffef4a4cd4 in ?? () from /lib/powerpc64le-linux-gnu/libc.so.6

​3 0x00007fffef4aff28 in ?? () from /lib/powerpc64le-linux-gnu/libc.so.6

​4 0x00007fffef4b50f8 in ?? () from /lib/powerpc64le-linux-gnu/libc.so.6

​5 0x00007fffef4b6720 in realloc () from /lib/powerpc64le-linux-gnu/libc.so.6

​6 0x00007ffff052d6f4 in safe_realloc ()

at /home/sylvestre/llvm-toolchain-11-11.0.0/llvm/include/llvm/Support/MemAlloc.h:53

​7 grow ()

at /home/sylvestre/llvm-toolchain-11-11.0.0/llvm/include/llvm/ADT/BitVector.h:893

​8 0x00007ffff052cb84 in resize ()

at /home/sylvestre/llvm-toolchain-11-11.0.0/llvm/include/llvm/ADT/BitVector.h:375

​9 0x00007ffff0473790 in _GLOBAL__sub_I_ARMSubtarget.cpp ()

at /home/sylvestre/llvm-toolchain-11-11.0.0/llvm/include/llvm/Support/CommandLine.h:1301

​10 0x0000000000000000 in ?? ()