Bug 4975 – Threads + TcpSockets + Windows = FAIL

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-10-02T15:16:00Z
Last change time
2010-10-30T18:08:34Z
Assigned to
nobody
Creator
b599400

Attachments

IDFilenameSummaryContent-TypeSize
779test.dAn example program.application/octet-stream406

Comments

Comment #0 by b599400 — 2010-10-02T15:16:21Z
Created attachment 779 An example program. If you create a thread from core.thread and a listening socket in the same program, then once the thread exits, all attempts to accept() from the listening socket will fail with the error message "Unable to accept socket connection", and so will all attempts to create new TcpSockets. An example program is provided. I believe it to be the simplest program that exhibits this bug. When compiled with -version=Works, then the created threads never exit, so the failure condition is never reached. When compiled with -version=Broken, the threads exit immediately, leading to failure as soon as you connect to localhost:1234. This bug is only present in the Windows version of DMD. When compiled on Linux, the example program works properly with both version tags. (Mac OS X was not tested).
Comment #1 by r.sagitario — 2010-10-03T00:50:01Z
I guess this is related to bug 4344.
Comment #2 by spam — 2010-10-30T18:08:34Z
*** This issue has been marked as a duplicate of issue 4344 ***