www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Hidden module c'tors/d'tors?

reply dsimcha <dsimcha yahoo.com> writes:
I'm getting annoying runtime errors about "Cycle detected between modules with
ctors/dtors" in a large program that doesn't have any module c'tors/d'tors, at
least not explicitly.  (i.e. there's no static this or static ~this in the
whole project, not counting the libs it imports).  Is there any way a module
c'tor/d'tor could be hidden, such that there is one even if there's no actual
static this statement?
Aug 15 2011
parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Mon, 15 Aug 2011 17:04:07 -0400, dsimcha <dsimcha yahoo.com> wrote:

 I'm getting annoying runtime errors about "Cycle detected between  
 modules with
 ctors/dtors" in a large program that doesn't have any module  
 c'tors/d'tors, at
 least not explicitly.  (i.e. there's no static this or static ~this in  
 the
 whole project, not counting the libs it imports).  Is there any way a  
 module
 c'tor/d'tor could be hidden, such that there is one even if there's no  
 actual
 static this statement?
From what I understand of how the compiler works, such ctor/dtors are put into compiler-generated modules marked as "standalone", meaning they should be ignored in terms of cycle detection (even though they *do* have ctor/dtors). Do you have an example? It may be a bug in the compiler/cycle detection algorithm. -Steve
Aug 15 2011
parent reply dsimcha <dsimcha yahoo.com> writes:
== Quote from Steven Schveighoffer (schveiguy yahoo.com)'s article
 Do you have an example? It may be a bug in the compiler/cycle detection
 algorithm.
 -Steve
Haven't reduced it yet, am hoping not to have to.
Aug 15 2011
parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Mon, 15 Aug 2011 17:46:52 -0400, dsimcha <dsimcha yahoo.com> wrote:

 == Quote from Steven Schveighoffer (schveiguy yahoo.com)'s article
 Do you have an example? It may be a bug in the compiler/cycle detection
 algorithm.
 -Steve
Haven't reduced it yet, am hoping not to have to.
Can you at least give the modules that are supposedly included in the cycle, but shouldn't have any ctor/dtors? The new cycle detection code should print a detailed description of where the cycle is. -Steve
Aug 16 2011
parent dsimcha <dsimcha yahoo.com> writes:
On 8/16/2011 7:19 AM, Steven Schveighoffer wrote:
 On Mon, 15 Aug 2011 17:46:52 -0400, dsimcha <dsimcha yahoo.com> wrote:

 == Quote from Steven Schveighoffer (schveiguy yahoo.com)'s article
 Do you have an example? It may be a bug in the compiler/cycle detection
 algorithm.
 -Steve
Haven't reduced it yet, am hoping not to have to.
Can you at least give the modules that are supposedly included in the cycle, but shouldn't have any ctor/dtors? The new cycle detection code should print a detailed description of where the cycle is. -Steve
They're modules in a decent sized program, not publicly available code. I was running into some extremely weird errors besides this on the machine I was working on. I'm thinking that my entire build process might have somehow been misconfigured. When I posted this I was hoping that I was missing something silly and obvious, but apparently not. If I keep running into this then I will take the time to reduce it.
Aug 16 2011