Artifacts Associated With Ticket 3394732
Ticket change [3891557a18] (rid 112231) by anonymous on 2011-08-19 18:55:00:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Ubuntu based OS, 32 bit, kernel 2.6.35-30, ActiveState 8.6b2 binary. Starting with the latest beta, my "socket -server" code stopped working in my code. It appears that setting the server socket encoding to any value, ie "-encoding binary" or even to the value it is currently set to stops the server from responding. Initially I thought it was the -blocking setting since it was the only setting I was changing from it's default value but after I started experimenting with the settings by changing each one individually, the culprit turned out to be -encoding.
- foundin initialized to: "obsolete: 8.6b2"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- subsystem initialized to: "25. Channel System"
- title initialized to: "socket -server"
- type initialized to: "Bug"
Ticket change [0ee94ef8db] (rid 94704) by andreas_kupries on 2011-08-20 02:07:54:
- icomment:
[11:54]akuThe only big change I recall to 'socket -server' is IPv6 support getting added. [11:54]akuAre you setting the encoding of the listening socket ? Or of the socket you get when the connection is accepted ?
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [06ac329238] (rid 89254) by dgp on 2011-08-20 02:09:51:
- icomment:
http://pastebin.com/3mT6KPG6
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f615c5a408] (rid 130230) by dgp on 2011-08-20 02:13:57:
- icomment:
I confirm reproduction of the pastebin symptoms on the trunk tip.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [a8caaa86f4] (rid 99049) by andreas_kupries on 2011-08-20 02:16:58:
- assignee changed to: "rmax"
- icomment:
Strongly suspect the IPv6 changes.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
Ticket change [9c95466aed] (rid 96167) by anonymous on 2011-08-20 12:59:19:
- icomment:
The previous pastebin expires in one day. This is a copy of it that does not expire, in case someone needss to see it: http://pastebin.com/2xmykvVt
- login: ""
- mimetype: "text/plain"
- username: ""
- icomment:
Ticket change [460ac22ed4] (rid 99449) by dkf on 2011-08-20 15:07:14:
- icomment:
File Added - 421593: socketbug.txt
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Add attachment "socketbug.txt" [17f0a30690] (rid 122583) by dkf on 2011-08-20 15:07:14.
Ticket change [b7c72bbc55] (rid 128856) by dkf on 2011-08-20 15:08:00:
- icomment:
I've attached the contents of the paste as a file so that they don't get lost in the future.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [0e89901fe5] (rid 94633) by rmax on 2011-08-20 16:57:25:
- icomment:
Some strace debugging revealed that after fconfigure -encoding, the first (or the only in case there is just one) file descriptor that underlays a [socket -server] gets skipped from the select() call that results from [update] or [vwait]. If there is more than one actual socket under the hood of the server channel (e.g. when the socket listens on both, IPv4 and IPv6), the second socket in the list (the IPv6 one in my case) still works after the [fconfigure].
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [a193f760df] (rid 109747) by rmax on 2011-08-20 22:34:34:
- icomment:
Ah - I recently removed the check for server sockets from TcpWatchProc() after I didn't find a way for it to ever get called for server sockets. But as a result of [chan configure -encoding] it does get called and removes the FileHandler for the first file descriptor in the socket. It is only the first, because connected sockets for which TcpWatchProc() is normally called, only ever have one fd and so it doesn't need to loop over them. I could re-add the check to skip server sockets, but suggest to further investigate if changing the encoding really needs to call the watchproc. Also, it might be cleaner to not specify a watchproc in the Tcl_ChannelType struct for server sockets at all, so that TcpWatchProc() doesn't need to check for them. This would mean that separate Tcl_ChannelType structs would have to be maintained for client and server sockets, which might not be so bad, because there are more members in the struct that don't make much sense for server socckets. In any case, we should add a test case for this, so that it can't re-appear. As a quick fix the following line can be added at the start of TcpWatchProc(): if (statePtr->acceptProc != NULL) return;
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [cd8d6111a5] (rid 95911) by ferrieux on 2011-08-21 06:18:59:
- icomment:
I'm all for minimal changes. If we feel later that the current sequence should be revised, that can be done in a separate patch (still your multiple-address patch doesn't really need it). The attached patch does this, by restoring the test as you suggested, but also keeping the comment explaining the assumptions. This way a future reform won't miss it.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Add attachment "servconfig.patch" [ddab9b1262] (rid 114712) by ferrieux on 2011-08-21 06:20:41.
Ticket change [4406887cb2] (rid 116649) by ferrieux on 2011-08-21 06:20:41:
- icomment:
File Added - 421629: servconfig.patch
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [5aad33e032] (rid 118184) by ferrieux on 2011-08-30 04:09:17:
- icomment:
Reinhard, what's the status ? I was under the impression that you had this all done in your sandbox...
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [eb1f2942ad] (rid 103482) by rmax on 2011-08-30 06:30:04:
- icomment:
Committed now. Sorry for the delay.
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [5851e8d52f] (rid 117779) by rmax on 2011-08-30 06:30:05:
- closedate changed to: "2011-08-29T23:30:05"
- closer changed to: "rmax"
- resolution changed to: "Fixed"
- status changed to: "Closed"