Overview
| Artifact ID: | 3ae87e8208d878494d39696a69f42919a32b725e |
|---|---|
| Ticket: | 1437595fffffffffffffffffffffffffffffffff
WinSock cores/hangs on thread or app exit |
| User & Date: | nobody on 2007-09-26 21:54:21 |
Changes
- icomment:
Logged In: NO I believe there is a defect on socket shutdown (Windows) In TclpFinalizeSockets() a SOCKET_TERMINATE message is posted to the socket's window, followed by a wait for readyEvent to be signaled (which the wndProc signals when its event loop exits, after receiving its destroy message which is triggered by the SOCKET_TERMINATE message). Since readyEvent is also signaled when data arrives on the socket, the wait in TclpFinalizeSockets can return before the socket window has been destroyed if there is activity on the socket at that time. This can cause a number of deleterious side effects, such as the call to UnregisterClass() failing (due to a window still existing) - and then a failure to initialize sockets due to RegisterClassA failing as the window class already exists - in a scenario where Tcl is unloaded and re-loaded from within the same process instance. This issue was resolved by using a separate event object solely for tracking the socket window creation and destruction. A related issue in InitSockets is that sockets are marked as initialized even if one of the initialization steps fails (e.g. RegisterClassA fails). Subsequent calls to InitSockets do not execute the code to setup the Winsock DLL, but do execute per-thread initialization instructions.
- login: "[email protected]"
- mimetype: "text/plain"
- username: "[email protected]"