www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 861] New: Using two typedefs of an undefined name in a class in a different module with import cycles causes DMD to hang

reply d-bugmail puremagic.com writes:
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).


-- 
Jan 20 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=861


bugzilla digitalmars.com changed:

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





Works in DMD 1.004.


-- 
Jan 31 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=861


deewiant gmail.com changed:

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





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


-- 
Feb 01 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=861






It doesn't hang when I try it. It works fine. Are you *sure* you're using
1.004?


-- 
Feb 01 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=861






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)


-- 
Feb 01 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=861


thomas-dloop kuehne.cn changed:

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





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


-- 
Feb 15 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=861


deewiant gmail.com changed:

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





Seems to work in DMD 1.010.


-- 
Apr 08 2007