ldc-developers / ldc

The LLVM-based D Compiler.
http://wiki.dlang.org/LDC
Other
1.19k stars 258 forks source link

Crash when importing sub-submodules #2018

Open ximion opened 7 years ago

ximion commented 7 years ago

As soon as one imports a module with a nesting level of 2 or higher (import aaa.bbb) with a package.d file at the root, LDC crashes.

0  libLLVM-3.9.so.1      0x00007fda9e707125 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVM-3.9.so.1      0x00007fda9e7052de llvm::sys::RunSignalHandlers() + 62
2  libLLVM-3.9.so.1      0x00007fda9e705402
3  libpthread.so.0       0x00007fda9d7be0c0
4  ldc2                  0x000056124cca9956
5  ldc2                  0x000056124cde6635
6  ldc2                  0x000056124cc6d994
7  ldc2                  0x000056124cca9a9c
8  ldc2                  0x000056124cc6d994
9  ldc2                  0x000056124cd0ed8e
10 ldc2                  0x000056124ce82081
11 libdruntime-ldc.so.71 0x00007fda9cca1e3f _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv + 15
12 libdruntime-ldc.so.71 0x00007fda9cca1d84 _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv + 20
13 libdruntime-ldc.so.71 0x00007fda9cca1cad _d_run_main + 477
14 libc.so.6             0x00007fda9bfdf2b1 __libc_start_main + 241
15 ldc2                  0x000056124cc6c39a
Segmentation fault

LDC Version:

LDC - the LLVM D compiler (1.1.0):
  based on DMD v2.071.2 and LLVM 3.9.1
  built with LDC - the LLVM D compiler (1.1.0)
  Default target: x86_64-pc-linux-gnu
  Host CPU: haswell
  http://dlang.org - http://wiki.dlang.org/LDC

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    armeb      - ARM (big endian)
    bpf        - BPF (host endian)
    bpfeb      - BPF (big endian)
    bpfel      - BPF (little endian)
    hexagon    - Hexagon
    mips       - Mips
    mips64     - Mips64 [experimental]
    mips64el   - Mips64el [experimental]
    mipsel     - Mipsel
    msp430     - MSP430 [experimental]
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    sparc      - Sparc
    sparcel    - Sparc LE
    sparcv9    - Sparc V9
    systemz    - SystemZ
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64
    xcore      - XCore

It's understood the easiest by an example: module-crash.tar.gz

ximion commented 7 years ago

Meh, Github doesn't let me attach files... EDIT: Attached the previously linked file to the bugreport.

JohanEngelen commented 7 years ago

@ximion Especially if the files are small, it is easier for us if you paste them here.

kinke commented 7 years ago

This is a front-end issue, DMD 2.073.1 segfaults too. @ximion: Please file an upstream issue.