[llvm-bugs] [Bug 52011] New: A/F: `SI != MemberOffsets.begin() && "Offset not in structure type!"' after commit e9e1d4751b54

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 29 08:13:02 PDT 2021


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

            Bug ID: 52011
           Summary: A/F: `SI != MemberOffsets.begin() && "Offset not in
                    structure type!"' after commit e9e1d4751b54
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Internally we run the GDB test suite, and one of the tests within it started to
hit an assertion failure which I bisected down to commit
e9e1d4751b54126743ed72b1a9178ee51200acf6.

I reduced the test down to the following code:
/* repro.c */
struct {
  float a;
  struct {};
  double b
} __trans_tmp_1() {
}

Compiling using a compiler that includes
e9e1d4751b54126743ed72b1a9178ee51200acf6 with only "-c" is enough to reproduce
the failure:

$ ~/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang -c
repro.c
repro.c:4:11: warning: expected ';' at end of declaration list
  double b
          ^
          ;
repro.c:6:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
clang: /home/dyung/src/upstream/llvm_clean_git/llvm/lib/IR/DataLayout.cpp:85:
unsigned int llvm::StructLayout::getElementContainingOffset(uint64_t) const:
Assertion `SI != MemberOffsets.begin() && "Offset not in structure type!"'
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:
/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang
-c repro.c
1.      <eof> parser at end of file
2.      repro.c:5:3: LLVM IR generation of declaration '__trans_tmp_1'
3.      repro.c:5:3: Generating code for declaration '__trans_tmp_1'
 #0 0x0000559b1af95cf4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x0000559b1af93af4 llvm::sys::CleanupOnSignal(unsigned long)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x3b8aaf4)
 #2 0x0000559b1aed6c28 CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
 #3 0x00007f7730ee33c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x00007f773098218b raise
/build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f7730961859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007f7730961729 get_sysdep_segment_value
/build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007f7730961729 _nl_load_domain
/build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007f7730972f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #9 0x0000559b1a55f9c2
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x31569c2)
#10 0x0000559b1b49c928 getFPTypeAtOffset(llvm::Type*, unsigned int,
llvm::DataLayout const&) TargetInfo.cpp:0:0
#11 0x0000559b1b49c966 getFPTypeAtOffset(llvm::Type*, unsigned int,
llvm::DataLayout const&) TargetInfo.cpp:0:0
#12 0x0000559b1b49caba (anonymous
namespace)::X86_64ABIInfo::GetSSETypeAtOffset(llvm::Type*, unsigned int,
clang::QualType, unsigned int) const (.isra.0) TargetInfo.cpp:0:0
#13 0x0000559b1b4c6389 (anonymous
namespace)::X86_64ABIInfo::computeInfo(clang::CodeGen::CGFunctionInfo&) const
TargetInfo.cpp:0:0
#14 0x0000559b1b5dc3b2
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>,
bool, bool, llvm::ArrayRef<clang::CanQual<clang::Type> >,
clang::FunctionType::ExtInfo,
llvm::ArrayRef<clang::FunctionType::ExtParameterInfo>,
clang::CodeGen::RequiredArgs) (.constprop.0) CGCall.cpp:0:0
#15 0x0000559b1b5e8194
clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(clang::FunctionDecl
const*)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x41df194)
#16 0x0000559b1b4048c2
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x3ffb8c2)
#17 0x0000559b1b400485
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x3ff7485)
#18 0x0000559b1b4008eb
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x3ff78eb)
#19 0x0000559b1b409082
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0)
CodeGenModule.cpp:0:0
#20 0x0000559b1c15adc9 (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
ModuleBuilder.cpp:0:0
#21 0x0000559b1c14c7b0
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x4d437b0)
#22 0x0000559b1ce9f424 clang::ParseAST(clang::Sema&, bool, bool)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x5a96424)
#23 0x0000559b1c157f38 clang::CodeGenAction::ExecuteAction()
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x4d4ef38)
#24 0x0000559b1b9db949 clang::FrontendAction::Execute()
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x45d2949)
#25 0x0000559b1b96c9de
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x45639de)
#26 0x0000559b1babbe40
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x46b2e40)
#27 0x0000559b1876c27d cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x136327d)
#28 0x0000559b187684d8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#29 0x0000559b1b7f5369 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#30 0x0000559b1aed6dac
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x3acddac)
#31 0x0000559b1b7f5a7d
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const (.part.0) Job.cpp:0:0
#32 0x0000559b1b7c770b
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x43be70b)
#33 0x0000559b1b7c8219
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x43bf219)
#34 0x0000559b1b7d3a89
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x43caa89)
#35 0x0000559b1869dfc6 main
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x1294fc6)
#36 0x00007f77309630b3 __libc_start_main
/build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#37 0x0000559b1876804e _start
(/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin/clang+0x135f04e)
clang-14: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project.git
e9e1d4751b54126743ed72b1a9178ee51200acf6)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir:
/home/dyung/src/upstream/e9e1d4751b54126743ed72b1a9178ee51200acf6-linux/bin

-- 
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/20210929/6d4f033a/attachment-0001.html>


More information about the llvm-bugs mailing list