digitalmars.D.learn - Seems core.thread.Fiber is broken dmd windows 64-bit build
- Carl Sturtivant (25/25) Mar 08 2015 The following crashes on Windows 7 sp1 64-bit edition when build
- Carl Sturtivant (13/13) Mar 09 2015 Please confirm or deny that this is a real bug, as its getting in
- Benjamin Thaut (5/18) Mar 09 2015 I can reproduce this issue with dmd 2.066.1,
- Carl Sturtivant (1/5) Mar 09 2015 Thank you; will do.
- "Jacques =?UTF-8?B?TcO8bGxlciI=?= <jacques.mueller gmx.de> (2/2) Mar 09 2015 With the newest beta everything seems to work fine.
- Carl Sturtivant (2/4) Mar 09 2015 That's great news! Thank you.
- Carl Sturtivant (2/3) Mar 09 2015 Got a working build at 64 bits using the 2.067 beta 3.
- David Nadlinger (5/7) Mar 09 2015 IIRC there are some fixes to the Win64 context switching code in
- Carl Sturtivant (1/4) Mar 09 2015 Great, and thanks.
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?
Mar 08 2015
Please confirm or deny that this is a real bug, as its getting in the way of a genuine project. How should I proceed? I'm working on a 64-bit Windows port of the following. http://www.cs.arizona.edu/icon/ Here's the 32-bit Windows port. http://www.cs.arizona.edu/icon/v95w.htm Among other things I'm using D to implement Icon's coexpressions portably using core.thread.Fiber which works fine at 32 bits. They are implemented using pthreads on other platforms, though historically there used to be a platform dependent assembly code context switch, close to the way that core.thread.Fiber is implemented. The Fiber implementation is 20 times faster at 32 bits.
Mar 09 2015
On Monday, 9 March 2015 at 14:39:34 UTC, Carl Sturtivant wrote:Please confirm or deny that this is a real bug, as its getting in the way of a genuine project. How should I proceed? I'm working on a 64-bit Windows port of the following. http://www.cs.arizona.edu/icon/ Here's the 32-bit Windows port. http://www.cs.arizona.edu/icon/v95w.htm Among other things I'm using D to implement Icon's coexpressions portably using core.thread.Fiber which works fine at 32 bits. They are implemented using pthreads on other platforms, though historically there used to be a platform dependent assembly code context switch, close to the way that core.thread.Fiber is implemented. The Fiber implementation is 20 times faster at 32 bits.I can reproduce this issue with dmd 2.066.1, please go forward and open a issue on https://issues.dlang.org/ Kind Regards Benjamin Thaut
Mar 09 2015
I can reproduce this issue with dmd 2.066.1, please go forward and open a issue on https://issues.dlang.org/ Kind Regards Benjamin ThautThank you; will do.
Mar 09 2015
With the newest beta everything seems to work fine. http://forum.dlang.org/thread/md5kq0$8au$1 digitalmars.com
Mar 09 2015
On Monday, 9 March 2015 at 17:00:38 UTC, Jacques Müller wrote:With the newest beta everything seems to work fine. http://forum.dlang.org/thread/md5kq0$8au$1 digitalmars.comThat's great news! Thank you.
Mar 09 2015
http://forum.dlang.org/thread/md5kq0$8au$1 digitalmars.comGot a working build at 64 bits using the 2.067 beta 3. Delighted.
Mar 09 2015
On Sunday, 8 March 2015 at 18:18:49 UTC, Carl Sturtivant wrote:Should I be doing something special with linkage so this works? What is going on?IIRC there are some fixes to the Win64 context switching code in the 2.067 or master druntime. You might want to try those first before spending more time tracking this down. — David
Mar 09 2015
IIRC there are some fixes to the Win64 context switching code in the 2.067 or master druntime. You might want to try those first before spending more time tracking this down.Great, and thanks.
Mar 09 2015