[cfe-dev] Reordering fields of const static struct instance results in failed assertion in code generation

Connor Kuehl via cfe-dev cfe-dev at lists.llvm.org
Sun Mar 17 14:40:25 PDT 2019


Hello,

I'm trying to troubleshoot why Clang fails an assertion when emitting
code for an instance of a structure whose fields have been reordered and
saved in its AST RecordLayout prior to being lowered.

Background info:

 1. Structures marked for field layout randomization are intercepted in
    clang/lib/AST/RecordLayoutBuilder.cpp in method
    ASTContext::getASTRecordLayout(const RecordDecl *D).
 2. The RecordDecl's field order is then randomized and "zipped" back
    together inside the RecordDecl context, like so:

+void RecordFieldReorganizer::commit(
+    const RecordDecl *D, SmallVectorImpl<Decl *> &NewFieldOrder) const {
+  Decl *First, *Last;
+  Decl *OldLast = D->LastDecl->getNextDeclInContext();
+  std::tie(First, Last) = DeclContext::BuildDeclChain(
+      NewFieldOrder, false);
+  D->FirstDecl = First;
+  Last->NextInContextAndBits.setPointer(OldLast);
+  D->LastDecl = Last;
+}

We've observed this to work in our small, isolated test projects.
However, we are currently testing this to build the Linux kernel. There
are a number of structures that result in Clang failing an assertion
when it's trying to emit code for an instance of a structure declared
like this:

static const struct <name of struct> <name of instance> = { ... snipped
members being initialized ... }

I don't know for sure if the issue is related only to "const" or
"static" or a mix of both structures, but the stack traces that we're
seeing are related to const expressions.

Does anyone have any idea of what we should be looking for here? Our
code has never touched the backend and is adjacent only to
RecordLayoutBuilder and outside of the Linux kernel I can't reproduce
this in a simple C program (as the reordering works and Clang does not
abort).

Any advice is greatly appreciated. (And yes, the kernel compiles cleanly
after commenting out the call to the commit() method shown above)



We are primarily seeing only 2 stack traces, both related to the const
expression in code generation. The first stack trace is an example of
the failed assertion and the second stack trace is a segfault because
clang::TagType::getDecl() returns a nullptr.

clang-9:
/home/connor/src/llvm-project/llvm/include/llvm/Support/Casting.h:254:
typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X =
llvm::PointerType, Y = llvm::Type]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0.    Program arguments: /home/connor/src/llvm-project/build/bin/clang-9
-cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name
xhci-debugfs.c -mrelocation-model static -mthread-model posix
-fno-delete-null-pointer-checks -mllvm -warn-stack-size=2048
-relaxed-aliasing -fmath-errno -masm-verbose -no-integrated-as
-mconstructor-aliases -fuse-init-array -mcode-model kernel -target-cpu
x86-64 -target-feature +retpoline-indirect-calls -target-feature
+retpoline-indirect-branches -target-feature -sse -target-feature -mmx
-target-feature -sse2 -target-feature -3dnow -target-feature -avx
-target-feature -x87 -target-feature +retpoline-external-thunk
-disable-red-zone -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file
/home/connor/src/kernels/kees/linux/drivers/usb/host/xhci-debugfs.gcno
-nostdsysteminc -nobuiltininc -resource-dir
/home/connor/src/llvm-project/build/lib/clang/9.0.0 -dependency-file
drivers/usb/host/.xhci-debugfs.o.d -MT drivers/usb/host/xhci-debugfs.o
-sys-header-deps -isystem
/home/connor/src/llvm-project/build/lib/clang/9.0.0/include -include
./include/linux/kconfig.h -include ./include/linux/compiler_types.h -I
./arch/x86/include -I ./arch/x86/include/generated -I ./include -I
./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I
./include/uapi -I ./include/generated/uapi -D __KERNEL__ -D
CONFIG_AS_CFI=1 -D CONFIG_AS_CFI_SIGNAL_FRAME=1 -D
CONFIG_AS_CFI_SECTIONS=1 -D CONFIG_AS_FXSAVEQ=1 -D CONFIG_AS_SSSE3=1 -D
CONFIG_AS_AVX=1 -D CONFIG_AS_AVX2=1 -D CONFIG_AS_AVX512=1 -D
CONFIG_AS_SHA1_NI=1 -D CONFIG_AS_SHA256_NI=1 -D
KBUILD_BASENAME="xhci_debugfs" -D KBUILD_MODNAME="xhci_hcd" -O2 -Wall
-Wundef -Werror=strict-prototypes -Wno-trigraphs
-Werror-implicit-function-declaration -Werror=implicit-int
-Wno-format-security -Wno-sign-compare -Wno-format-invalid-specifier
-Wno-gnu -Wno-address-of-packed-member -Wno-tautological-compare
-Wno-unused-const-variable -Wdeclaration-after-statement -Wvla
-Wno-pointer-sign -Werror=date-time -Werror=incompatible-pointer-types
-Wno-initializer-overrides -Wno-unused-value -Wno-format
-Wno-sign-compare -Wno-format-zero-length -Wno-uninitialized -std=gnu89
-fno-dwarf-directory-asm -fdebug-compilation-dir
/home/connor/src/kernels/kees/linux -ferror-limit 19 -fmessage-length 0
-fwrapv -stack-protector 2 -mstack-alignment=8 -fno-builtin-bcmp
-fwchar-type=short -fno-signed-wchar -fobjc-runtime=gcc -fno-common
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o
/tmp/xhci-debugfs-e73c7a.s -x c drivers/usb/host/xhci-debugfs.c
1.    <eof> parser at end of file
2.    Per-file LLVM IR generation
3.    drivers/usb/host/xhci-debugfs.c:249:37: Generating code for
declaration 'xhci_ring_fops'
 #0 0x0000000003a9c829 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:494:11
 #1 0x0000000003a9c9d9 PrintStackTraceSignalHandler(void*)
/home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:558:1
 #2 0x0000000003a9b2f6 llvm::sys::RunSignalHandlers()
/home/connor/src/llvm-project/llvm/lib/Support/Signals.cpp:67:5
 #3 0x0000000003a9d08b SignalHandler(int)
/home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:357:1
 #4 0x00007f13c24e0890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x00007f13c0f89e97 gsignal
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007f13c0f8b801 abort
/build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007f13c0f7b39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #8 0x00007f13c0f7b412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x00000000012727b7 llvm::cast_retty<llvm::PointerType,
llvm::Type*>::ret_type llvm::cast<llvm::PointerType,
llvm::Type>(llvm::Type*)
/home/connor/src/llvm-project/llvm/include/llvm/Support/Casting.h:255:10
#10 0x0000000003e4174d (anonymous
namespace)::ConstantLValueEmitter::tryEmitAbsolute(llvm::Type*)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1701:12
#11 0x0000000003e3fd9c (anonymous
namespace)::ConstantLValueEmitter::tryEmit()
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1671:5
#12 0x0000000003e3908d
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::APValue const&,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1872:5
#13 0x0000000003e38ef7
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::Expr const*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1564:7
#14 0x0000000003e3a15d
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::Expr
const*, clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1509:19
#15 0x0000000003e5353a (anonymous
namespace)::ConstStructBuilder::Build(clang::InitListExpr*)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:395:15
#16 0x0000000003e53317 (anonymous
namespace)::ConstStructBuilder::BuildStruct(clang::CodeGen::ConstantEmitter&,
clang::InitListExpr*, clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:582:7
#17 0x0000000003e532d1 (anonymous
namespace)::ConstExprEmitter::EmitRecordInitialization(clang::InitListExpr*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:953:5
#18 0x0000000003e509cd (anonymous
namespace)::ConstExprEmitter::VisitInitListExpr(clang::InitListExpr*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:969:7
#19 0x0000000003e3eaf2 clang::StmtVisitorBase<std::add_pointer,
(anonymous namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
/home/connor/src/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:1017:1
#20 0x0000000003e38cf7
clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl
const&)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1486:8
#21 0x0000000003e3a096
clang::CodeGen::ConstantEmitter::tryEmitForInitializer(clang::VarDecl
const&)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1245:10
#22 0x0000000003f2f311
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl
const*, bool)
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3544:10
#23 0x0000000003f26921
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2509:12
#24 0x0000000003f1e65c clang::CodeGen::CodeGenModule::EmitDeferred()
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:1884:10
#25 0x0000000003f1cfbf clang::CodeGen::CodeGenModule::Release()
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:393:3
#26 0x0000000004ddc292 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
/home/connor/src/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:260:11
#27 0x0000000004dd625e
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:237:14
#28 0x00000000065285bc clang::ParseAST(clang::Sema&, bool, bool)
/home/connor/src/llvm-project/clang/lib/Parse/ParseAST.cpp:176:12
#29 0x000000000457e922 clang::ASTFrontendAction::ExecuteAction()
/home/connor/src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1037:1
#30 0x0000000004dd3ddf clang::CodeGenAction::ExecuteAction()
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1049:1
#31 0x000000000457e340 clang::FrontendAction::Execute()
/home/connor/src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:938:7
#32 0x0000000004513f2e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/connor/src/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:953:7
#33 0x0000000004701afb
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/connor/src/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:271:8
#34 0x000000000122f09e cc1_main(llvm::ArrayRef<char const*>, char
const*, void*)
/home/connor/src/llvm-project/clang/tools/driver/cc1_main.cpp:218:11
#35 0x0000000001222da1 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/home/connor/src/llvm-project/clang/tools/driver/driver.cpp:309:5
#36 0x0000000001222139 main
/home/connor/src/llvm-project/clang/tools/driver/driver.cpp:381:5
#37 0x00007f13c0f6cb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#38 0x00000000012218fa _start
(/home/connor/src/llvm-project/build/bin/clang-9+0x12218fa)
clang-9: error: unable to execute command: Aborted (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to
see invocation)
clang version 9.0.0 (git at github.com:clang-randstruct/llvm-project.git
d58b50ec6d0390780638692064670b091b2a5b41)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/connor/src/llvm-project/build/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed
source, and associated run script.
clang-9: note: diagnostic msg:
********************




Stack dump:
0.    Program arguments: /home/connor/src/llvm-project/build/bin/clang-9
-cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name
auth.c -mrelocation-model static -mthread-model posix
-fno-delete-null-pointer-checks -mllvm -warn-stack-size=2048
-relaxed-aliasing -fmath-errno -masm-verbose -no-integrated-as
-mconstructor-aliases -fuse-init-array -mcode-model kernel -target-cpu
x86-64 -target-feature +retpoline-indirect-calls -target-feature
+retpoline-indirect-branches -target-feature -sse -target-feature -mmx
-target-feature -sse2 -target-feature -3dnow -target-feature -avx
-target-feature -x87 -target-feature +retpoline-external-thunk
-disable-red-zone -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file
/home/connor/src/kernels/kees/linux/net/sunrpc/auth.gcno -nostdsysteminc
-nobuiltininc -resource-dir
/home/connor/src/llvm-project/build/lib/clang/9.0.0 -dependency-file
net/sunrpc/.auth.o.d -MT net/sunrpc/auth.o -sys-header-deps -isystem
/home/connor/src/llvm-project/build/lib/clang/9.0.0/include -include
./include/linux/kconfig.h -include ./include/linux/compiler_types.h -I
./arch/x86/include -I ./arch/x86/include/generated -I ./include -I
./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I
./include/uapi -I ./include/generated/uapi -D __KERNEL__ -D
CONFIG_AS_CFI=1 -D CONFIG_AS_CFI_SIGNAL_FRAME=1 -D
CONFIG_AS_CFI_SECTIONS=1 -D CONFIG_AS_FXSAVEQ=1 -D CONFIG_AS_SSSE3=1 -D
CONFIG_AS_AVX=1 -D CONFIG_AS_AVX2=1 -D CONFIG_AS_AVX512=1 -D
CONFIG_AS_SHA1_NI=1 -D CONFIG_AS_SHA256_NI=1 -D KBUILD_BASENAME="auth"
-D KBUILD_MODNAME="sunrpc" -O2 -Wall -Wundef -Werror=strict-prototypes
-Wno-trigraphs -Werror-implicit-function-declaration
-Werror=implicit-int -Wno-format-security -Wno-sign-compare
-Wno-format-invalid-specifier -Wno-gnu -Wno-address-of-packed-member
-Wno-tautological-compare -Wno-unused-const-variable
-Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Werror=date-time
-Werror=incompatible-pointer-types -Wno-initializer-overrides
-Wno-unused-value -Wno-format -Wno-sign-compare -Wno-format-zero-length
-Wno-uninitialized -std=gnu89 -fno-dwarf-directory-asm
-fdebug-compilation-dir /home/connor/src/kernels/kees/linux
-ferror-limit 19 -fmessage-length 0 -fwrapv -stack-protector 2
-mstack-alignment=8 -fno-builtin-bcmp -fwchar-type=short
-fno-signed-wchar -fobjc-runtime=gcc -fno-common
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o
/tmp/auth-7e5811.s -x c net/sunrpc/auth.c
1.    <eof> parser at end of file
2.    Per-file LLVM IR generation
3.    net/sunrpc/auth.c:42:20: Generating code for declaration
'machine_cred'
  AR      net/sched/built-in.a
  CC      net/unix/af_unix.o
  CC      drivers/input/evdev.o
clang-9:
/home/connor/src/llvm-project/llvm/include/llvm/Support/Casting.h:254:
typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X =
llvm::PointerType, Y = llvm::Type]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0.    Program arguments: /home/connor/src/llvm-project/build/bin/clang-9
-cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name
evdev.c -mrelocation-model static -mthread-model posix
-fno-delete-null-pointer-checks -mllvm -warn-stack-size=2048
-relaxed-aliasing -fmath-errno -masm-verbose -no-integrated-as
-mconstructor-aliases -fuse-init-array -mcode-model kernel -target-cpu
x86-64 -target-feature +retpoline-indirect-calls -target-feature
+retpoline-indirect-branches -target-feature -sse -target-feature -mmx
-target-feature -sse2 -target-feature -3dnow -target-feature -avx
-target-feature -x87 -target-feature +retpoline-external-thunk
-disable-red-zone -dwarf-column-info -debugger-tuning=gdb
-momit-leaf-frame-pointer -coverage-notes-file
/home/connor/src/kernels/kees/linux/drivers/input/evdev.gcno
-nostdsysteminc -nobuiltininc -resource-dir
/home/connor/src/llvm-project/build/lib/clang/9.0.0 -dependency-file
drivers/input/.evdev.o.d -MT drivers/input/evdev.o -sys-header-deps
-isystem /home/connor/src/llvm-project/build/lib/clang/9.0.0/include
-include ./include/linux/kconfig.h -include
./include/linux/compiler_types.h -I ./arch/x86/include -I
./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I
./arch/x86/include/generated/uapi -I ./include/uapi -I
./include/generated/uapi -D __KERNEL__ -D CONFIG_AS_CFI=1 -D
CONFIG_AS_CFI_SIGNAL_FRAME=1 -D CONFIG_AS_CFI_SECTIONS=1 -D
CONFIG_AS_FXSAVEQ=1 -D CONFIG_AS_SSSE3=1 -D CONFIG_AS_AVX=1 -D
CONFIG_AS_AVX2=1 -D CONFIG_AS_AVX512=1 -D CONFIG_AS_SHA1_NI=1 -D
CONFIG_AS_SHA256_NI=1 -D KBUILD_BASENAME="evdev" -D
KBUILD_MODNAME="evdev" -O2 -Wall -Wundef -Werror=strict-prototypes
-Wno-trigraphs -Werror-implicit-function-declaration
-Werror=implicit-int -Wno-format-security -Wno-sign-compare
-Wno-format-invalid-specifier -Wno-gnu -Wno-address-of-packed-member
-Wno-tautological-compare -Wno-unused-const-variable
-Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Werror=date-time
-Werror=incompatible-pointer-types -Wno-initializer-overrides
-Wno-unused-value -Wno-format -Wno-sign-compare -Wno-format-zero-length
-Wno-uninitialized -std=gnu89 -fno-dwarf-directory-asm
-fdebug-compilation-dir /home/connor/src/kernels/kees/linux
-ferror-limit 19 -fmessage-length 0 -fwrapv -stack-protector 2
-mstack-alignment=8 -fno-builtin-bcmp -fwchar-type=short
-fno-signed-wchar -fobjc-runtime=gcc -fno-common
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o
/tmp/evdev-eea082.s -x c drivers/input/evdev.c
1.    <eof> parser at end of file
2.    Per-file LLVM IR generation
3.    drivers/input/evdev.c:1327:37: Generating code for declaration
'evdev_fops'
  CC      net/unix/garbage.o
 #0 0x0000000003a9c829 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:494:11
 #1 0x0000000003a9c9d9 PrintStackTraceSignalHandler(void*)
/home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:558:1
 #2 0x0000000003a9b2f6 llvm::sys::RunSignalHandlers()
/home/connor/src/llvm-project/llvm/lib/Support/Signals.cpp:67:5
 #3 0x0000000003a9d08b SignalHandler(int)
/home/connor/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:357:1
 #4 0x00007f6d65eef890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x0000000007ab1920 clang::TagType::getDecl() const
/home/connor/src/llvm-project/clang/lib/AST/Type.cpp:3245:32
 #6 0x0000000003e0bc05 clang::RecordType::getDecl() const
/home/connor/src/llvm-project/clang/include/clang/AST/Type.h:4391:5
 #7 0x0000000003e487b7 (anonymous
namespace)::ConstStructBuilder::Finalize(clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:508:15
 #8 0x0000000003e53354 (anonymous
namespace)::ConstStructBuilder::BuildStruct(clang::CodeGen::ConstantEmitter&,
clang::InitListExpr*, clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:585:3
 #9 0x0000000003e532d1 (anonymous
namespace)::ConstExprEmitter::EmitRecordInitialization(clang::InitListExpr*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:953:5
#10 0x0000000003e509cd (anonymous
namespace)::ConstExprEmitter::VisitInitListExpr(clang::InitListExpr*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:969:7
#11 0x0000000003e3eaf2 clang::StmtVisitorBase<std::add_pointer,
(anonymous namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
/home/connor/src/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:1017:1
#12 0x0000000003e38f46
clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::Expr const*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1566:7
#13 0x0000000003e3a15d
clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::Expr
const*, clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1509:19
#14 0x0000000003e5353a (anonymous
namespace)::ConstStructBuilder::Build(clang::InitListExpr*)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:395:15
#15 0x0000000003e53317 (anonymous
namespace)::ConstStructBuilder::BuildStruct(clang::CodeGen::ConstantEmitter&,
clang::InitListExpr*, clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:582:7
#16 0x0000000003e532d1 (anonymous
namespace)::ConstExprEmitter::EmitRecordInitialization(clang::InitListExpr*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:953:5
#17 0x0000000003e509cd (anonymous
namespace)::ConstExprEmitter::VisitInitListExpr(clang::InitListExpr*,
clang::QualType)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:969:7
#18 0x0000000003e3eaf2 clang::StmtVisitorBase<std::add_pointer,
(anonymous namespace)::ConstExprEmitter, llvm::Constant*,
clang::QualType>::Visit(clang::Stmt*, clang::QualType)
/home/connor/src/llvm-project/build/tools/clang/include/clang/AST/StmtNodes.inc:1017:1
#19 0x0000000003e38cf7
clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl
const&)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1486:8
#20 0x0000000003e3a096
clang::CodeGen::ConstantEmitter::tryEmitForInitializer(clang::VarDecl
const&)
/home/connor/src/llvm-project/clang/lib/CodeGen/CGExprConstant.cpp:1245:10
#21 0x0000000003f2f311
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl
const*, bool)
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3544:10
#22 0x0000000003f26921
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2509:12
#23 0x0000000003f1e65c clang::CodeGen::CodeGenModule::EmitDeferred()
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:1884:10
#24 0x0000000003f1cfbf clang::CodeGen::CodeGenModule::Release()
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:393:3
#25 0x0000000004ddc292 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
/home/connor/src/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:260:11
#26 0x0000000004dd625e
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:237:14
#27 0x00000000065285bc clang::ParseAST(clang::Sema&, bool, bool)
/home/connor/src/llvm-project/clang/lib/Parse/ParseAST.cpp:176:12
#28 0x000000000457e922 clang::ASTFrontendAction::ExecuteAction()
/home/connor/src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1037:1
#29 0x0000000004dd3ddf clang::CodeGenAction::ExecuteAction()
/home/connor/src/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1049:1
#30 0x000000000457e340 clang::FrontendAction::Execute()
/home/connor/src/llvm-project/clang/lib/Frontend/FrontendAction.cpp:938:7
#31 0x0000000004513f2e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/connor/src/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:953:7
#32 0x0000000004701afb
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/connor/src/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:271:8
#33 0x000000000122f09e cc1_main(llvm::ArrayRef<char const*>, char
const*, void*)
/home/connor/src/llvm-project/clang/tools/driver/cc1_main.cpp:218:11
#34 0x0000000001222da1 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/home/connor/src/llvm-project/clang/tools/driver/driver.cpp:309:5
#35 0x0000000001222139 main
/home/connor/src/llvm-project/clang/tools/driver/driver.cpp:381:5
#36 0x00007f6d6497bb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#37 0x00000000012218fa _start
(/home/connor/src/llvm-project/build/bin/clang-9+0x12218fa)
clang-9: error: unable to execute command: Segmentation fault (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to
see invocation)
clang version 9.0.0 (git at github.com:clang-randstruct/llvm-project.git
d58b50ec6d0390780638692064670b091b2a5b41)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/connor/src/llvm-project/build/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed
source, and associated run script.
clang-9: note: diagnostic msg:
********************




More information about the cfe-dev mailing list