-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
Description
Testcase:
int main() {
return 0;
}
Backtrace:
> /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang -fsigned-char -fno-strict-aliasing -fwrapv -fembed-bitcode -ffat-lto-objects -flto red.c -o rv64gcv.out -c
fatal error: error in backend: Can only embed the module once
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang -fsigned-char -fno-strict-aliasing -fwrapv -fembed-bitcode -ffat-lto-objects -flto red.c -o rv64gcv.out -c
1. <eof> parser at end of file
2. Optimizer
#0 0x0000562992b6e730 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x1e50730)
#1 0x0000562992b6bb3f llvm::sys::RunSignalHandlers() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x1e4db3f)
#2 0x0000562992ab9c5a llvm::CrashRecoveryContext::HandleExit(int) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x1d9bc5a)
#3 0x0000562992b65d02 llvm::sys::Process::Exit(int, bool) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x1e47d02)
#4 0x0000562991a19c68 LLVMErrorHandler(void*, char const*, bool) cc1_main.cpp:0:0
#5 0x0000562992ac3d10 llvm::report_fatal_error(llvm::Twine const&, bool) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x1da5d10)
#6 0x0000562992ac3eae (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x1da5eae)
#7 0x0000562994141eef (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x3423eef)
#8 0x0000562993ed9776 llvm::detail::PassModel<llvm::Module, llvm::EmbedBitcodePass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x31bb776)
#9 0x000056299266b321 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x194d321)
#10 0x0000562992dc7738 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile>>&, clang::BackendConsumer*) BackendUtil.cpp:0:0
#11 0x0000562992dcb0d5 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x20ad0d5)
#12 0x00005629933e8ab7 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x26caab7)
#13 0x000056299506715c clang::ParseAST(clang::Sema&, bool, bool) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x434915c)
#14 0x0000562993680539 clang::FrontendAction::Execute() (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x2962539)
#15 0x0000562993604856 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x28e6856)
#16 0x0000562993751ee5 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x2a33ee5)
#17 0x0000562991a1beaf cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0xcfdeaf)
#18 0x0000562991a15593 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#19 0x000056299342efbd void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#20 0x0000562992ab9b90 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x1d9bb90)
#21 0x000056299342f83e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#22 0x00005629933f387a clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x26d587a)
#23 0x00005629933f434d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x26d634d)
#24 0x0000562993401264 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0x26e3264)
#25 0x0000562991a192f8 clang_main(int, char**, llvm::ToolContext const&) (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0xcfb2f8)
#26 0x00005629919569eb main (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0xc389eb)
#27 0x00007cf278629d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#28 0x00007cf278629e40 call_init ./csu/../csu/libc-start.c:128:20
#29 0x00007cf278629e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#30 0x0000562991a14845 _start (/scratch/tc-testing/tc-apr-4/build-rv64gcv/build-llvm-linux/bin/clang+0xcf6845)
Godbolt: https://godbolt.org/z/rMGjGaPbb
Found via fuzzer