GG bug? (OS X Lion, DMD 2.054)

Magnus Lie Hetland magnus at hetland.org
Wed Aug 3 07:07:19 PDT 2011


I upgraded from OS X Snow Leopard to Lion recently (on a 32-bit iMac), 
and when I tried to run my D code afterward, I suddenly ran into all 
kinds of interesting problems (lots of failed assertions in my tests, 
and bus errors in my actual runs...). Still cleaning stuff up, but I've 
isolated at least one thing that seems to be a bug, and that wasn't 
there before I upgraded.

Now, I upgraded from DMD 2.052 to 2.054 before doing any extensive 
debugging, so I'm not 100% sure this specific problem was there in 
2.052 as well, but I *think* so (i.e., making the switch to Lion the 
triggering factor).

Anyway, here's some code:

import std.exception, core.memory;

class Foo {
    bool bar;
}

void main() {
    auto f = new Foo;
    f.bar = true;
    //GC.collect();
    enforce(f.bar);
}

Works well, unless you uncomment the GC call, in which case a bus error 
occurs (at least for me). Seems the collector is a bit over-eager...?

-- 
Magnus Lie Hetland
http://hetland.org



More information about the Digitalmars-d-learn mailing list