[llvm-bugs] [Bug 51342] New: [11/12] error: unable to execute command: Segmentation fault (core dumped)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 4 06:56:04 PDT 2021


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

            Bug ID: 51342
           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 13.c 

struct S
{
  int x;
  int y[];
};


struct S s = {2, 5, .x = 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 13.c 
13.c:9:21: warning: excess elements in struct initializer
[-Wexcess-initializers]
struct S s = {2, 5, .x = 0};
                    ^~~~~~
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 13.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/13-2f242f.o -x c 13.c
1.      <eof> parser at end of file
2.      13.c:9:10: LLVM IR generation of declaration 's'
3.      13.c:9:10: Generating code for declaration 's'
 #0 0x00005579bc009b01 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1ccbb01)
 #1 0x00005579bc0078c4 llvm::sys::RunSignalHandlers()
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1cc98c4)
 #2 0x00005579bc007a3b SignalHandler(int)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1cc9a3b)
 #3 0x00007f6d7ec153c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00005579badc58c4 clang::StmtVisitorBase<std::add_pointer, (anonymous
namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType) (.cold)
(/path-to-llvm/12.0.1/install/bin/clang-12+0xa878c4)
 #5 0x00005579bc309047
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::Expr const*,
clang::QualType) (/path-to-llvm/12.0.1/install/bin/clang-12+0x1fcb047)
 #6 0x00005579bc309316
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::Expr const*,
clang::QualType) (/path-to-llvm/12.0.1/install/bin/clang-12+0x1fcb316)
 #7 0x00005579bc30953f (anonymous
namespace)::ConstStructBuilder::Build(clang::InitListExpr*, bool)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1fcb53f)
 #8 0x00005579bc309b8e (anonymous
namespace)::ConstStructBuilder::BuildStruct(clang::CodeGen::ConstantEmitter&,
clang::InitListExpr*, clang::QualType)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1fcbb8e)
 #9 0x00005579bc30a72c clang::StmtVisitorBase<std::add_pointer, (anonymous
namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1fcc72c)
#10 0x00005579bc30a9fa
clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl
const&) (/path-to-llvm/12.0.1/install/bin/clang-12+0x1fcc9fa)
#11 0x00005579bc30abb4
clang::CodeGen::ConstantEmitter::tryEmitForInitializer(clang::VarDecl const&)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x1fccbb4)
#12 0x00005579bc3b3ec1
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool) (/path-to-llvm/12.0.1/install/bin/clang-12+0x2075ec1)
#13 0x00005579bc3d59ed
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/path-to-llvm/12.0.1/install/bin/clang-12+0x20979ed)
#14 0x00005579bc3d5f63
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x2097f63)
#15 0x00005579bc3dbe2d
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x209de2d)
#16 0x00005579bcfb5a01 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x2c77a01)
#17 0x00005579bcfa961d
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x2c6b61d)
#18 0x00005579bdd90734 clang::ParseAST(clang::Sema&, bool, bool)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x3a52734)
#19 0x00005579bcfb3146 clang::CodeGenAction::ExecuteAction()
(/path-to-llvm/12.0.1/install/bin/clang-12+0x2c75146)
#20 0x00005579bc935c31 clang::FrontendAction::Execute()
(/path-to-llvm/12.0.1/install/bin/clang-12+0x25f7c31)
#21 0x00005579bc8d299b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x259499b)
#22 0x00005579bca07ae0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/path-to-llvm/12.0.1/install/bin/clang-12+0x26c9ae0)
#23 0x00005579bae581bb cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/path-to-llvm/12.0.1/install/bin/clang-12+0xb1a1bb)
#24 0x00005579bae559cb ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/path-to-llvm/12.0.1/install/bin/clang-12+0xb179cb)
#25 0x00005579badd876e main
(/path-to-llvm/12.0.1/install/bin/clang-12+0xa9a76e)
#26 0x00007f6d7e6e30b3 __libc_start_main
/build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#27 0x00005579bae5555e _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/13-0ade19.c
clang-12: note: diagnostic msg: /tmp/13-0ade19.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 13.c 
13.c:9:21: warning: excess elements in struct initializer
[-Wexcess-initializers]
struct S s = {2, 5, .x = 0};
                    ^~~~~~
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 13.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/13-8c2b2e.o -x c 13.c 
1.      <eof> parser at end of file
2.      13.c:9:10: LLVM IR generation of declaration 's'
3.      13.c:9:10: Generating code for declaration 's'
 #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 0x00007fea828dc3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00000000024ba45a (anonymous
namespace)::ConstExprEmitter::EmitArrayInitialization(clang::InitListExpr*,
clang::QualType)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x24ba45a)
 #5 0x00000000024ae9d1
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::Expr const*,
clang::QualType)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x24ae9d1)
 #6 0x00000000024afd99
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::Expr const*,
clang::QualType)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x24afd99)
 #7 0x00000000024ba286 (anonymous
namespace)::ConstStructBuilder::Build(clang::InitListExpr*, bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x24ba286)
 #8 0x00000000024ba6af (anonymous
namespace)::ConstStructBuilder::BuildStruct(clang::CodeGen::ConstantEmitter&,
clang::InitListExpr*, clang::QualType)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x24ba6af)
 #9 0x00000000024ae8d9
clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl
const&)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x24ae8d9)
#10 0x00000000024afcb0
clang::CodeGen::ConstantEmitter::tryEmitForInitializer(clang::VarDecl const&)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x24afcb0)
#11 0x000000000253216b
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x253216b)
#12 0x000000000252be5b
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x252be5b)
#13 0x0000000002534594
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x2534594)
#14 0x0000000002f4010f (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x2f4010f)
#15 0x0000000002f3d6c2
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x2f3d6c2)
#16 0x00000000039300d4 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+0x39300d4)
#17 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)
#18 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)
#19 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)
#20 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)
#21 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)
#22 0x00000000009b8cb7 main
(/path-to-llvm/11.0.0/clang+llvm-11.0.0-x86_64-linux-gnu-ubuntu-20.04/bin/clang-11+0x9b8cb7)
#23 0x00007fea823510b3 __libc_start_main
/build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#24 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/13-787c82.c
clang-11: note: diagnostic msg: /tmp/13-787c82.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/20210804/4ddad1e2/attachment-0001.html>


More information about the llvm-bugs mailing list