Thread overview
[Issue 1719] New: Compiler crash or unstable code generation with scoped interface instances
Dec 09, 2007
d-bugmail
Dec 09, 2007
d-bugmail
Dec 10, 2007
d-bugmail
Dec 11, 2007
d-bugmail
Jan 20, 2008
d-bugmail
Jan 22, 2008
d-bugmail
Jan 22, 2008
Lars Ivar Igesund
Feb 16, 2008
d-bugmail
Feb 16, 2008
Lars Ivar Igesund
December 09, 2007
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;
}


-- 

December 09, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1719





------- Comment #1 from matti.niemenmaa+dbugzilla@iki.fi  2007-12-09 11:41 -------
Works fine for me with DMD 1.024 on Windows, with both Phobos and Tango.


-- 

December 10, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1719





------- Comment #2 from sean@f4.ca  2007-12-10 13:33 -------
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.


-- 

December 11, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1719





------- Comment #3 from matti.niemenmaa+dbugzilla@iki.fi  2007-12-11 03:42 -------
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.


-- 

January 20, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1719





------- Comment #4 from bugzilla@digitalmars.com  2008-01-20 02:13 -------
The problem is interfaces cannot be deleted. To work around:

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


-- 

January 22, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1719


larsivar@igesund.net changed:

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




------- Comment #5 from larsivar@igesund.net  2008-01-22 17:14 -------
Do you consider it a bug that the interface isn't deletable? Such that this entry should be kept open?


-- 

January 22, 2008
> 
> ------- Comment #5 from larsivar@igesund.net  2008-01-22 17:14 -------
> 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.
February 16, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1719


bugzilla@digitalmars.com changed:

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




------- Comment #7 from bugzilla@digitalmars.com  2008-02-16 06:03 -------
Fixed dmd 1.026 and 2.010


-- 

February 16, 2008
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
> 
> 
> 
> 
> ------- Comment #7 from bugzilla@digitalmars.com  2008-02-16 06:03 -------
> 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