Open llvmbot opened 4 years ago
Not reproducible on newer versions.
@llvm/issue-subscribers-clang-frontend
Still going out of memory as of post-17 trunk: https://godbolt.org/z/a44eovcz4
LLVM ERROR: out of memory
Allocation failed
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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -x c -Wno-implicit-int <source>
1. <source>:3:42: current parser token ';'
2. <source>:3:19: parsing function body 'foo'
3. <source>:3:19: in compound statement ('{}')
#0 0x0000000003695258 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3695258)
#1 0x0000000003692f1c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3692f1c)
#2 0x00000000035de608 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f80195fa420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f80190bd00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f801909c859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00000000035e997b (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x35e997b)
#7 0x00000000035e9995 (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x35e9995)
#8 0x00007f8019482c12 operator new(unsigned long, std::align_val_t) (/lib/x86_64-linux-gnu/libstdc++.so.6+0xaac12)
#9 0x0000000006eaca6d llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::Allocate(unsigned long, unsigned long) (.constprop.0) Expr.cpp:0:0
#10 0x0000000006ec74f1 clang::ASTVector<clang::Stmt*>::grow(clang::ASTContext const&, unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6ec74f1)
#11 0x000000000651a123 (anonymous namespace)::InitListChecker::createInitListExpr(clang::QualType, clang::SourceRange, unsigned int) (.isra.0) SemaInit.cpp:0:0
#12 0x00000000065269d0 (anonymous namespace)::InitListChecker::InitListChecker(clang::Sema&, clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool, bool, bool, llvm::SmallVectorImpl<clang::QualType>*) SemaInit.cpp:0:0
#13 0x0000000006527d78 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6527d78)
#14 0x000000000613c5cb clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x613c5cb)
#15 0x0000000005e00060 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e00060)
#16 0x0000000005e0dc20 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e0dc20)
#17 0x0000000005e15f45 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e15f45)
#18 0x0000000005e163e7 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e163e7)
#19 0x0000000005eb6360 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5eb6360)
#20 0x0000000005eb7068 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5eb7068)
#21 0x0000000005eb7fa9 clang::Parser::ParseCompoundStatementBody(bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5eb7fa9)
#22 0x0000000005eb990a clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5eb990a)
#23 0x0000000005de6cf1 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5de6cf1)
#24 0x0000000005e0e328 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e0e328)
#25 0x0000000005ddac2b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5ddac2b)
#26 0x0000000005ddb35f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0) Parser.cpp:0:0
#27 0x0000000005de1a53 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5de1a53)
#28 0x0000000005de225d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5de225d)
#29 0x0000000005dd65da clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5dd65da)
#30 0x00000000048fc5d8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x48fc5d8)
#31 0x0000000004162899 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4162899)
#32 0x00000000040e65ee clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40e65ee)
#33 0x0000000004242b46 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4242b46)
#34 0x0000000000bd26a7 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbd26a7)
#35 0x0000000000bcad5a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#36 0x0000000003f3ea39 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
#37 0x00000000035deab4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x35deab4)
#38 0x0000000003f3f02f 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
#39 0x0000000003f07435 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f07435)
#40 0x0000000003f07e9d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f07e9d)
#41 0x0000000003f0fd65 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f0fd65)
#42 0x0000000000bd093c clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbd093c)
#43 0x0000000000ac9511 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xac9511)
#44 0x00007f801909e083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#45 0x0000000000bca83e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbca83e)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Extended Description
$ cat test5019.c
typedef char type_1 attribute ( ( vector_size ( - 1 ) ) ) ;
void foo ( void ) { type_1 var_0 = { 1 } ; }
$ clang-10 --version clang version 10.0.1 Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/jack/Documents/llvm/10.0.1/install/bin
$ clang-10 test5019.c test5019.c:2:39: error: vector size too large typedef char type_1 attribute ( ( vector_size ( - 1 ) ) ) ; ^ ~~~ 1 error generated.
$ clang-11 --version clang version 11.0.0 Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin
$ clang-11 test5019.c LLVM ERROR: out of memory PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump:
0 0x00000000022c4414 PrintStackTraceSignalHandler(void*) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x22c4414)
1 0x00000000022c219e llvm::sys::RunSignalHandlers() (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x22c219e)
2 0x00000000022c4715 SignalHandler(int) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x22c4715)
3 0x00007f9c803bb390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
4 0x00007f9c7ef25438 raise /build/glibc-e6zv40/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
5 0x00007f9c7ef2703a abort /build/glibc-e6zv40/glibc-2.23/stdlib/abort.c:91:0
6 0x000000000225c0f3 llvm::report_bad_alloc_error(char const*, bool) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x225c0f3)
7 0x000000000225c152 (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x225c152)
8 0x00007f9c7f55de8c operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x8de8c)
9 0x000000000180fda3 llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::Allocate(unsigned long, llvm::Align) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x180fda3)
10 0x00000000043c6c47 clang::InitListExpr::reserveInits(clang::ASTContext const&, unsigned int) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x43c6c47)
11 0x0000000003e02269 (anonymous namespace)::InitListChecker::createInitListExpr(clang::QualType, clang::SourceRange, unsigned int) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3e02269)
12 0x0000000003de97ea (anonymous namespace)::InitListChecker::InitListChecker(clang::Sema&, clang::InitializedEntity const&, clang::InitListExpr*, clang::QualType&, bool, bool, bool) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3de97ea)
13 0x0000000003df3935 clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr>, clang::QualType) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3df3935)
14 0x0000000003b64e45 clang::Sema::AddInitializerToDecl(clang::Decl, clang::Expr, bool) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3b64e45)
15 0x0000000003964bd9 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3964bd9)
16 0x000000000396241d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation, clang::Parser::ForRangeInit) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x396241d)
17 0x000000000395d49f clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit, clang::SourceLocation) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x395d49f)
18 0x000000000395ce7a clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x395ce7a)
19 0x00000000039e06da clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x39e06da)
20 0x00000000039e01de clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x39e01de)
21 0x00000000039e7e81 clang::Parser::ParseCompoundStatementBody(bool) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x39e7e81)
22 0x00000000039e9015 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x39e9015)
23 0x000000000394a0d8 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x394a0d8)
24 0x0000000003962c72 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation, clang::Parser::ForRangeInit) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3962c72)
25 0x000000000394930d clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x394930d)
26 0x0000000003948df5 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3948df5)
27 0x0000000003947e46 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x3947e46)
28 0x000000000394618f clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&, bool) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x394618f)
29 0x000000000394205d clang::ParseAST(clang::Sema&, bool, bool) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x394205d)
30 0x00000000029d5ea7 clang::FrontendAction::Execute() (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x29d5ea7)
31 0x000000000296fb01 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x296fb01)
32 0x0000000002a6da2c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x2a6da2c)
33 0x00000000009b40b2 cc1_main(llvm::ArrayRef<char const>, char const, void*) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x9b40b2)
34 0x00000000009b2881 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x9b2881)
35 0x00000000009b2680 main (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x9b2680)
36 0x00007f9c7ef10840 __libc_start_main /build/glibc-e6zv40/glibc-2.23/csu/../csu/libc-start.c:325:0
37 0x00000000009af879 _start (/home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin/clang-11+0x9af879)
clang-11: error: unable to execute command: Aborted (core dumped) clang-11: error: clang frontend command failed due to signal (use -v to see invocation) clang version 11.0.0 Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/jack/Documents/llvm/clang+llvm-11.0.0-rc1-x86_64-linux-gnu-ubuntu-16.04/bin clang-11: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-11: note: diagnostic msg: /tmp/test5019-fc95d2.c clang-11: note: diagnostic msg: /tmp/test5019-fc95d2.sh clang-11: note: diagnostic msg: