[Issue 1126] New: multithreading breaks phobos exceptions on mingw/gdc .23
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 11 15:48:50 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1126
Summary: multithreading breaks phobos exceptions on mingw/gdc .23
Product: DGCC aka GDC
Version: unspecified
Platform: PC
OS/Version: Windows
Status: NEW
Severity: major
Priority: P2
Component: glue layer
AssignedTo: dvdfrdmn at users.sf.net
ReportedBy: default_357-line at yahoo.de
Consider the following code:
import std.stdio, std.thread, std.socket;
// intended to fail
void cause_throw() {
Socket s=new TcpSocket(new InternetAddress("bogus", 80));
}
void main() {
(new Thread(() { while (true) { } return 0; })).start;
try cause_throw;
catch (Exception e) { writefln("Exception: ", e); }
writefln("Returning");
}
Now, if I comment the thread out, I get, as expected:
Exception: Unable to resolve etc.
Returning
However, if I leave it as it is, I get "Error: Unable to resolve etc.", and the
program freezes.
I was unable to find another gdc/mingw user to verify it.
Tried on a virgin 3.4.5/.23 and .22 and on a 4.0.2/.23 gdc MinGW setup.
The problem seems to be specific to gdc/win32.
--
More information about the D.gnu
mailing list