D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4975 - Threads + TcpSockets + Windows = FAIL
Summary: Threads + TcpSockets + Windows = FAIL
Status: RESOLVED DUPLICATE of issue 4344
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-02 15:16 UTC by b599400
Modified: 2010-10-30 18:08 UTC (History)
2 users (show)

See Also:


Attachments
An example program. (406 bytes, application/octet-stream)
2010-10-02 15:16 UTC, b599400
Details

Note You need to log in before you can comment on or make changes to this issue.
Description b599400 2010-10-02 15:16:21 UTC
Created attachment 779 [details]
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 Rainer Schuetze 2010-10-03 00:50:01 UTC
I guess this is related to bug 4344.
Comment 2 Stephan Dilly 2010-10-30 18:08:34 UTC

*** This issue has been marked as a duplicate of issue 4344 ***