Thread overview
Bug on windows DMD v2.0.90.1 ?
Apr 03, 2020
Luis
Apr 03, 2020
John Colvin
Apr 03, 2020
Luis
Apr 03, 2020
Rainer Schuetze
April 03, 2020
Hi,

I'm trying to help with Pegged and I setup a CI testing with travis and appveyor (so, we can see when a pull request breaks Pegged). There was a error with excessive ram usage on Pegged that was fixed (from dub test using nearly 4GiB of RAM to ~600MiB), that perhaps is related to this issue

So we are puzzled why dmd v2.090.1 on Windows, keeps falling. I doubled checked that with v2.091.0, both on 32bit and 64 bit versions, compiles fine. Sadly I don't know how measure the RAM usage of DMD as there isn't a equivalent of "time -v" on powershell. The appveyor VM looks that haves only 4GiB of RAM.

The error, sometimes throws this :

core.exception.OutOfMemoryError@src\core\exception.d(647): Memory allocation failed

Other times simply shows a "Error: out of memory"

And other times shows this :

object.Error@(0): Access Violation
----------------
0x0065D21A
0x0062CFF9
0x0062CEC9
0x0058A115
0x005B9BA6
0x005B9681
0x0055F831
0x0056C319
0x004BBED9
0x0056D20C
0x004635A9
0x0056D1F2
0x004858F5
0x0056C2A7
0x0055DFBC
0x004FDBB5
0x004FE54E
0x0063E7EB
0x0063E765
0x0063E600
0x0063B21A
0x004FE4F5
0x0065FCF1
0x755F0419
0x7713662D
0x771365FD
dmd failed with exit code 1.

Links to appveyor failed executions :

https://ci.appveyor.com/project/PhilippeSigaud/pegged/build/job/a7ucqi8cc8khw8kg
https://ci.appveyor.com/project/PhilippeSigaud/pegged/builds/31915269/job/a4i9oubvt18squlu
https://ci.appveyor.com/project/PhilippeSigaud/pegged/builds/31911420/job/6nfl8v7crnr1abvw

April 03, 2020
On Friday, 3 April 2020 at 07:56:23 UTC, Luis wrote:
> So we are puzzled why dmd v2.090.1 on Windows, keeps falling. I doubled checked that with v2.091.0, both on 32bit and 64 bit versions, compiles fine. Sadly I don't know how measure the RAM usage of DMD as there isn't a equivalent of "time -v" on powershell. The appveyor VM looks that haves only 4GiB of RAM.
>
> The error, sometimes throws this :
>
> core.exception.OutOfMemoryError@src\core\exception.d(647): Memory allocation failed
>
> Other times simply shows a "Error: out of memory"
>
> And other times shows this :
>
> object.Error@(0): Access Violation


I don't have any particular insights to add other than to say that we have had similar problems with Windows and recent DMD releases. It's very hard to reduce. We had no problems with dmd 2.087.1, but when we were trying to update to any compiler after that we had to switch one build to use ldc instead to avoid this problem. Pegged was not involved in this build.
April 03, 2020
On Friday, 3 April 2020 at 09:03:17 UTC, John Colvin wrote:
> I don't have any particular insights to add other than to say that we have had similar problems with Windows and recent DMD releases. It's very hard to reduce. We had no problems with dmd 2.087.1, but when we were trying to update to any compiler after that we had to switch one build to use ldc instead to avoid this problem. Pegged was not involved in this build.

Indeed, I did some tweaks (and fixed to use latest dub version), and only fails with dmd 2.090.1 . With 2.087.1 works fine.

https://ci.appveyor.com/project/PhilippeSigaud/pegged/builds/31937080


April 03, 2020
On 4/3/20 3:56 AM, Luis wrote:
> The error, sometimes throws this :
> 
> core.exception.OutOfMemoryError@src\core\exception.d(647): Memory allocation failed
> 
> Other times simply shows a "Error: out of memory"
> 
> And other times shows this :
> 
> object.Error@(0): Access Violation

Those are all consistent with my experience when running out of memory. The error that occurs can either be a segfault, a memory allocation exception or (on Linux) "Killed" (by the OOM killer).

I think the difference between the exception and the access violation is that there may be some cases in the compiler where it doesn't check to see if memory allocation succeeds.

-Steve
April 03, 2020

On 03/04/2020 09:56, Luis wrote:
> Hi,
> 
> I'm trying to help with Pegged and I setup a CI testing with travis and appveyor (so, we can see when a pull request breaks Pegged). There was a error with excessive ram usage on Pegged that was fixed (from dub test using nearly 4GiB of RAM to ~600MiB), that perhaps is related to this issue
> 
> So we are puzzled why dmd v2.090.1 on Windows, keeps falling. I doubled checked that with v2.091.0, both on 32bit and 64 bit versions, compiles fine. Sadly I don't know how measure the RAM usage of DMD as there isn't a equivalent of "time -v" on powershell. The appveyor VM looks that haves only 4GiB of RAM.
> 
> The error, sometimes throws this :
> 
> core.exception.OutOfMemoryError@src\core\exception.d(647): Memory
> allocation failed
> 
> Other times simply shows a "Error: out of memory"

The out-of-memory error happens because the build uses almost 2 GB of memory (from observing execution in the process explorer). Unfortunately, dmd versions 2.089.x and 2.090.x were no longer built with the LARGE_ADDRESS_AWARE bit set, which causes the OS to limit the 32-bit process to 2 GB for legacy reasons, instead of the theoretically possible 4 GB.

This bit was reenabled automatically when switching to LDC and the MS linker as host compiler for dmd 2.091.