|
2008-11-24
| ||
| 04:33 | • Ticket [2333466fff] Tcl_IsChannelExisting() broken status still Closed with ... artifact: 7986758d7e user: andreas_kupries | |
| 04:01 | • Ticket [2333466fff]: 4 changes artifact: e5b905e505 user: ferrieux | |
| 04:00 | • Ticket [2333466fff]: 4 changes artifact: cf34455f17 user: ferrieux | |
| 03:57 | • Ticket [2333466fff]: 4 changes artifact: de95e503de user: gneumann | |
| 03:20 | • Ticket [2333466fff]: 4 changes artifact: 16cc9e9ed3 user: ferrieux | |
| 01:28 | • Ticket [2333466fff]: 4 changes artifact: 55755da5a0 user: gneumann | |
| 01:09 | • Closed ticket [2333466fff]. artifact: 08f6d23414 user: ferrieux | |
|
2008-11-23
| ||
| 15:56 | • New ticket [2333466fff]. artifact: 6df6e1a278 user: gneumann | |
Tcl_IsChannelExisting() broken
Closed / Fixed2333466fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-11-23 15:56:31
Tcl_IsChannelExisting() broken in versions at least from 8.4.14 until 8.5.5 + head version.
If there exists e.g. a channel named "file76", a test for channel "sock7" will report,
that "sock7" exists already. Similarly, when there exists a channel named "sock182",
a test for "sock18" will be incorrect.
The bug is pretty obvious in Tcl_IsChannelExisting() in tcl/generic/tclIO.c
if ((*chanName == *name) &&
(memcmp(name, chanName, (size_t) chanNameLen) == 0)) {
return 1;
}
This comparison just tests, whether there exists a channel having the same first characters
as the queried channel, but not, if the name existing channel and the queried channel have the
same length.
There are many possible fixes; the fastest fix is most likely to increase chanNameLen
by 1, or to compare the string lengths to make the test more explicit.
ferrieuxplain2008-11-24 01:09:10
You are right about the +1, since both compared strings are null-terminated by construction. Fixed in HEAD. Please tell if you need a backport. (Notice this bug cannot harm the core alone, since there is no client of Tcl_IsChannelExisting; so it is only of concern for extensions/embedders).
gneumannplain2008-11-24 01:28:47
A backport to 8.4.* would be nice (not sure if backport is the appropriate name), since the problem showed up on busy sites using aolserver and libthread, where libthread is using Tcl_IsChannelExisting() in ::thread::transfer. If i remember correctly, there is however no intention from the Tcl team to release another 8.4 version. Most aolserver/OpenACS/DotLRN sites are still using Tcl 8.4 I have no problem to fix this on our sites, but it is painful to tell other people to fix this on their systems as well... Many thanks! -gustaf
ferrieuxplain2008-11-24 03:20:31
You will be pleased to know that Andreas has just committed it to 8.5 *and* 8.4, and that you may expect an AS version of 8.4 (possibly through the teacup) with it.
gneumannplain2008-11-24 03:57:32
i am pleased! Many thanks to you and Andreas!
ferrieuxplain2008-11-24 04:00:12
You will be pleased to know that Andreas has just committed it to 8.5 *and* 8.4, and that you may expect an AS version of 8.4 (possibly through the teacup) with it.
ferrieuxplain2008-11-24 04:01:20
Sorry, duplicated comment due to a reload in browser :-}
andreas_kupriesplain2008-11-24 04:33:03
To clarify in this game of telephone. I said that I backported because AS has customers which are based on 8.4. I did not say that a new release of an ActiveTcl 8.4 is forthcoming, which is partially implied by Alexandre's comment. He is right that the fix will go into the core pieces which are in the teapot, which are our basekits. The regular Tclsh/Wish are not distributed through the teapot.
Log in (anonymous is fine) to add a comment.