[llvm-bugs] [Bug 51176] Segmentation fault in `PerformMoveOrCopyInitialization` with `clang++-12`

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 26 02:41:03 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51176

Andrew V. Jones <andrew.jones at vector.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #3 from Andrew V. Jones <andrew.jones at vector.com> ---
Hi Florian,

I think I'm missing something: your godbolt link has the source I shared and is
against "x86-64 clang (trunk)", but it shows exactly the same crash for me.

Namely:

```

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: /opt/compiler-explorer/clang-12.0.1/bin/clang++ -g
-o /app/output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-11.1.0 -fcolor-diagnostics
-fno-crash-diagnostics <source>
1.      <source>:6:11: current parser token ';'
2.      <source>:3:1: parsing namespace '(anonymous)'
3.      <source>:4:21: parsing function body '(anonymous namespace)::bx'
4.      <source>:4:21: in compound statement ('{}')
 #0 0x000055bb13a8a61c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x300b61c)
 #1 0x000055bb13a883c4 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x30093c4)
 #2 0x000055bb13a88645 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x3009645)
 #3 0x000055bb139f0f18 CrashRecoverySignalHandler(int)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x2f71f18)
 #4 0x00007f56f684a3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #5 0x000055bb15cd025f TryMoveInitialization(clang::Sema&,
clang::InitializedEntity const&, clang::VarDecl const*, clang::QualType,
clang::Expr*&, bool, bool, clang::ActionResult<clang::Expr*, true>&)
(.constprop.4280) (/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x525125f)
 #6 0x000055bb15ce2ebb
clang::Sema::PerformMoveOrCopyInitialization(clang::InitializedEntity const&,
clang::VarDecl const*, clang::QualType, clang::Expr*, bool)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x5263ebb)
 #7 0x000055bb15cf8464 clang::Sema::BuildReturnStmt(clang::SourceLocation,
clang::Expr*) (/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x5279464)
 #8 0x000055bb15cf8f62 clang::Sema::ActOnReturnStmt(clang::SourceLocation,
clang::Expr*, clang::Scope*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x5279f62)
 #9 0x000055bb15742275 clang::Parser::ParseReturnStatement()
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4cc3275)
#10 0x000055bb157452ef
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4cc62ef)
#11 0x000055bb15745879
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4cc6879)
#12 0x000055bb15746371 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4cc7371)
#13 0x000055bb15749b93 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4ccab93)
#14 0x000055bb156a1cf7
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c22cf7)
#15 0x000055bb156ca1f5 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c4b1f5)
#16 0x000055bb1569d451
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c1e451)
#17 0x000055bb1569db81
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.241)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c1eb81)
#18 0x000055bb156a3b09
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c24b09)
#19 0x000055bb156dc1d6
clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo,
4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&,
clang::BalancedDelimiterTracker&)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c5d1d6)
#20 0x000055bb156dcdfe clang::Parser::ParseNamespace(clang::DeclaratorContext,
clang::SourceLocation&, clang::SourceLocation)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c5ddfe)
#21 0x000055bb156cb37e
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c4c37e)
#22 0x000055bb156a3b2b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c24b2b)
#23 0x000055bb156a5089
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c26089)
#24 0x000055bb156982e9 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x4c192e9)
#25 0x000055bb148d80b2 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x3e590b2)
#26 0x000055bb142deee1 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x385fee1)
#27 0x000055bb142852e3
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x38062e3)
#28 0x000055bb143a70b3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x39280b3)
#29 0x000055bb11a5071c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-12.0.1/bin/clang+++0xfd171c)
#30 0x000055bb11a4cc9d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0xfcdc9d)
#31 0x000055bb14146f65 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)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x36c7f65)
#32 0x000055bb139f0ff3
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x2f71ff3)
#33 0x000055bb14147ab8
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.174)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x36c8ab8)
#34 0x000055bb1412060a
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x36a160a)
#35 0x000055bb1412115f
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x36a215f)
#36 0x000055bb14129f65
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0x36aaf65)
#37 0x000055bb119791cc main
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0xefa1cc)
#38 0x00007f56f62fa0b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#39 0x000055bb11a4c81a _start
(/opt/compiler-explorer/clang-12.0.1/bin/clang+++0xfcd81a)
clang-12: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
Compiler returned: 139
```

Cheers,

Andrew

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210726/5f77c98e/attachment-0001.html>


More information about the llvm-bugs mailing list