Any guides on debugging DMD crash?

Arine arine123445128843 at gmail.com
Mon Mar 23 00:17:48 UTC 2020


On Sunday, 22 March 2020 at 22:33:13 UTC, Matt Jones wrote:
> Does anyone have a guide on how to debug DMD crashes? I've been 
> getting compiler crashes on version 2.087.1 through 2.091.0 
> (only release mode on both Windows 10 and Linux). Version 
> 2.086.1 was the last one that worked:
>
> dub run --arch=x86_64 --build=release
>
> C:\D\dmd2\windows\bin\dmd.exe failed with exit code -1073741795.
>
> Here is the smallest code snippet I could make crash: 
> https://github.com/workhorsy/crash_dmd

Since it crashes when you do a release build, this is most likely 
a bug in the backend. DMD's backend is known to have a lot of 
issues and they don't tend to be fixed as there's only a few 
people that actually work on it. Even if someone outside of the 
main D team fixes the bug, the fix won't get merged in for 
release as those same individuals don't bother to review those 
pull requests.

You'll probably have better luck using LDC2, which has a tried 
and proven backend LLVM. It doesn't compile as fast, but I find 
the few seconds is worth the trade off of not having to deal with 
as many compiler bugs like the one you've found here.

https://github.com/ldc-developers/ldc#installation


More information about the Digitalmars-d mailing list