Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2006-03-28
01:10 • Closed ticket [1276628fff]: TCL_CHANNEL_TYPE_4 inconsistent plus 7 other cha... artifact: 46eb1aa82a user: andreas_kupries
01:07 • Ticket [1276628fff]: 4 changes artifact: d41fc6d291 user: andreas_kupries
01:07 • Ticket [1276628fff]: 4 changes artifact: 079ef1a77b user: andreas_kupries
01:07 • Add attachment 85.chan_v5.diff to ticket [1276628fff] artifact: f8802332d7 user: andreas_kupries
00:19 • Ticket [1276628fff] TCL_CHANNEL_TYPE_4 inconsistent status still Open with 4... artifact: 683b68e43b user: andreas_kupries
2006-03-10
11:54 • Ticket [1276628fff]: 5 changes artifact: 5b0b9fe640 user: dgp
2005-10-06
01:04 • Ticket [1276628fff]: 4 changes artifact: 6e06d19b63 user: andreas_kupries
2005-08-31
01:11 • Ticket [1276628fff]: 4 changes artifact: e74e79c92a user: andreas_kupries
2005-08-30
13:46 • New ticket [1276628fff]. artifact: 5bbf2b2dd8 user: dgp

TCL_CHANNEL_TYPE_4 inconsistent

Closed / Fixed1276628fffffffffffffffffffffffffffffffffCreated 21 years agoUpdated 21 years ago
Descriptionplain2005-08-30 13:46:47
Releases Tcl 8.4.10 and 8.4.11 included
TCL_CHANNEL_TYPE_4 in the public
header file, defining it to be a 
Tcl_ChannelType struct that includes
and ends with a Tcl_DriverThreadActionProc
field.  (TIP 218)

The HEAD (8.5a4) has added another
field, Tcl_DriverTruncateProc (TIP 208),
but has not created the
TCL_CHANNEL_TYPE_5 to distinguish
channels using that field from those
that do not, and could be used in
an 8.4.11 interp.
andreas_kupriesplain2005-08-31 01:11:55
Logged In: YES 
user_id=75003

I dimly remember some discussion about this on tcl-core. It
might have been about a related thing tough. I will have to
dig this out.
andreas_kupriesplain2005-10-06 01:04:40
Logged In: YES 
user_id=75003

Hm.

In the current situation a TYPE_4 channel defining a
truncateProc is perfectly usable in both 8.5. and 8.4. As
8.4 has no Tcl_TruncateChannel API  it will simply never
acess this element. It is no matter that the structure is
actually larger than 8.4 believes it is.

If we go TYPE_5 for the truncateProc the channel would be
unusable in 8.4, because 8.4 is not able to recognize
TYPE_5. Actually it will think that the channel is TYPE_1
and dereference the version number to get the blockmode
proc, crashing the core.
dgpplain2006-03-10 11:54:27
Logged In: YES 
user_id=80530


The time to resolve this
report is before 8.5a4
is released.  If valid,
the issue needs fixing,
if invalid, it ought to
be closed.
andreas_kupriesplain2006-03-28 00:19:05
Logged In: YES 
user_id=75003

Looked over the relevant TIPs, i.e. #206/208, and #218.
While both of them talk about going to version 4 for driver
the context makes clear that the version number is
incremented from whatever is maximum at the time the TIP
goes final. #218 says in effect: Right now we known version
0 to 3, and we extend to 4. And from this I conclude that if
version 4 is the actual maximum at time the TIP
implementation is committed it should go to version 5.

I will now change the HEAD to provide version 5, to make the
internal drivers v5 (if they use thread states), etc.
andreas_kupriesplain2006-03-28 01:07:31
Logged In: YES 
user_id=75003

Attached the patch I am about to commit. It compiles and
passes the testsuite on Linux.
andreas_kupriesplain2006-03-28 01:07:32
File Added - 172422: 85.chan_v5.diff
andreas_kupriesplain2006-03-28 01:10:27
Logged In: YES 
user_id=75003

Committed.
Log in (anonymous is fine) to add a comment.

Attachments: