www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10016] New: 2.062 -> 2.063 Out of memory using RefCounted

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10016

           Summary: 2.062 -> 2.063 Out of memory using RefCounted
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: henning still-hidden.de



PDT ---
struct RefCounted(T) {
    struct RefCountedStore {
        struct Impl {
            T _payload;
        }
        Impl* _store;
    }
    RefCountedStore _refCounted;

    void opAssign(typeof(this)) { }

    void opAssign(T) { }

     property refCountedPayload() {
        return _refCounted._store._payload;
    }
    alias refCountedPayload this;
}


struct S {
    int i = malloc;
}

class C {
}

class N {
    this(C) {
    }

    C c() {
        return null;
    }
}

class D : N {
    this() {
        super(c);
    }

    RefCounted!S _s;
}

2.063:
-----
Fatal Error: Out of memory
-----

2.062:
-----
main.d(22): Error: undefined identifier malloc
main.d(42): Error: template instance main.RefCounted!(S) error instantiating
-----

DustMite did a good job :]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 30 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10016




PDT ---
You can replace malloc with someRandomUnknownIdentifier.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10016


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull
            Summary|2.062 -> 2.063 Out of       |Incorrect error gagging
                   |memory using RefCounted     |using RefCounted



https://github.com/D-Programming-Language/dmd/pull/1983

With git head(75d3660), "Out of memory" error does not occur. Instead, the OP
code reports no error with -o- switch (different from 2.062), and cause
"Internal error: backend\dt.c 106" with -c switch.

AFAICS this is a front-end issue. the code should report "undefined identifier"
error as same as 2.062, but the error is incorrectly gagged.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10016




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b05f00b820a3385978e1d0e03f75dbf6a06f6783
fix Issue 10016 - Incorrect error gagging using RefCounted

https://github.com/D-Programming-Language/dmd/commit/ba2cf258728ec23ecc216ad156868c3934282bac


[REG2.063a] Issue 10016 - Incorrect error gagging using RefCounted

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 10 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10016




Compiler fix is now merged, and incorrect error gagging issue is fixed.
But, I cannot still confirm that the original "Out of memory" error.

Henning, could you please check your code with git head. If the original issue
is really fixed, close this issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 11 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10016


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



PDT ---
It works now, good job. Reverting your commit leads to Out Of Memory again. But
why do you get an ICE?

I'm on Linux x64.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 11 2013