www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1719] New: Compiler crash or unstable code generation with scoped interface instances

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

           Summary: Compiler crash or unstable code generation with scoped
                    interface instances
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jason.james.house gmail.com


The bottom of this post contains code that reproduces the problem.

It's known to cause issues with the following conditions:
dmd 1.018, windows, tango
dmd 1.023, linux, tango

It's known to not cause issues with the following conditions:
dmd 1.023, linux, phobos
dmd 1.024, ???, phobos
gdc 0.24, linux, tango
gdc 0.24, linux-64, phobos

It looks to be specific to the combination of dmd and tango.  It has not been
tested with dmd 2.x.


////////////////////////////////////////////
//   CODE
////////////////////////////////////////////
version=crash;
//version=work1;
//version=work2;
//version=work3;

interface I{
}

class C : public I{
}

unittest{
        version(crash) scope I def = new C;
        version(work1) scope C def = new C;
        version(work2)       I def = new C;
        version(work3)       C def = new C;
}

int main(){
        return 0;
}


-- 
Dec 09 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1719






-------
Works fine for me with DMD 1.024 on Windows, with both Phobos and Tango.


-- 
Dec 09 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1719






Odd.  This crashes for me with DMD 1.024 and DMD 2.008 on Win32 using both
Phobos and Tango.  The crash occurs when I try to step into the unit test
routine for the module in question (using ddbg), but the ModuleInfo object is
valid.


-- 
Dec 10 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1719






-------
Alright, forget what I said. I completely missed the fact that the code is in a
unittest block.

Compiling with -unittest, I get an Access Violation with Phobos and an outright
crash with Tango.


-- 
Dec 11 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1719






The problem is interfaces cannot be deleted. To work around:

scope c = new C();
I def = c;


-- 
Jan 20 2008
prev sibling next sibling parent reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1719


larsivar igesund.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |larsivar igesund.net





Do you consider it a bug that the interface isn't deletable? Such that this
entry should be kept open?


-- 
Jan 22 2008
parent Lars Ivar Igesund <larsivar igesund.net> writes:
 

 Do you consider it a bug that the interface isn't deletable? Such that
 this entry should be kept open?
 
 
 --
Never mind, I suppose Walter would close it if he found it invalid.
Jan 22 2008
prev sibling parent reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1719


bugzilla digitalmars.com changed:

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





Fixed dmd 1.026 and 2.010


-- 
Feb 16 2008
parent Lars Ivar Igesund <larsivar igesund.net> writes:
d-bugmail puremagic.com wrote:

 http://d.puremagic.com/issues/show_bug.cgi?id=1719
 
 
 bugzilla digitalmars.com changed:
 
            What    |Removed                     |Added
 ----------------------------------------------------------------------------
              Status|NEW                         |RESOLVED
          Resolution|                            |FIXED
 
 
 
 

 Fixed dmd 1.026 and 2.010
 
 
 --
I don't consider the error in 1.026. What seems to be the fix in 1.027 should do it however. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Feb 16 2008