Artifacts Associated With Ticket 410674ffffffffffffffffffffffffffffffffff
Ticket change [81bd241eb9] (rid 117094) by ashmael on 2001-03-23 01:44:48:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This is a patch I believe to to fix bugs #219205 and #219333 regarding dropped socket events on Windows. The fix consists of moving the SendMessage() call that re-enables the WSAAsyncSelect() handler to outside the else {} block so that it will be called regardless of the select() return value. See Bug #219205 for a more detailed analysis of the bug fix. - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "ashmael"
- subsystem initialized to: "None"
- title initialized to: "Bug fix: #219205 and 219333 (event drop)"
- type initialized to: "Patch"
Add attachment "tclWinSock.c.patch" [ab709cad9f] (rid 101116) by ashmael on 2001-03-23 08:44:50.
Ticket change [304dfb2051] (rid 93224) by ashmael on 2001-03-23 08:44:51:
- icomment:
File Added - 4543: tclWinSock.c.patch
- login: "ashmael"
- mimetype: "text/plain"
- username: "ashmael"
- icomment:
Ticket change [81565690b0] (rid 117015) by hobbs on 2001-03-24 10:00:12:
- assignee changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 The patch is off by a few lines for 8.4a2, but it does pass all the test suites after being applied. Also an example with C source now passes that still failed in pre-patch 8.4a2 code.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
Ticket change [df75c89b82] (rid 115019) by dgp on 2001-03-26 23:43:34:
- subsystem changed to: "27. Channel Types"
Ticket change [699cc6d2d7] (rid 103282) by hobbs on 2001-03-31 07:39:06:
- closedate changed to: "2001-03-31T00:39:06"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 After some back and forth discussion, it was decided to go with: diff -b -c -r1.19 tclWinSock.c *** win/tclWinSock.c 2000/09/28 06:38:23 1.19 --- win/tclWinSock.c 2001/03/31 00:27:25 *************** *** 836,844 **** if ((*winSock.select)(0, &readFds, NULL, NULL, &timeout) != 0) { mask |= TCL_READABLE; } else { SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); - infoPtr->readyEvents &= ~(FD_READ); } } if (events & (FD_WRITE | FD_CONNECT)) { --- 836,844 ---- if ((*winSock.select)(0, &readFds, NULL, NULL, &timeout) != 0) { mask |= TCL_READABLE; } else { + infoPtr->readyEvents &= ~(FD_READ); SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); } } if (events & (FD_WRITE | FD_CONNECT)) { This just moves the infoPtr flag correction before the SendMessage. It appears we were hitting a rare race condition that could cause the hang, where the recipient of the SendMessage received the message before the infoPtr flags could be corrected. This was tested again from 8.2- 8.4a2. In 8.4a2cvs. - login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "hobbs"
Ticket change [daace9a44c] (rid 107831) by kensdorf on 2002-12-19 02:14:23:
- icomment:
Logged In: YES user_id=671771 We have seen a similar problem in version 8.3.2. We determined that it has to do with the FD_ACCEPT bit being cleared prematurely when two "accept" events come in simultaneously. This happens due to a race condition in the code where the infoPtr's acceptEventCount is checked and the flag is subsequntly cleared. If an accept event occurs during this operation, it will never be processed if the FD_ACCEPT flag is cleared by the tcl application thread after it has been set by the "SocketProc" thread. We fixed this by protecting access to this flag and the acceptEventCount variable with a critical section object. If anyone would like more details about our fix, please let me know.
- login: "kensdorf"
- mimetype: "text/plain"
- username: "kensdorf"
- icomment:
Ticket change [63b95b6a7d] (rid 92634) by hobbs on 2002-12-19 03:38:04:
- closedate changed to: "2002-12-18T20:38:04"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 8.3.2 would be prior to the mentioned bug fix. If you still have the issue in 8.4.1 (or perhaps it was backported for 8.3.5), then please submit a new bug report with your patch.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"