[llvm-bugs] [Bug 50909] New: ICE on valid code: {anonymous}::CGRecordLowering::clipTailPadding(): Assertion `Prior->FD->hasAttr<NoUniqueAddressAttr>() && "should not have reused this field's tail padding"' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 26 23:42:01 PDT 2021


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

            Bug ID: 50909
           Summary: ICE on valid code:
                    {anonymous}::CGRecordLowering::clipTailPadding():
                    Assertion `Prior->FD->hasAttr<NoUniqueAddressAttr>()
                    && "should not have reused this field's tail padding"'
                    failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cnsun at uwaterloo.ca
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

$ clang-trunk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
699d47472c3f7c5799fe75486689545179cfba03)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$ cat mutant.c
typedef a;
typedef struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
struct {
a b, c} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c,
    d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c,
    d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c,
    d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c,
    d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} b, c, d, e} f;
f g;

$ clang-trunk -w mutant.c
clang-13:
/tmp/tmp.MZZAoX1zOr-clang-builder/llvm-project/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:747:
void {anonymous}::CGRecordLowering::clipTailPadding(): Assertion
`Prior->FD->hasAttr<NoUniqueAddressAttr>() && "should not have reused this
field's tail padding"' failed.
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: /scratch/software/clang-trunk/bin/clang-13 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations
-disable-free -main-file-name mutant.c -mrelocation-model static
-mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb
-fcoverage-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210623_133652_02e3/delta/perses_result
-resource-dir /scratch/software/clang-trunk/lib/clang/13.0.0 -c-isystem .
-c-isystem /usr/local/include/cmsith -internal-isystem
/scratch/software/clang-trunk/lib/clang/13.0.0/include -internal-isystem
/usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -w
-fdebug-compilation-dir=/scratch/cnsun/workspace/perses-fuzzer/default_c_finding_folder/crash_20210623_133652_02e3/delta/perses_result
-ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1
-o /tmp/mutant-248f65.o -x c mutant.c
1.      <eof> parser at end of file
 #0 0x00005566e61a9684 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005566e61a6e3e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f69090443c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007f6908ae318b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007f6908ac2859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007f6908ac2729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007f6908ac2729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007f6908ad3f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x00005566e651f2e3 (anonymous
namespace)::CGRecordLowering::clipTailPadding() CGRecordLayoutBuilder.cpp:0:0
 #9 0x00005566e6525974 (anonymous namespace)::CGRecordLowering::lower(bool)
CGRecordLayoutBuilder.cpp:0:0
#10 0x00005566e6528eee
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(clang::RecordDecl const*,
llvm::StructType*) (/scratch/software/clang-trunk/bin/clang-13+0x3cdceee)
#11 0x00005566e6645dbf
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*)
(/scratch/software/clang-trunk/bin/clang-13+0x3df9dbf)
#12 0x00005566e664765b
clang::CodeGen::CodeGenTypes::getCGRecordLayout(clang::RecordDecl const*)
(/scratch/software/clang-trunk/bin/clang-13+0x3dfb65b)
#13 0x00005566e664788b
clang::CodeGen::CodeGenTypes::isZeroInitializable(clang::QualType)
(/scratch/software/clang-trunk/bin/clang-13+0x3dfb88b)
#14 0x00005566e650dd0f
clang::CodeGen::CodeGenModule::EmitNullConstant(clang::QualType)
(/scratch/software/clang-trunk/bin/clang-13+0x3cc1d0f)
#15 0x00005566e65da7d7
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*,
bool) (/scratch/software/clang-trunk/bin/clang-13+0x3d8e7d7)
#16 0x00005566e65dbd4d
clang::CodeGen::CodeGenModule::EmitTentativeDefinition(clang::VarDecl const*)
(/scratch/software/clang-trunk/bin/clang-13+0x3d8fd4d)
#17 0x00005566e84ffc22 clang::Sema::ActOnEndOfTranslationUnit()
(/scratch/software/clang-trunk/bin/clang-13+0x5cb3c22)
#18 0x00005566e83cc5de
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5b805de)
#19 0x00005566e83beb79 clang::ParseAST(clang::Sema&, bool, bool)
(/scratch/software/clang-trunk/bin/clang-13+0x5b72b79)
#20 0x00005566e7306218 clang::CodeGenAction::ExecuteAction()
(/scratch/software/clang-trunk/bin/clang-13+0x4aba218)
#21 0x00005566e6bb5a79 clang::FrontendAction::Execute()
(/scratch/software/clang-trunk/bin/clang-13+0x4369a79)
#22 0x00005566e6b48cc6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/scratch/software/clang-trunk/bin/clang-13+0x42fccc6)
#23 0x00005566e6c939c0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/scratch/software/clang-trunk/bin/clang-13+0x44479c0)
#24 0x00005566e3ab1696 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/scratch/software/clang-trunk/bin/clang-13+0x1265696)
#25 0x00005566e3aad9d8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#26 0x00005566e39db0e6 main
(/scratch/software/clang-trunk/bin/clang-13+0x118f0e6)
#27 0x00007f6908ac40b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#28 0x00005566e3aad54e _start
(/scratch/software/clang-trunk/bin/clang-13+0x126154e)
clang-13: error: unable to execute command: Aborted (core dumped)
clang-13: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 13.0.0 (https://github.com/llvm/llvm-project.git
699d47472c3f7c5799fe75486689545179cfba03)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
clang-13: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /tmp/mutant-1e13e1.c
clang-13: note: diagnostic msg: /tmp/mutant-1e13e1.sh
clang-13: 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/20210627/9e03ca93/attachment.html>


More information about the llvm-bugs mailing list