Skip to content

LDC 1.3.x/1.4.x + LLVM 4.0/5.0 results in compiler crashes when building rdeps #2300

@ximion

Description

@ximion

Hi!
We just updated to LDC 1.3.x in Debian a few days ago, which is using LLVM 4 as well now (3.9 was default previously).

While LDC itself built well (bootstrap from scratch), we now get mass build failures in reverse-dependencies of LDC (status being tracked at https://release.debian.org/transitions/html/auto-ldc.html).

See for example the diet-ng build on amd64: https://buildd.debian.org/status/fetch.php?pkg=diet-ng&arch=amd64&ver=1.4.2-1%2Bb1&stamp=1504166958&raw=0

FAILED: diet@sha/source_diet_dom.d.o 
ldc2  -Idiet@sha -I. -I.. -I../source/ -enable-color -O -release -g -relocation-model=pic  -of 'diet@sha/source_diet_dom.d.o' -c ../source/diet/dom.d
0  libLLVM-4.0.so.1 0x00007feb04b47f45 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVM-4.0.so.1 0x00007feb04b461a6 llvm::sys::RunSignalHandlers() + 86
2  libLLVM-4.0.so.1 0x00007feb04b462c3
3  libpthread.so.0  0x00007feb03dae0c0
4  libLLVM-4.0.so.1 0x00007feb050e0a8b
5  libLLVM-4.0.so.1 0x00007feb050e0ec4
6  libLLVM-4.0.so.1 0x00007feb050e27b3 llvm::DbgVariable::getFrameIndexExprs() const + 163
7  libLLVM-4.0.so.1 0x00007feb050daad1 llvm::DwarfCompileUnit::constructVariableDIEImpl(llvm::DbgVariable const&, bool) + 689
8  libLLVM-4.0.so.1 0x00007feb050dae5c llvm::DwarfCompileUnit::constructVariableDIE(llvm::DbgVariable&, bool) + 12
9  libLLVM-4.0.so.1 0x00007feb050dae83 llvm::DwarfCompileUnit::constructVariableDIE(llvm::DbgVariable&, llvm::LexicalScope const&, llvm::DIE*&) + 19
10 libLLVM-4.0.so.1 0x00007feb050de8c1 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 289
11 libLLVM-4.0.so.1 0x00007feb050de541 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 401
12 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
13 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
14 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
15 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
16 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
17 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
18 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
19 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
20 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
21 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
22 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
23 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
24 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
25 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
26 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
27 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
28 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
29 libLLVM-4.0.so.1 0x00007feb050de463 llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&) + 179
30 libLLVM-4.0.so.1 0x00007feb050de922 llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*, llvm::SmallVectorImpl<llvm::DIE*>&, unsigned int*) + 386
31 libLLVM-4.0.so.1 0x00007feb050dea2f llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*, llvm::DIE&) + 47
32 libLLVM-4.0.so.1 0x00007feb050deace llvm::DwarfCompileUnit::constructSubprogramScopeDIE(llvm::DISubprogram const*, llvm::LexicalScope*) + 46
33 libLLVM-4.0.so.1 0x00007feb050ed5e4 llvm::DwarfDebug::endFunction(llvm::MachineFunction const*) + 900
34 libLLVM-4.0.so.1 0x00007feb050bc4b0 llvm::AsmPrinter::EmitFunctionBody() + 3696
35 libLLVM-4.0.so.1 0x00007feb061b727c
36 libLLVM-4.0.so.1 0x00007feb04d89950 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 144
37 libLLVM-4.0.so.1 0x00007feb04c144c8 llvm::FPPassManager::runOnFunction(llvm::Function&) + 600
38 libLLVM-4.0.so.1 0x00007feb04c14513 llvm::FPPassManager::runOnModule(llvm::Module&) + 51
39 libLLVM-4.0.so.1 0x00007feb04c13daf llvm::legacy::PassManagerImpl::run(llvm::Module&) + 767
40 ldc2             0x000055627ecc6e7b
41 ldc2             0x000055627ecc744d
42 ldc2             0x000055627ecc3a63
43 ldc2             0x000055627ecc3ddd
44 ldc2             0x000055627ec9ced9
45 ldc2             0x000055627eb8ea0d
46 ldc2             0x000055627ec9f72a
47 ldc2             0x000055627ecea35f
48 ldc2             0x000055627ecea324
49 ldc2             0x000055627ecea250
50 libc.so.6        0x00007feb031862e1 __libc_start_main + 241
51 ldc2             0x000055627ea447ea
Segmentation fault

As usual, this is annoying to reproduce locally, but I did manage to do that in a pristine amd64 chroot once. To me, it appears like this might actually be a bug in LLVM.
We primarily experience this bug on amd64 and other arches, i386 seems to be safe from it.
Have you seen this with LDC before? I think I can work on generating a better backtrace, probably later next week (or at the weekend if I find the time).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions