www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DMD failed with exit code -1073741819

reply jmh530 <john.michael.hall gmail.com> writes:
I made some changes to some code I'm working on and now there are 
some lines that are giving me funky DMD error codes (I can tell 
it is some lines because I comment them out and the errors go 
away). So for instance, one line I have a static assert that 
gives an error code -1073741819, but if I split it up into two 
pieces (so that part of it is assigned to a value and then I use 
typeof that value in the static assert), then DMD does not 
complain. Does anyone have any idea what causes these types of 
errors?

I was leaning towards it being something related to running out 
of memory or something, but I'm using dub and I've tried turning 
on and off "lowmem".

I also have used -v both in dflags and at the command line and 
haven't noticed any obvious errors.
May 03 2022
next sibling parent Anonymouse <zorael gmail.com> writes:
On Tuesday, 3 May 2022 at 18:22:49 UTC, jmh530 wrote:
 I was leaning towards it being something related to running out 
 of memory or something, but I'm using dub and I've tried 
 turning on and off "lowmem".
Note that dub cannot pass -lowmem to dmd. https://issues.dlang.org/show_bug.cgi?id=20699
May 03 2022
prev sibling parent reply Dennis <dkorpel gmail.com> writes:
On Tuesday, 3 May 2022 at 18:22:49 UTC, jmh530 wrote:
 Does anyone have any idea what causes these types of errors?
Sounds like a stack overflow, maybe your code has a complex/recursive part that makes DMD's call stack very deep.
May 03 2022
parent jmh530 <john.michael.hall gmail.com> writes:
On Tuesday, 3 May 2022 at 19:03:56 UTC, Dennis wrote:
 On Tuesday, 3 May 2022 at 18:22:49 UTC, jmh530 wrote:
 Does anyone have any idea what causes these types of errors?
Sounds like a stack overflow, maybe your code has a complex/recursive part that makes DMD's call stack very deep.
Thanks. I think this was it. I figured it out, but it took a bit of time to identify where the problem was coming from... Basically, I started out with a template like ```d template foo(T, U u = val, V, W) {} ``` and refactored it to ```d template foo(T, U u = val, V, W, U y = u) {} ``` which is when I started getting the problem, but I had changed a bunch of other stuff to introduce `y`, so it wasn't entirely clear why that would cause the problems. Anyway, changing it to ```d template foo(T, U u = val, V, W, U y = val) {} ``` made the problem went away.
May 03 2022