[llvm-bugs] [Bug 51314] New: [11/12] error: unable to execute command: Segmentation fault (core dumped)
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Aug 2 23:33:44 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=51314
Bug ID: 51314
Summary: [11/12] error: unable to execute command: Segmentation
fault (core dumped)
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C
Assignee: unassignedclangbugs at nondot.org
Reporter: anbu1024.me at gmail.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
$ cat 11.c
union u
{
int * const apple[];
};
void foo()
{
static union u apple = {0};
}
----------------------------------------------------------------
$ clang-1201 --version
clang version 12.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /path-to-llvm/12.0.1/install/bin
----------------------------------------------------------------
$ clang-1201 11.c
11.c:4:15: error: flexible array member 'apple' in a union is not allowed
int * const apple[];
^
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: /path-to-llvm/12.0.1/install/bin/clang-12 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations
-disable-free -disable-llvm-verifier -discard-value-names -main-file-name 11.c
-mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic
-fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir
/path-to-llvm/12.0.1/install/lib/clang/12.0.1 -internal-isystem
/usr/local/include -internal-isystem
/path-to-llvm/12.0.1/install/lib/clang/12.0.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdebug-compilation-dir /path-to-code/
-ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -o
/tmp/11-a7f952.o -x c 11.c
1. 11.c:9:29: current parser token ';'
2. 11.c:8:1: parsing function body 'foo'
3. 11.c:8:1: in compound statement ('{}')
#0 0x00005560eb599b01 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1ccbb01)
#1 0x00005560eb5978c4 llvm::sys::RunSignalHandlers()
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1cc98c4)
#2 0x00005560eb597a3b SignalHandler(int)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1cc9a3b)
#3 0x00007fdf533e43c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x00005560ee0b9698 clang::Expr::IgnoreParenCasts()
(/path-to-llvm/12.0.1/install/bin/clang-12+0x47eb698)
#5 0x00005560ed4bac50 clang::Sema::CheckForIntOverflow(clang::Expr*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3becc50)
#6 0x00005560ed4fee64 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3c30e64)
#7 0x00005560ed8b1bec clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3fe3bec)
#8 0x00005560ed5fa110 clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool) (/path-to-llvm/12.0.1/install/bin/clang-12+0x3d2c110)
#9 0x00005560ed348e68
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a7ae68)
#10 0x00005560ed35ab7c clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a8cb7c)
#11 0x00005560ed35b663
clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*, clang::SourceLocation*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a8d663)
#12 0x00005560ed35ba80
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*) (/path-to-llvm/12.0.1/install/bin/clang-12+0x3a8da80)
#13 0x00005560ed3f0703
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3b22703)
#14 0x00005560ed3f08cc
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3b228cc)
#15 0x00005560ed3f9ca1 clang::Parser::ParseCompoundStatementBody(bool)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3b2bca1)
#16 0x00005560ed3fd7d2 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3b2f7d2)
#17 0x00005560ed32ceca
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a5eeca)
#18 0x00005560ed35acbf clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a8ccbf)
#19 0x00005560ed327382
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a59382)
#20 0x00005560ed3279b5
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.0)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a599b5)
#21 0x00005560ed3311d0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (.localalias)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a631d0)
#22 0x00005560ed331515
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a63515)
#23 0x00005560ed320749 clang::ParseAST(clang::Sema&, bool, bool)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a52749)
#24 0x00005560ec543146 clang::CodeGenAction::ExecuteAction()
(/path-to-llvm/12.0.1/install/bin/clang-12+0x2c75146)
#25 0x00005560ebec5c31 clang::FrontendAction::Execute()
(/path-to-llvm/12.0.1/install/bin/clang-12+0x25f7c31)
#26 0x00005560ebe6299b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x259499b)
#27 0x00005560ebf97ae0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x26c9ae0)
#28 0x00005560ea3e81bb cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/path-to-llvm/12.0.1/install/bin/clang-12+0xb1a1bb)
#29 0x00005560ea3e59cb ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/path-to-llvm/12.0.1/install/bin/clang-12+0xb179cb)
#30 0x00005560ea36876e main
(/path-to-llvm/12.0.1/install/bin/clang-12+0xa9a76e)
#31 0x00007fdf52eb20b3 __libc_start_main
/build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#32 0x00005560ea3e555e _start
(/path-to-llvm/12.0.1/install/bin/clang-12+0xb1755e)
clang-12: error: unable to execute command: Segmentation fault (core dumped)
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 12.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /path-to-llvm/12.0.1/install/bin
clang-12: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/11-067245.c
clang-12: note: diagnostic msg: /tmp/11-067245.sh
clang-12: note: diagnostic msg:
----------------------------------------------------------------
$ clang-1100 --version
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
0160ad802e899c2922bc9b29564080c22eb0908c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin
----------------------------------------------------------------
$ clang-1100 11.c
11.c:4:15: error: flexible array member 'apple' in a union is not allowed
int * const apple[];
^
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:
/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name 11.c
-mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir
/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/lib/clang/11.0.0
-internal-isystem /usr/local/include -internal-isystem
/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/lib/clang/11.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /path-to-code/ -ferror-limit 19 -fgnuc-version=4.2.1
-fcolor-diagnostics -faddrsig -o /tmp/11-6aee6b.o -x c 11.c
1. 11.c:9:29: current parser token ';'
2. 11.c:8:1: parsing function body 'foo'
3. 11.c:8:1: in compound statement ('{}')
#0 0x00000000022bcf44 PrintStackTraceSignalHandler(void*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x22bcf44)
#1 0x00000000022bacce llvm::sys::RunSignalHandlers()
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x22bacce)
#2 0x00000000022bd245 SignalHandler(int)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x22bd245)
#3 0x00007fb23b8103c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x0000000003a6c42c clang::Sema::CheckForIntOverflow(clang::Expr*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3a6c42c)
#5 0x0000000003a6ca19 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3a6ca19)
#6 0x0000000003d4694b clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3d4694b)
#7 0x0000000003b47871 clang::Sema::AddInitializerToDecl(clang::Decl*,
clang::Expr*, bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3b47871)
#8 0x0000000003952653
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3952653)
#9 0x000000000394ff95 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x394ff95)
#10 0x000000000394ad6f
clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool,
clang::Parser::ForRangeInit*, clang::SourceLocation*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x394ad6f)
#11 0x000000000394a74a
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x394a74a)
#12 0x00000000039c6c3a
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x39c6c3a)
#13 0x00000000039c673e
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x39c673e)
#14 0x00000000039ce191 clang::Parser::ParseCompoundStatementBody(bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x39ce191)
#15 0x00000000039cf325 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x39cf325)
#16 0x0000000003937d48
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3937d48)
#17 0x000000000395077a clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x395077a)
#18 0x0000000003936f7d
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3936f7d)
#19 0x0000000003936a65
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3936a65)
#20 0x0000000003935ab6
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3935ab6)
#21 0x0000000003933dff
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x3933dff)
#22 0x00000000039300bd clang::ParseAST(clang::Sema&, bool, bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x39300bd)
#23 0x00000000029c4727 clang::FrontendAction::Execute()
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x29c4727)
#24 0x00000000029607c1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x29607c1)
#25 0x0000000002a5d12a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x2a5d12a)
#26 0x00000000009babc7 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x9babc7)
#27 0x00000000009b8eb1 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x9b8eb1)
#28 0x00000000009b8cb7 main
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x9b8cb7)
#29 0x00007fb23b2850b3 __libc_start_main
/build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#30 0x00000000009b5f4e _start
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x9b5f4e)
clang-11: error: unable to execute command: Segmentation fault (core dumped)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 (https://github.com/llvm/llvm-project.git
0160ad802e899c2922bc9b29564080c22eb0908c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.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/11-d61be3.c
clang-11: note: diagnostic msg: /tmp/11-d61be3.sh
clang-11: note: diagnostic msg:
********************
--
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/20210803/29fb21f0/attachment-0001.html>
More information about the llvm-bugs
mailing list