| Issue |
56060
|
| Summary |
Crash @llvm::GlobalValue::setSanitizerMetadata
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
glandium
|
This is a regression from https://reviews.llvm.org/D126929 (e7766972a6790e25dbb4ce3481f57e9792b49269). Interestingly, it doesn't happen with the preprocessed source, which means the reproducer that clang produces on crash doesn't reproduce the crash...
Stack trace:
```
1. <eof> parser at end of file
2. Optimizer
#0 0x00007fa4de5cba8d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /tmp/llvm/llvm/lib/Support/Unix/Signals.inc:573:3
#1 0x00007fa4de5c9c4c llvm::sys::RunSignalHandlers() /tmp/llvm/llvm/lib/Support/Signals.cpp:103:20
#2 0x00007fa4de4f0b28 HandleCrash /tmp/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:76:5
#3 0x00007fa4de4f0b28 CrashRecoverySignalHandler(int) /tmp/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:389:62
#4 0x00007fa4ddafbd60 (/lib/x86_64-linux-gnu/libc.so.6+0x3bd60)
#5 0x00007fa4de6b7b1c llvm::GlobalValue::setSanitizerMetadata(llvm::GlobalValue::SanitizerMetadata const&) /tmp/llvm/llvm/lib/IR/Globals.cpp:232:58
#6 0x00007fa4de6b8ae2 llvm::GlobalValue::getGlobalValueSubClassData() const /tmp/llvm/llvm/include/llvm/IR/GlobalValue.h:164:12
#7 0x00007fa4de6b8ae2 llvm::GlobalObject::setAlignment(llvm::MaybeAlign) /tmp/llvm/llvm/lib/IR/Globals.cpp:130:48
#8 0x00007fa4de6b8ae2 llvm::GlobalObject::copyAttributesFrom(llvm::GlobalObject const*) /tmp/llvm/llvm/lib/IR/Globals.cpp:138:15
#9 0x00007fa4de6b8b61 llvm::GlobalVariable::setExternallyInitialized(bool) /tmp/llvm/llvm/include/llvm/IR/GlobalVariable.h:159:37
#10 0x00007fa4de6b8b61 llvm::GlobalVariable::copyAttributesFrom(llvm::GlobalVariable const*) /tmp/llvm/llvm/lib/IR/Globals.cpp:480:27
#11 0x00007fa4df230723 InstrumentGlobals /tmp/llvm/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:2331:25
#12 0x00007fa4df230723 (anonymous namespace)::ModuleAddressSanitizer::instrumentModule(llvm::Module&) /tmp/llvm/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:2508:22
#13 0x00007fa4df23b4ff llvm::SmallPtrSet<void*, 2u>::SmallPtrSet() /tmp/llvm/llvm/include/llvm/ADT/SmallPtrSet.h:464:25
#14 0x00007fa4df23b4ff llvm::PreservedAnalyses::PreservedAnalyses() /tmp/llvm/llvm/include/llvm/IR/PassManager.h:152:7
#15 0x00007fa4df23b4ff llvm::PreservedAnalyses::none() /tmp/llvm/llvm/include/llvm/IR/PassManager.h:155:62
#16 0x00007fa4df23b4ff llvm::ModuleAddressSanitizerPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /tmp/llvm/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1192:72
#17 0x00007fa4e2b9f9ee llvm::detail::PassModel<llvm::Module, llvm::ModuleAddressSanitizerPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /tmp/llvm/llvm/include/llvm/IR/PassManagerInternal.h:89:3
#18 0x00007fa4de7303eb llvm::SmallPtrSet<void*, 2u>::operator=(llvm::SmallPtrSet<void*, 2u>&&) /tmp/llvm/llvm/include/llvm/ADT/SmallPtrSet.h:489:21
#19 0x00007fa4de7303eb llvm::PreservedAnalyses::operator=(llvm::PreservedAnalyses&&) /tmp/llvm/llvm/include/llvm/IR/PassManager.h:152:7
#20 0x00007fa4de7303eb llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /tmp/llvm/llvm/include/llvm/IR/PassManager.h:522:16
#21 0x00007fa4e2baa0c9 llvm::SmallPtrSetImplBase::isSmall() const /tmp/llvm/llvm/include/llvm/ADT/SmallPtrSet.h:195:33
#22 0x00007fa4e2baa0c9 llvm::SmallPtrSetImplBase::~SmallPtrSetImplBase() /tmp/llvm/llvm/include/llvm/ADT/SmallPtrSet.h:83:17
#23 0x00007fa4e2baa0c9 llvm::SmallPtrSetImpl<llvm::AnalysisKey*>::~SmallPtrSetImpl() /tmp/llvm/llvm/include/llvm/ADT/SmallPtrSet.h:344:7
#24 0x00007fa4e2baa0c9 llvm::SmallPtrSet<llvm::AnalysisKey*, 2u>::~SmallPtrSet() /tmp/llvm/llvm/include/llvm/ADT/SmallPtrSet.h:450:7
#25 0x00007fa4e2baa0c9 llvm::PreservedAnalyses::~PreservedAnalyses() /tmp/llvm/llvm/include/llvm/IR/PassManager.h:152:7
#26 0x00007fa4e2baa0c9 (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>>&) (.constprop.0) /tmp/llvm/clang/lib/CodeGen/BackendUtil.cpp:966:12
#27 0x00007fa4e2bacfdf RunCodegenPipeline /tmp/llvm/clang/lib/CodeGen/BackendUtil.cpp:976:23
#28 0x00007fa4e2bacfdf EmitAssembly /tmp/llvm/clang/lib/CodeGen/BackendUtil.cpp:1024:21
#29 0x00007fa4e2bacfdf 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>>) /tmp/llvm/clang/lib/CodeGen/BackendUtil.cpp:1182:25
#30 0x00007fa4e2f12f9d std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>::~unique_ptr() /usr/include/c++/10/bits/unique_ptr.h:360:12
#31 0x00007fa4e2f12f9d clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /tmp/llvm/clang/lib/CodeGen/CodeGenAction.cpp:381:69
#32 0x00007fa4e1d3f9e9 clang::ParseAST(clang::Sema&, bool, bool) /tmp/llvm/clang/lib/Parse/ParseAST.cpp:175:34
#33 0x00007fa4e36400f1 clang::FrontendAction::Execute() /tmp/llvm/clang/lib/Frontend/FrontendAction.cpp:1028:21
#34 0x00007fa4e35d9e2b llvm::Error::getPtr() const /tmp/llvm/llvm/include/llvm/Support/Error.h:274:12
#35 0x00007fa4e35d9e2b llvm::Error::operator bool() /tmp/llvm/llvm/include/llvm/Support/Error.h:234:22
#36 0x00007fa4e35d9e2b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /tmp/llvm/clang/lib/Frontend/CompilerInstance.cpp:1033:42
#37 0x00007fa4e36adbb8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /tmp/llvm/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:267:32
#38 0x00005569e727f2e4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /tmp/llvm/clang/tools/driver/cc1_main.cpp:248:40
#39 0x00005569e7279d28 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) /tmp/llvm/clang/tools/driver/driver.cpp:317:20
#40 0x00007fa4e32e6f65 operator() /tmp/llvm/clang/lib/Driver/Job.cpp:407:32
#41 0x00007fa4e32e6f65 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) /tmp/llvm/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:52
#42 0x00007fa4de4f0c23 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /tmp/llvm/llvm/lib/Support/CrashRecoveryContext.cpp:427:1
#43 0x00007fa4e32e7387 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) /tmp/llvm/clang/lib/Driver/Job.cpp:411:10
#44 0x00007fa4e32b7642 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const /tmp/llvm/clang/lib/Driver/Compilation.cpp:201:3
#45 0x00007fa4e32b7db9 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const /tmp/llvm/clang/lib/Driver/Compilation.cpp:254:5
#46 0x00007fa4e32c58ac llvm::SmallVectorBase<unsigned int>::empty() const /tmp/llvm/llvm/include/llvm/ADT/SmallVector.h:73:47
#47 0x00007fa4e32c58ac clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) /tmp/llvm/clang/lib/Driver/Driver.cpp:1734:28
#48 0x00005569e727d6d1 llvm::SmallVectorBase<unsigned int>::size() const /tmp/llvm/llvm/include/llvm/ADT/SmallVector.h:70:32
#49 0x00005569e727d6d1 llvm::SmallVectorTemplateCommon<std::pair<int, clang::driver::Command const*>, void>::end() /tmp/llvm/llvm/include/llvm/ADT/SmallVector.h:251:41
#50 0x00005569e727d6d1 clang_main(int, char**) /tmp/llvm/clang/tools/driver/driver.cpp:515:26
#51 0x00007fa4ddae6d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#52 0x00005569e7278fca _start (/tmp/llvm/stage1/bin/clang+++0xbfca)
clang-15: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 15.0.0 (https://github.com/llvm/llvm-project e7766972a6790e25dbb4ce3481f57e9792b49269)
```
Reproducer archive: [testcase.zip](https://github.com/llvm/llvm-project/files/8916292/testcase.zip)
Reproducer command (once archive unpacked): `clang++ --sysroot sysroot-x86_64-linux-gnu -I sysroot-x86_64-linux-gnu/usr/include/c++/7.5.0 -I sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/c++/7.5.0 -std=gnu++17 -o TestPrintf.o -c -Igecko/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include gecko/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DMOZ_HAS_MOZGLUE -Igecko/mozglue/tests -Igecko/obj-x86_64-pc-linux-gnu/mozglue/tests -Igecko/obj-x86_64-pc-linux-gnu/dist/include -Igecko/obj-x86_64-pc-linux-gnu/dist/include/testing -Igecko/obj-x86_64-pc-linux-gnu/dist/include/nspr -Igecko/obj-x86_64-pc-linux-gnu/dist/include/nss -DMOZILLA_CLIENT -include gecko/obj-x86_64-pc-linux-gnu/mozilla-config.h -fsanitize=address gecko/mozglue/tests/TestPrintf.cpp`
Cc: @hctim
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs