Skip to content

[Bug] dmd -H app.d fails with debug import; on Windows 11 and WSL2 Ubuntu #22342

@lempiji

Description

@lempiji

Overview

When compiling the minimal reproduction code below, dmd fails with return code 1 on Windows 11 and with exit code 11 (segmentation fault) on Ubuntu via WSL2. In both environments, I expect a .di file to be generated, but it is not. No error message is displayed.

Minimal Reproduction Code

app. d:

debug import core.stdc.stdio;

void main() { }

Command:

dmd -H app.d

Additional Investigation

  • Removing the debug keyword allows compilation to succeed and produces a .di file.
  • The same behavior is reproducible with other import statements (e.g. debug import std.algorithm.searching;), while regular import works as expected.
  • This issue can be reproduced when using dub to reference the "during" library, because the problematic code is written inside the source code of the "during" library.

Expected Result

  • A .di file should be generated correctly

Actual Result

  • Windows 11: Return code 1, no error message
  • WSL2 Ubuntu: exit code 11 (segmentation fault), no error message
  • No .di file is produced in either case

Environment

  • OS: Windows 11, WSL2 Ubuntu
  • dmd version: v2.111.0
  • dmd --version output:
    DMD64 D Compiler v2.111.0
    Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved written by Walter Bright
    

Other Notes

  • No error message is displayed

Please review and advise on possible solutions or fixes.

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