Are you using -m64 on windows? 32-bit OSes are well known for having memory leaks due to false pointers.
Comment #2 by temtaime — 2017-11-22T16:07:21Z
Yes.
Also there's NO_SCAN attribute so there should not be any.
Comment #3 by schveiguy — 2017-11-22T16:25:11Z
There's nothing different on Windows vs. Linux with regards to the AA implementation. Both are abstracted against the GC.
So if this is 64-bit windows, the only attribute I can think of to associate with this behavior is the numbers the OS assigns to stacks/heaps happen to coincide with the pointers that are there.
(In reply to Temtaime from comment #2)
> Also there's NO_SCAN attribute so there should not be any.
Doesn't matter. The stack is not NO_SCAN, and the AA bucket elements are not NO_SCAN. What you are doing is making large targets (13MB targets) that these false pointers may hook onto.
The nature of false pointers is that in certain situations, they happen, and changing seemingly random things can affect it. Not sure if we will get to the bottom of this, or even solve it.
The behavior varies across platforms because it very much depends on the actual addresses returned by the OS for allocating memory: linux prefers addresses at the top of the possible addressrange (2^^47) while windows uses returns low addresses above a couple GB (but not reproducable due to randomization). OSX is even worse as it starts with very addresses.
In the reporte example, a wide range of low addresses are written into the (key,value) pairs of an AA. As the key is a string, it contains indirections that need to be scanned, i.e. the full allocation is scanned by a conservative GC.
Precise GC to the rescue: when calling the build with "--DRT-gcopt=gc:precise --DRT-scanDataSeg=precise" as of dmd2.085, even for win32 it behaves as the linux build.
I guess this is the best we can do, so closing...