Thread overview
[Issue 861] New: Using two typedefs of an undefined name in a class in a different module with import cycles causes DMD to hang
Jan 20, 2007
d-bugmail
Jan 31, 2007
d-bugmail
Feb 01, 2007
d-bugmail
Feb 01, 2007
d-bugmail
Feb 01, 2007
d-bugmail
Feb 15, 2007
d-bugmail
Apr 08, 2007
d-bugmail
January 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=861

           Summary: Using two typedefs of an undefined name in a class in a
                    different module with import cycles causes DMD to hang
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: deewiant@gmail.com


Like Issue 860, this bug is hard to summarize. Essentially, the problem is that compiling the definesType module, below, causes DMD to hang with 100% CPU usage.

--
module definesType;

import usesType; // import cycle

//alias int NONEXISTENT_NAME;
//typedef int NONEXISTENT_NAME;

typedef NONEXISTENT_NAME
        myTypedef,
        myTypedef2;
--
module usesType;

import definesType;

// must be class, not struct or template
class UsesTypedefs {
        // can be anything as long as both typedefs are used
        myTypedef usesTypedef;
        myTypedef2 usesTypedef2;
}
--

Uncommenting either the alias or the typedef (or even both) doesn't affect the
bug in any way (this may have something to do with Issue 860).


-- 

January 31, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=861


bugzilla@digitalmars.com changed:

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




------- Comment #1 from bugzilla@digitalmars.com  2007-01-31 15:00 -------
Works in DMD 1.004.


-- 

February 01, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=861


deewiant@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |




------- Comment #2 from deewiant@gmail.com  2007-02-01 12:12 -------
Still fails for me with 1.004. "dmd -c definesType.d" leads to a DMD hang.

Any idea of what could be causing it? With -v, dmd outputs the following before hanging:

parse     definesType
semantic  definesType
import    object
import    usesType


-- 

February 01, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=861





------- Comment #3 from bugzilla@digitalmars.com  2007-02-01 13:07 -------
It doesn't hang when I try it. It works fine. Are you *sure* you're using 1.004?


-- 

February 01, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=861





------- Comment #4 from digitalmars-com@baysmith.com  2007-02-01 17:17 -------
I can confirm that definesType.d hangs DMD 1.004

C:\>dmd -c definesType.d
(Killed dmd.exe)
C:\>dmd
Digital Mars D Compiler v1.004
Copyright (c) 1999-2007 by Digital Mars written by Walter Bright
Documentation: www.digitalmars.com/d/index.html
(removed for brevity)


-- 

February 15, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=861


thomas-dloop@kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #5 from thomas-dloop@kuehne.cn  2007-02-15 03:42 -------
Added to DStress as http://dstress.kuehne.cn/nocompile/i/import_18_A.d http://dstress.kuehne.cn/nocompile/i/import_18_B.d http://dstress.kuehne.cn/nocompile/i/import_18_C.d http://dstress.kuehne.cn/nocompile/i/import_18_D.d


-- 

April 08, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=861


deewiant@gmail.com changed:

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




------- Comment #6 from deewiant@gmail.com  2007-04-08 12:03 -------
Seems to work in DMD 1.010.


--