[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2021-02-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |LATER

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2021-01-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #13 from JR  ---
I may have come across as unappreciative, which was not my intention.

(In reply to Mathias LANG from comment #11)
> But it's a structural problem that needs to be addressed, and for the time
> being the best way to deal with it is to throw `-lowmem` in your dmd.conf.
> 
> How does that sound ?

Right now I am unable to reproduce the error (2.095), but I only did a casual
test. Regardless, please close this if the issue is known and having an open
bug report about it only amounts to noise.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2021-01-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #12 from JR  ---
(In reply to Mathias LANG from comment #11)
> I'm tempted to close this, as `OutOfMemoryError` cannot be reliably bisected
> and there's no "action point" here.
> 
> Don't get me wrong, the compiler IS using too much memory, and it IS
> absolutely a problem (I run into it every week at least).
> 
> But it's a structural problem that needs to be addressed, and for the time
> being the best way to deal with it is to throw `-lowmem` in your dmd.conf.
> 
> How does that sound ?

Yes, I can solve it for myself that way, but it becomes somewhat of a barrier
of entry to ask users to please change their global settings to be able to
compile my project.

Is https://issues.dlang.org/show_bug.cgi?id=20699 very difficult to solve? I
already set up build configurations like `application-lowmem` for the purpose,
they just effectively don't do anything yet.

Can a dmd.conf in the working directory append to DFLAGS from the system-wide
/etc/dmd.conf? Instead of overriding?

> DFLAGS+="-lowmem"

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2021-01-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

Mathias LANG  changed:

   What|Removed |Added

 CC||pro.mathias.l...@gmail.com

--- Comment #11 from Mathias LANG  ---
I'm tempted to close this, as `OutOfMemoryError` cannot be reliably bisected
and there's no "action point" here.

Don't get me wrong, the compiler IS using too much memory, and it IS absolutely
a problem (I run into it every week at least).

But it's a structural problem that needs to be addressed, and for the time
being the best way to deal with it is to throw `-lowmem` in your dmd.conf.

How does that sound ?

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-03-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

Mr. Smith  changed:

   What|Removed |Added

 CC||mrsmit...@yandex.ru

--- Comment #10 from Mr. Smith  ---
Similar issue:

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

0x0063C06E in onOutOfMemoryError
0x005A50F3 in Mem at C:\Users\vagrant\clones\dmd\src\dmd\root\rmem.d(134)
0x005A5072 in Mem at C:\Users\vagrant\clones\dmd\src\dmd\root\rmem.d(99)
0x005A3775 in OutBuffer at
C:\Users\vagrant\clones\dmd\src\dmd\root\outbuffer.d(82)
0x004F7A0A in void
dmd.libmscoff.LibMSCoff.WriteLibToBuffer(dmd.root.outbuffer.OutBuffer*) at
C:\Users\vagrant\clones\dmd\src\dmd\libmscoff.d(457)
0x004D8D14 in void dmd.lib.Library.write() at
C:\Users\vagrant\clones\dmd\src\dmd\lib.d(106)
0x004FDCF2 in int dmd.mars.tryMain(uint, const(char)**, ref dmd.globals.Param)
at C:\Users\vagrant\clones\dmd\src\dmd\mars.d(728)
0x004FE54E in _Dmain at C:\Users\vagrant\clones\dmd\src\dmd\mars.d(944)
0x0063E7EB in void rt.dmain2._d_run_main2(char[][], uint, extern (C) int
function(char[][])*).runAll().__lambda1()
0x0063E765 in void rt.dmain2._d_run_main2(char[][], uint, extern (C) int
function(char[][])*).runAll()0x0063E600 in _d_run_main2
0x0063B21A in _d_run_main
0x004FE4F5 in main at C:\Users\vagrant\clones\dmd\src\dmd\mars.d(893)
0x0065FCF1 in mainCRTStartup

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #9 from JR  ---
(In reply to Jonathan Marler from comment #8)
> JR how did you do your git bisect?  What command were you using to build dmd?

I used digger to automate the bisection. I might add that I started all this
with trying to make a minimal test case using dustmite, but after a while it
gets reduced to a vague state that sometimes compiles, sometimes doesn't.

The test expression I used to bisect was the build command that `dub build -v`
printed, grepped for "Memory allocation failed". I needed to invert the result
for digger (a success should be when the string was not detected), so I
couldn't just leave it as a normal command and had to make a batch script. I
don't know Windows so it may be a roundabout way of doing it, but it works.

With my repo cloned into C:\Temp\kameloso, then with a C:\Temp\bisect.bat test
script looking like the following: (necessitates having run `dub build` at
least once to fetch and build the dependencies)

```
@echo off
cd \Temp\kameloso

dmd -dip25 -dip1008 -m64 -c -ofk -debug -g -w -d -version=WithAdminPlugin
-version=WithAutomodePlugin -version=WithBashQuotesPlugin
-version=WithChanQueriesService -version=WithChatbotPlugin
-version=WithConnectService -version=WithCTCPService -version=WithHelpPlugin
-version=WithNotesPlugin -version=WithOnelinersPlugin
-version=WithPersistenceService -version=WithPipelinePlugin
-version=WithPrinterPlugin -version=WithQuotesPlugin
-version=WithSedReplacePlugin -version=WithSeenPlugin
-version=WithWebtitlesPlugin -version=WithPlugins -version=Have_kameloso
-version=Have_dialect -version=Have_lu -version=FlagAsUpdated
-version=Have_lu_core -version=Have_lu_meld -Isource
-IC:\Users\zorael\AppData\Local\dub\packages\dialect-0.3.2\dialect\source
-IC:\Users\zorael\AppData\Local\dub\packages\lu-0.1.2\lu\source
-IC:\Users\zorael\AppData\Local\dub\packages\lu-0.1.2\lu\source
source\kameloso\common.d source\kameloso\constants.d
source\kameloso\debugging.d source\kameloso\getopt.d
source\kameloso\irccolours.d source\kameloso\kameloso.d
source\kameloso\logger.d source\kameloso\main.d source\kameloso\messaging.d
source\kameloso\plugins\admin.d source\kameloso\plugins\automode.d
source\kameloso\plugins\bashquotes.d source\kameloso\plugins\chanqueries.d
source\kameloso\plugins\chatbot.d source\kameloso\plugins\common.d
source\kameloso\plugins\connect.d source\kameloso\plugins\ctcp.d
source\kameloso\plugins\hello.d source\kameloso\plugins\help.d
source\kameloso\plugins\notes.d source\kameloso\plugins\oneliners.d
source\kameloso\plugins\package.d source\kameloso\plugins\persistence.d
source\kameloso\plugins\pipeline.d source\kameloso\plugins\printer.d
source\kameloso\plugins\quotes.d source\kameloso\plugins\sedreplace.d
source\kameloso\plugins\seen.d source\kameloso\plugins\twitchbot.d
source\kameloso\plugins\webtitles.d source\kameloso\printing.d
source\kameloso\terminal.d source\kameloso\thread.d source\kameloso\traits.d
-vcolumns 2>&1 | findstr /C:"Memory allocation failed"

if %ERRORLEVEL% EQU 0 (exit /b 1) else (exit /b 0)
```

I set up a digger bisect.ini looking like the following:

```
good = master@v2.087.1
bad = master@v2.089.1
reverse = false
tester = C:\Temp\bisect.bat
```

Then I set it off with `dub run digger -- bisect bisect.ini`.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

Jonathan Marler  changed:

   What|Removed |Added

 CC||johnnymar...@gmail.com

--- Comment #8 from Jonathan Marler  ---
JR how did you do your git bisect?  What command were you using to build dmd?

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #7 from JR  ---
(In reply to Seb from comment #6)
> This probably doesn't help you, but as it's easy to test:
> Did you try this with 2.090 as well? There was a regression with the change
> to build.d that omitted the -O flag on Windows. This has been addressed
> since.

I hadn't, so I tested it now with current master
(v2.090.0-beta.1-118-g8fc81f40d) and I get the same results. Further I tried a
64-bit compiler (with digger build --model=64), and it runs out of memory too.

I've also retried the bisection several times hoping it would land on a
different commit, but I get the same one. I even made the tester script test
each build three times so as to not miss something due to transient successes.

The only thing that works so far is to copy/paste the build command `dub build
-v` prints and run it with -lowmem added. Curiously dub with -lowmem DFLAGS
does not seem to work. Manually calling dmd with the same command does.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

Seb  changed:

   What|Removed |Added

 CC||greeen...@gmail.com

--- Comment #6 from Seb  ---
This probably doesn't help you, but as it's easy to test:
Did you try this with 2.090 as well? There was a regression with the change to
build.d that omitted the -O flag on Windows. This has been addressed since.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #5 from JR  ---
Ignore that, it does seem to be doing something now. It still runs out of
memory though, will experiment.

Apologies for the noise.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #4 from JR  ---
(In reply to moonlightsentinel from comment #3)
> > I see. Is there a point in retrying the bisection?
> 
> Maybe if you could exactly identify a change that increased the memory
> consumption *a lot*. Then we could try to improve that specific segement to
> use less memory. But I would expect it to be a more gradual increase
> scattered over many small changes.
> 
> > -lowmem works and I want to use it, but it doesn't work with dub, which I 
> > rely on for dependencies
> 
> Not a dub expert but you could add -lowmem using the dflags configuration in
> dub.(json|sdl) IIRC.

This was one of the topics of
https://forum.dlang.org/post/ycfikiktizuifuisx...@forum.dlang.org; even if
defined in dflags dub doesn't pass -lowmem to dmd. The flag is silently
ignored.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #3 from moonlightsenti...@disroot.org ---
> I see. Is there a point in retrying the bisection?

Maybe if you could exactly identify a change that increased the memory
consumption *a lot*. Then we could try to improve that specific segement to use
less memory. But I would expect it to be a more gradual increase scattered over
many small changes.

> -lowmem works and I want to use it, but it doesn't work with dub, which I 
> rely on for dependencies

Not a dub expert but you could add -lowmem using the dflags configuration in
dub.(json|sdl) IIRC.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

--- Comment #2 from JR  ---
(In reply to moonlightsentinel from comment #1)
> That linker parameter was already present in win32.mak, the PR just moved it
> to build.d. That bisection seems like a false positive.
> 
> An OutOfMemoryError usually signals a failure when allocating  memory> - not stack memory. Did you try to compile your project using
> -lowmem (which enables the GC for DMD)?

I see. Is there a point in retrying the bisection?

-lowmem works and I want to use it, but it doesn't work with dub, which I rely
on for dependencies.
https://forum.dlang.org/post/ycfikiktizuifuisx...@forum.dlang.org seems
promising but it's still some time before it will be in a downloadable release.

--


[Issue 20562] [dmd] Memory allocation failed (ERROR: This is a compiler bug)

2020-02-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20562

moonlightsenti...@disroot.org changed:

   What|Removed |Added

 CC||moonlightsentinel@disroot.o
   ||rg

--- Comment #1 from moonlightsenti...@disroot.org ---
That linker parameter was already present in win32.mak, the PR just moved it to
build.d. That bisection seems like a false positive.

An OutOfMemoryError usually signals a failure when allocating 
- not stack memory. Did you try to compile your project using -lowmem (which
enables the GC for DMD)?

--