Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang-13 failes with exit code 139 when compiling compiler-rt-13 #51342

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR52375
Status NEW
Importance P enhancement
Reported by Steffen Hau (steffen@hauihau.de)
Reported on 2021-11-01 13:15:33 -0700
Last modified on 2021-11-02 13:38:40 -0700
Version 13.0
Hardware PC Linux
CC dimitry@andric.com, htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk, xtkoba@gmail.com
Fixed by commit(s)
Attachments adddf3-0bbe0a.c (243510 bytes, text/x-csrc)
addsf3-0e5988.c (243504 bytes, text/x-csrc)
Blocks
Blocked by
See also
I'm using Gentoo Linux and I have issues updating my system since clang 13 has
been installed. Several packages are affected:
- compiler-rt-13.0.0
- compiler-rt-sanitizers-13.0.0
- rust-1.56.0
- chromium-96.0.4664.27

This is an excerpt from the build.log:
[11/306] /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -DVISIBILITY_HIDDEN   -
DNDEBUG -march=native -O3 -pipe -Wall -Wno-unused-parameter  -m32 -fno-lto -
std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -MF
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o.d -o
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -c
/home/gentoo/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/adddf3.c
FAILED: lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o
/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -DVISIBILITY_HIDDEN   -DNDEBUG -
march=native -O3 -pipe -Wall -Wno-unused-parameter  -m32 -fno-lto -std=c11 -
fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -MF
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o.d -o
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -c
/home/gentoo/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/adddf3.c
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -
DVISIBILITY_HIDDEN -DNDEBUG -march=native -O3 -pipe -Wall -Wno-unused-parameter
-m32 -fno-lto -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-
pointer -MD -MT lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -
MF lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o.d -o
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -c
/home/gentoo/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/adddf3.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00007f473fbd7a8f (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x802a8f)
 #1 0x00007f473fbb764c llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x7e264c)
 #2 0x00007f473fb23f88 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x74ef88)
 #3 0x00007f473f024320 (/lib64/libc.so.6+0x38320)
 #4 0x00007f4740621385 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x124c385)
 #5 0x00007f4740623657 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x124e657)
 #6 0x00007f4740625701 llvm::PromoteMemToReg(llvm::ArrayRef<llvm::AllocaInst*>, llvm::DominatorTree&, llvm::AssumptionCache*) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x1250701)
 #7 0x00007f4740966487 llvm::SROA::runImpl(llvm::Function&, llvm::DominatorTree&, llvm::AssumptionCache&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x1591487)
 #8 0x00007f474166cd73 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x2297d73)
 #9 0x00007f473fd45d1a llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x970d1a)
#10 0x00007f4741665552 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x2290552)
#11 0x00007f473fd461ea llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-
13.so+0x9711ea)
#12 0x00007f474166cdc2 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x2297dc2)
#13 0x00007f473fd4573f llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-
13.so+0x97073f)
#14 0x00007f4744e0ab9e (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x281fb9e)
#15 0x00007f4743e7510d clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef,
llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x188a10d)
#16 0x00007f47441500ad (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1b650ad)
#17 0x00007f474317fb75 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0xb94b75)
#18 0x00007f4744776409 clang::FrontendAction::Execute()
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x218b409)
#19 0x00007f4744718a57
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x212da57)
#20 0x00007f47447c4a3d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x21d9a3d)
#21 0x0000563fb7b64fcc cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x15fcc)
#22 0x0000563fb7b695d5 (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x1a5d5)
#23 0x00007f474447ff45 (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1e94f45)
#24 0x00007f473fb053b3
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x7303b3)
#25 0x00007f47444aef92
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1ec3f92)
#26 0x00007f474446861c
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1e7d61c)
#27 0x00007f4744468a49
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1e7da49)
#28 0x00007f474446f921
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1e84921)
#29 0x0000563fb7b5e001 main (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-
clang+0xf001)
#30 0x00007f473f00f7fd __libc_start_main (/lib64/libc.so.6+0x237fd)
#31 0x0000563fb7b5f74a _start (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-
clang+0x1074a)
clang-13: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
clang version 13.0.0
Target: i386-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/13/bin
clang-13: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /home/gentoo/tmp/portage/sys-libs/compiler-rt-
13.0.0/temp/adddf3-0bbe0a.c
clang-13: note: diagnostic msg: /home/gentoo/tmp/portage/sys-libs/compiler-rt-
13.0.0/temp/adddf3-0bbe0a.sh
clang-13: note: diagnostic msg:

********************
[12/306] /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -DVISIBILITY_HIDDEN   -
DNDEBUG -march=native -O3 -pipe -Wall -Wno-unused-parameter  -m32 -fno-lto -
std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o -MF
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o.d -o
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o -c
/home/gentoo/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/addsf3.c
FAILED: lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o
/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -DVISIBILITY_HIDDEN   -DNDEBUG -
march=native -O3 -pipe -Wall -Wno-unused-parameter  -m32 -fno-lto -std=c11 -
fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o -MF
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o.d -o
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o -c
/home/gentoo/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/addsf3.c
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -
DVISIBILITY_HIDDEN -DNDEBUG -march=native -O3 -pipe -Wall -Wno-unused-parameter
-m32 -fno-lto -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-
pointer -MD -MT lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o -
MF lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o.d -o
lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/addsf3.c.o -c
/home/gentoo/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/addsf3.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00007f5afa0e7a8f (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x802a8f)
 #1 0x00007f5afa0c764c llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x7e264c)
 #2 0x00007f5afa033f88 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x74ef88)
 #3 0x00007f5af9534320 (/lib64/libc.so.6+0x38320)
 #4 0x00007f5afab31385 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x124c385)
 #5 0x00007f5afab33657 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x124e657)
 #6 0x00007f5afab35701 llvm::PromoteMemToReg(llvm::ArrayRef<llvm::AllocaInst*>, llvm::DominatorTree&, llvm::AssumptionCache*) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x1250701)
 #7 0x00007f5afae76487 llvm::SROA::runImpl(llvm::Function&, llvm::DominatorTree&, llvm::AssumptionCache&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x1591487)
 #8 0x00007f5afbb7cd73 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x2297d73)
 #9 0x00007f5afa255d1a llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x970d1a)
#10 0x00007f5afbb75552 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x2290552)
#11 0x00007f5afa2561ea llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-
13.so+0x9711ea)
#12 0x00007f5afbb7cdc2 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x2297dc2)
#13 0x00007f5afa25573f llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-
13.so+0x97073f)
#14 0x00007f5aff31ab9e (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x281fb9e)
#15 0x00007f5afe38510d clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef,
llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x188a10d)
#16 0x00007f5afe6600ad (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1b650ad)
#17 0x00007f5afd68fb75 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0xb94b75)
#18 0x00007f5afec86409 clang::FrontendAction::Execute()
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x218b409)
#19 0x00007f5afec28a57
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x212da57)
#20 0x00007f5afecd4a3d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x21d9a3d)
#21 0x00005629ae27dfcc cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x15fcc)
#22 0x00005629ae2825d5 (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x1a5d5)
#23 0x00007f5afe98ff45 (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1e94f45)
#24 0x00007f5afa0153b3
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x7303b3)
#25 0x00007f5afe9bef92
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1ec3f92)
#26 0x00007f5afe97861c
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/usr/lib/llvm/13/bin/../lib64/libclang-
cpp.so.13+0x1e7d61c)
#27 0x00007f5afe978a49
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1e7da49)
#28 0x00007f5afe97f921
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1e84921)
#29 0x00005629ae277001 main (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-
clang+0xf001)
#30 0x00007f5af951f7fd __libc_start_main (/lib64/libc.so.6+0x237fd)
#31 0x00005629ae27874a _start (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-
clang+0x1074a)
clang-13: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
clang version 13.0.0
Target: i386-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/13/bin
clang-13: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /home/gentoo/tmp/portage/sys-libs/compiler-rt-
13.0.0/temp/addsf3-0e5988.c
clang-13: note: diagnostic msg: /home/gentoo/tmp/portage/sys-libs/compiler-rt-
13.0.0/temp/addsf3-0e5988.sh
clang-13: note: diagnostic msg:

********************

I'll attach the prepocessed sources and the run scripts. As this is my first
report here, let me know if you need further information.

FYI: There is also an Gentoo bug report at https://bugs.gentoo.org/802027.
Quuxplusone commented 3 years ago

Attached adddf3-0bbe0a.c (243510 bytes, text/x-csrc): preprocessed source

Quuxplusone commented 3 years ago

Attached addsf3-0e5988.c (243504 bytes, text/x-csrc): preprocesses source

Quuxplusone commented 3 years ago

Both preprocessed files compile fine here with clang 13.0.0 (on FreeBSD, but that shouldn't matter). Is there anything special about how your /usr/lib/llvm/13/lib64/libLLVM-13.so is compiled?

Quuxplusone commented 3 years ago

Note that by default Gentoo uses GCC for building LLVM unless CC and CXX envs are otherwise specified. So it is possible that libLLVM-13.so is miscompiled by some version of GCC.