The following crashes on Windows 7 sp1 64-bit edition when build at 64 bits with dmd and the Microsoft linker that comes with Windows SDK 7.1 (i.e. MSVC 2010 linker). I've had no trouble with other D code when using that arrangement, though I have not used threads. When built at 32 bits with dmd and optlink it runs fine.
==============
import core.thread, std.stdio;

void main() {
    writefln( "A pointer is %d bytes", (void*).sizeof);
        void f1() {
            writeln( 1);
            Fiber.yield();
            writeln( 3);
        }
    auto fiber = new Fiber( &f1);
    fiber.call();
    writeln( 2);
    fiber.call();
    writeln( 4);
}
===============
The 64 bit version outputs 1 and crashes when yield is executed. Other tests reveal that yield is the problem.

Should I be doing something special with linkage so this works? What is going on?

Reply via email to