Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

crash with "-g" at -O1 and above in 32-bit and 64-bit modes on x86_64-linux-gnu (Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed.) #33407

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR34435
Status CONFIRMED
Importance P enhancement
Reported by Chengnian Sun (chengniansun@gmail.com)
Reported on 2017-09-02 18:44:25 -0700
Last modified on 2021-04-20 09:40:04 -0700
Version trunk
Hardware PC Windows NT
CC andrew@ziglang.org, aprantl@apple.com, craig.topper@gmail.com, david.bolvansky@gmail.com, dblaikie@gmail.com, ditaliano@apple.com, efriedma@quicinc.com, hfinkel@anl.gov, jdevlieghere@apple.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, nikita.ppv@gmail.com, pengfei.wang@intel.com, rnk@google.com, spatel+llvm@rotateright.com, stephan.bergmann.secondary@googlemail.com, su@cs.ucdavis.edu
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
$ clang-trunk -v
clang version 6.0.0 (trunk 312414)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$ clang-trunk -O3 -g small.c
clang-6.0: /tmp/llvm-builder/llvm-source-
trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp:405: void
llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion
`FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' failed.
#0 0x00000000021345ea llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-6.0+0x21345ea)
#1 0x000000000213269e llvm::sys::RunSignalHandlers() (/usr/local/clang-
trunk/bin/clang-6.0+0x213269e)
#2 0x0000000002132802 SignalHandler(int) (/usr/local/clang-trunk/bin/clang-
6.0+0x2132802)
#3 0x00007f26657be330 __restore_rt (/lib/x86_64-linux-
gnu/libpthread.so.0+0x10330)
#4 0x00007f26645acc37 gsignal /build/eglibc-MjiXCM/eglibc-
2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f26645b0028 abort /build/eglibc-MjiXCM/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f26645a5bf6 __assert_fail_base /build/eglibc-MjiXCM/eglibc-
2.19/assert/assert.c:92:0
#7 0x00007f26645a5ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x0000000002838c19 (/usr/local/clang-trunk/bin/clang-6.0+0x2838c19)
#9 0x0000000002878bd1
llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(llvm::DIGlobalVariable
const*, llvm::ArrayRef<llvm::DwarfCompileUnit::GlobalExpr>) (/usr/local/clang-
trunk/bin/clang-6.0+0x2878bd1)
#10 0x00000000028325d8 llvm::DwarfDebug::beginModule() (/usr/local/clang-
trunk/bin/clang-6.0+0x28325d8)
#11 0x000000000281771a llvm::AsmPrinter::doInitialization(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-6.0+0x281771a)
#12 0x0000000001cdc767 llvm::FPPassManager::doInitialization(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-6.0+0x1cdc767)
#13 0x0000000001ce738b llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-6.0+0x1ce738b)
#14 0x00000000022be92e (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (/usr/local/clang-
trunk/bin/clang-6.0+0x22be92e)
#15 0x00000000022bfc0f clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (/usr/local/clang-
trunk/bin/clang-6.0+0x22bfc0f)
#16 0x0000000002a974ab
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-6.0+0x2a974ab)
#17 0x0000000002cb5412 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-6.0+0x2cb5412)
#18 0x0000000002a96b4f clang::CodeGenAction::ExecuteAction() (/usr/local/clang-
trunk/bin/clang-6.0+0x2a96b4f)
#19 0x0000000002656636 clang::FrontendAction::Execute() (/usr/local/clang-
trunk/bin/clang-6.0+0x2656636)
#20 0x000000000262dc0e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-6.0+0x262dc0e)
#21 0x00000000026e500b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/clang-
trunk/bin/clang-6.0+0x26e500b)
#22 0x0000000000c20cf8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-6.0+0xc20cf8)
#23 0x0000000000badeef main (/usr/local/clang-trunk/bin/clang-6.0+0xbadeef)
#24 0x00007f2664597f45 __libc_start_main /build/eglibc-MjiXCM/eglibc-
2.19/csu/libc-start.c:321:0
#25 0x0000000000c1c319 _start (/usr/local/clang-trunk/bin/clang-6.0+0xc1c319)
Stack dump:
0.      Program arguments: /usr/local/clang-trunk/bin/clang-6.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c -
mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -
mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -momit-
leaf-frame-pointer -dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -resource-dir /usr/local/clang-trunk/lib/clang/6.0.0 -c-
isystem /usr/local/include/csmith-2.2.0/ -c-isystem /usr/local/include/csmith-
2.2.0/ -internal-isystem /usr/local/include -internal-isystem /usr/local/clang-
trunk/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/x86_64-
linux-gnu -internal-externc-isystem /include -internal-externc-isystem
/usr/include -O3 -fdebug-compilation-dir /home/cnsun/ramdisk/hermes/run-
4/res/20170901-clang-trunk-m32-Weverything-g-O3-mllvm-enable-newgvn-mllvm-polly-
build-145517/delta -ferror-limit 19 -fmessage-length 270 -fobjc-runtime=gcc -
fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o
/tmp/small-e37dc0.o -x c small.c
1.      <eof> parser at end of file
2.      Code generation
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 312414)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-6.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-6.0: note: diagnostic msg: /tmp/small-a5424f.c
clang-6.0: note: diagnostic msg: /tmp/small-a5424f.sh
clang-6.0: note: diagnostic msg:

********************
$ cat small.c
struct S0 {
  int f0;
  short f1;
};
struct {
  short f1;
  struct S0 f2;
  char f7;
} static a = {9, 2}, *b = &a;
int main() {
  a.f1++;
  char c = a.f7 & 5;
  a.f7 = c;
  for (; (*b).f2.f1; (*b).f2.f1++)
    (*b).f2.f0 = 0;
  for (; (*b).f2.f0;)
    ;
  return 0;
}
$
Quuxplusone commented 7 years ago

This looks related to issue 34159, which is claimed fixed in r311217, while your trunk build r312414 is younger. (I ran into a similar instance of this assertion failure now with trunk build r312468.)

Quuxplusone commented 6 years ago
This still fails with rev. 314643. Below provides another test:

--------------------------------------

int printf (const char *, ...);

struct A
{
  int b;
  int c;
  int d;
};

struct B
{
  struct A e;
  int f;
};

static struct B g;
int h;

void fn1 ()
{
  g.e.d = (short) g.e.d;
  g.f += g.e.d;
  g.e.c = h;
  g.e.b = 1;
  g.e.c = 1 && g.e.c;
}

int main ()
{
  fn1 ();
  printf ("%d\n", g.e.b);
  return 0;
}
Quuxplusone commented 3 years ago
We're hitting this with the zig std lib tests on LLVM 11 release candidate 3.

LLVM 11 debug mode (assertions enabled):

[nix-shell:~/tmp/zig/build-llvm11-debug]$ ./zig test ../lib/std/std.zig --
release-fast

LLVM Emit Output... zig: ../lib/CodeGen/AsmPrinter/DwarfExpression.cpp:603:
void llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*):
Assertion `FragmentOffset >= OffsetInBits && "overlapping or duplicate
fragments"' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff7abe15a in raise ()
   from /nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7abe15a in raise ()
   from /nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6
#1  0x00007ffff7aa8548 in abort ()
   from /nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6
#2  0x00007ffff7aa842f in __assert_fail_base.cold.0 ()
   from /nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6
#3  0x00007ffff7ab6ad2 in __assert_fail ()
   from /nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6
#4  0x00000000067f9250 in llvm::DwarfExpression::addFragmentOffset
(this=0x7fffffff63a0,
    Expr=0x14331f990) at ../lib/CodeGen/AsmPrinter/DwarfExpression.cpp:603
#5  0x000000000688897b in llvm::DwarfCompileUnit::constructVariableDIEImpl
(this=0x134848790, DV=...,
    Abstract=false) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:741
#6  0x00000000068882cc in llvm::DwarfCompileUnit::constructVariableDIE
(this=0x134848790, DV=...,
    Abstract=false) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:661
#7  0x0000000006888d86 in llvm::DwarfCompileUnit::constructVariableDIE
(this=0x134848790, DV=...,
    Scope=..., ObjectPointer=@0x7fffffff66c0: 0x0)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:790
#8  0x0000000006889656 in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0x9e198658, Children=..., HasNonScopeChildren=0x7fffffff67c7)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:896
#9  0x0000000006887860 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0x9e198658, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:512
#10 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0xb88401f8, Children=..., HasNonScopeChildren=0x7fffffff6aa7)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#11 0x0000000006887860 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0xb88401f8, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:512
#12 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0xa3873538, Children=..., HasNonScopeChildren=0x7fffffff6d87)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#13 0x0000000006887860 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0xa3873538, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:512
#14 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0x11c18c868, Children=..., HasNonScopeChildren=0x7fffffff7067)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#15 0x0000000006887860 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0x11c18c868, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:512
#16 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0xb91c6a78, Children=..., HasNonScopeChildren=0x0)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#17 0x0000000006887808 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0xb91c6a78, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:502
#18 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0x11c18c708, Children=..., HasNonScopeChildren=0x7fffffff7627)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#19 0x0000000006887860 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0x11c18c708, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:512
#20 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0xa37c2388, Children=..., HasNonScopeChildren=0x0)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#21 0x0000000006887808 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0xa37c2388, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:502
#22 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
--Type <RET> for more, q to quit, c to continue without paging--
    Scope=0x1478a24c0, Children=..., HasNonScopeChildren=0x7fffffff7be7)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#23 0x0000000006887860 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0x1478a24c0, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:512
#24 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0x14c256060, Children=..., HasNonScopeChildren=0x7fffffff7ec7)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#25 0x0000000006887860 in llvm::DwarfCompileUnit::constructScopeDIE
(this=0x134848790,
    Scope=0x14c256060, FinalChildren=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:512
#26 0x00000000068898ad in llvm::DwarfCompileUnit::createScopeChildrenDIE
(this=0x134848790,
    Scope=0xa9844a20, Children=..., HasNonScopeChildren=0x0)
    at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:913
#27 0x0000000006889aaa in llvm::DwarfCompileUnit::createAndAddScopeChildren
(this=0x134848790,
    Scope=0xa9844a20, ScopeDIE=...) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:950
#28 0x0000000006889995 in llvm::DwarfCompileUnit::constructSubprogramScopeDIE
(this=0x134848790,
    Sub=0x136b1d090, Scope=0xa9844a20) at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:928
#29 0x00000000067b0678 in llvm::DwarfDebug::endFunctionImpl (this=0x226a1180,
MF=0xa03d23e0)
    at ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2184
#30 0x000000000679c739 in llvm::DebugHandlerBase::endFunction (this=0x226a1180,
MF=0xa03d23e0)
    at ../lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:324
#31 0x000000000677f0e4 in llvm::AsmPrinter::emitFunctionBody (this=0x133fb01e0)
    at ../lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1297
#32 0x0000000004a644cc in llvm::X86AsmPrinter::runOnMachineFunction
(this=0x133fb01e0, MF=...)
    at ../lib/Target/X86/X86AsmPrinter.cpp:82
#33 0x0000000006b0aa3a in llvm::MachineFunctionPass::runOnFunction
(this=0x133fb01e0, F=...)
    at ../lib/CodeGen/MachineFunctionPass.cpp:73
#34 0x0000000007b6f707 in llvm::FPPassManager::runOnFunction (this=0x14b0235d0,
F=...)
    at ../lib/IR/LegacyPassManager.cpp:1516
#35 0x0000000007b6f96c in llvm::FPPassManager::runOnModule (this=0x14b0235d0,
M=...)
    at ../lib/IR/LegacyPassManager.cpp:1552
#36 0x0000000007b6fd96 in (anonymous namespace)::MPPassManager::runOnModule
(this=0x1014fa40, M=...)
    at ../lib/IR/LegacyPassManager.cpp:1617
#37 0x0000000007b6b38c in llvm::legacy::PassManagerImpl::run (this=0x133ee56f0,
M=...)
    at ../lib/IR/LegacyPassManager.cpp:614
#38 0x0000000007b7057b in llvm::legacy::PassManager::run (this=0x7fffffff8f10,
M=...)
    at ../lib/IR/LegacyPassManager.cpp:1737
#39 0x0000000001feb270 in ZigLLVMTargetMachineEmitToFile
(targ_machine_ref=0xd9c55c0,
    module_ref=0xd9c2b90, error_message=0x7fffffff9200, is_debug=false, is_small=false,
    time_report=false, asm_filename=0x0,
    bin_filename=0x132c590c0 "zig-cache/o/dAEAjcSxs5fxXkdlrT4Y8xxmxNxKPfmVnhg7FEwh80PQ4FQ736r7vhjllQNWIeVh/test.o", llvm_ir_filename=0x0) at ../src/zig_llvm.cpp:284
#40 0x0000000001bbeb3f in zig_llvm_emit_output (g=0xd9ad9c0) at
../src/codegen.cpp:8347
#41 0x0000000001bc96de in codegen_build_and_link (g=0xd9ad9c0) at
../src/codegen.cpp:11076
#42 0x0000000001b99ac7 in main0 (argc=4, argv=0x7fffffff9e98) at
../src/main.cpp:1792
#43 0x0000000001b99f28 in main (argc=4, argv=0x7fffffff9e98) at
../src/main.cpp:1870
(gdb)
Quuxplusone commented 3 years ago

It may be the same assertion, but neither of the test cases from 2017 reproduce the issue, so I would say that the zig issue is new.

Can you extract the IR and reproduce the issue with llc?

Quuxplusone commented 3 years ago
I wasn't able to reproduce it with opt but I was able to repro it with clang.
Sorry the gzipped .ll file is 15M.

curl http://andrewkelley.me.s3.amazonaws.com/temp/llvm-bug-34435.ll.gz | gunzip
>test.ll
~/local/llvm11-debug/bin/clang-11  -O3 test.ll -c

clang-11: ../lib/CodeGen/AsmPrinter/DwarfExpression.cpp:603: void
llvm::DwarfExpression::addFragmentOffset(const llvm::DIExpression*): Assertion
`FragmentOffset >= OffsetInBits && "overlapping or duplicate fragments"' 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/andy/local/llvm11-debug/bin/clang-11 -O3 test.ll -c
1.  Code generation
2.  Running pass 'Function Pass Manager' on module 'test.ll'.
3.  Running pass 'X86 Assembly Printer' on function '@"json.test \22parse into
tagged union\22"'
 #0 0x0000000004433298 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Support/Unix/Signals.inc:564:22
 #1 0x000000000443332b PrintStackTraceSignalHandler(void*) /home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Support/Unix/Signals.inc:625:1
 #2 0x00000000044313dc llvm::sys::RunSignalHandlers() /home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Support/Signals.cpp:68:20
 #3 0x0000000004432bd1 llvm::sys::CleanupOnSignal(unsigned long) /home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Support/Unix/Signals.inc:361:31
 #4 0x0000000004340f68 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Support/CrashRecoveryContext.cpp:77:5
 #5 0x00000000043413c5 CrashRecoverySignalHandler(int) /home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Support/CrashRecoveryContext.cpp:383:1
 #6 0x00007fc91e6f8f70 __restore_rt (/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libpthread.so.0+0x12f70)
 #7 0x00007fc91e1f715a raise (/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6+0x3815a)
 #8 0x00007fc91e1e1548 abort (/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6+0x22548)
 #9 0x00007fc91e1e142f _nl_load_domain.cold.0 (/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6+0x2242f)
#10 0x00007fc91e1efad2 (/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-
2.30/lib/libc.so.6+0x30ad2)
#11 0x000000000506d7fe
llvm::DwarfExpression::addFragmentOffset(llvm::DIExpression const*)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfExpression.cpp:605:24
#12 0x00000000050f8713
llvm::DwarfCompileUnit::constructVariableDIEImpl(llvm::DbgVariable const&,
bool) /home/andy/Downloads/llvm-project-11/llvm/build-
debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:742:30
#13 0x00000000050f8064
llvm::DwarfCompileUnit::constructVariableDIE(llvm::DbgVariable&, bool)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:661:36
#14 0x00000000050f8b1e
llvm::DwarfCompileUnit::constructVariableDIE(llvm::DbgVariable&,
llvm::LexicalScope const&, llvm::DIE*&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:790:34
#15 0x00000000050f93ee
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:896:44
#16 0x00000000050f75f8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:516:9
#17 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#18 0x00000000050f75f8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:516:9
#19 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#20 0x00000000050f75f8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:516:9
#21 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#22 0x00000000050f75f8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:516:9
#23 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#24 0x00000000050f75a0
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:502:27
#25 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#26 0x00000000050f75f8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:516:9
#27 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#28 0x00000000050f75a0
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:502:27
#29 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#30 0x00000000050f75f8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:516:9
#31 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#32 0x00000000050f75f8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:516:9
#33 0x00000000050f9645
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) /home/andy/Downloads/llvm-project-
11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:912:3
#34 0x00000000050f9842
llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*,
llvm::DIE&) /home/andy/Downloads/llvm-project-11/llvm/build-
debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:950:46
#35 0x00000000050f972d
llvm::DwarfCompileUnit::constructSubprogramScopeDIE(llvm::DISubprogram const*,
llvm::LexicalScope*) /home/andy/Downloads/llvm-project-11/llvm/build-
debug/../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:928:55
#36 0x000000000502da66 llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction
const*) /home/andy/Downloads/llvm-project-11/llvm/build-
debug/../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2184:64
#37 0x000000000501a2af
llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:325:18
#38 0x0000000004ffe102 llvm::AsmPrinter::emitFunctionBody()
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1296:69
#39 0x0000000002c681c4
llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Target/X86/X86AsmPrinter.cpp:85:16
#40 0x0000000003594afa
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/CodeGen/MachineFunctionPass.cpp:73:33
#41 0x0000000003a8674b llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1516:20
#42 0x0000000003a869b0 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1552:13
#43 0x0000000003a86dda (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&) /home/andy/Downloads/llvm-
project-11/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1617:20
#44 0x0000000003a823d0 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:614:13
#45 0x0000000003a875bf llvm::legacy::PassManager::run(llvm::Module&)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/IR/LegacyPassManager.cpp:1738:1
#46 0x00000000046f824c clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (/home/andy/local/llvm11-
debug/bin/clang-11+0x46f824c)
#47 0x0000000005480593 clang::CodeGenAction::ExecuteAction()
(/home/andy/local/llvm11-debug/bin/clang-11+0x5480593)
#48 0x0000000004cf9949 clang::FrontendAction::Execute()
(/home/andy/local/llvm11-debug/bin/clang-11+0x4cf9949)
#49 0x0000000004cb1c7e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/andy/local/llvm11-debug/bin/clang-11+0x4cb1c7e)
#50 0x0000000004dc9cf0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/andy/local/llvm11-debug/bin/clang-11+0x4dc9cf0)
#51 0x00000000019dc824 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/andy/local/llvm11-debug/bin/clang-11+0x19dc824)
#52 0x00000000019d9a68 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/home/andy/local/llvm11-debug/bin/clang-11+0x19d9a68)
#53 0x0000000004b782e5 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)
(/home/andy/local/llvm11-debug/bin/clang-11+0x4b782e5)
#54 0x00000000043356ca llvm::function_ref<void ()>::operator()() const
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../include/llvm/ADT/STLExtras.h:203:62
#55 0x0000000004341582
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
/home/andy/Downloads/llvm-project-11/llvm/build-debug/../lib/Support/CrashRecoveryContext.cpp:419:10
#56 0x0000000004b78bf3
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) (/home/andy/local/llvm11-
debug/bin/clang-11+0x4b78bf3)
#57 0x0000000004b51915
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/home/andy/local/llvm11-debug/bin/clang-
11+0x4b51915)
#58 0x0000000004b52219
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/home/andy/local/llvm11-debug/bin/clang-11+0x4b52219)
#59 0x0000000004b5aea1
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/home/andy/local/llvm11-debug/bin/clang-11+0x4b5aea1)
#60 0x00000000019d05f8 main (/home/andy/local/llvm11-debug/bin/clang-
11+0x19d05f8)
#61 0x00007fc91e1e2d8b __libc_start_main
(/nix/store/xg6ilb9g9zhi2zg1dpi4zcp288rhnvns-glibc-2.30/lib/libc.so.6+0x23d8b)
#62 0x00000000019d95fa _start /build/glibc-
2.30/csu/../sysdeps/x86_64/start.S:122:0
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0 (git://github.com/llvm/llvm-project
0b56e5490dc33e4e7a4fdd837e642f72a2659189)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/andy/local/llvm11-debug/bin
clang-11: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

(It took a long time, something like 15 minutes before crashing)
Quuxplusone commented 3 years ago
Please see this downstream issue:

https://github.com/ziglang/zig/issues/6408

There is a reduction posted here:

https://github.com/ziglang/zig/issues/6408#issuecomment-789615092

Confirmed this is still happening with LLVM12rc4.
Marking as "confirmed" based on Nikita Popov and LemonBoy's comments in the
thread.