Tcl Source Code

View Ticket
Login
Ticket UUID: c31ca233cacd7d6184877c54182f4b3a6ccb30f1
Title: tlsIO-2.11 failure
Type: Bug Version: trunk
Submitter: dgp Created on: 2014-06-30 18:22:24
Subsystem: 25. Channel System Assigned To: dgp
Priority: 5 Medium Severity: Severe
Status: Closed Last Modified: 2015-05-11 17:55:18
Resolution: Out of Date Closed By: dgp
    Closed on: 2015-05-11 17:55:18
Description:
Starting with checkin 2a40293a49 on the Tcl trunk,
the test in the tls extension, tlsIO-2.11 fails:

---- Result was:
a:one b: c:
---- Result should have been (exact matching):
a:one b: c:two
==== tlsIO-2.11 FAILED
User Comments: dgp added on 2014-07-02 20:07:07:
New attachment, eof.patch, is another way to
fix the failing test tlsIO-2.10.  

I believe the best thing is to apply both patches to tls.
After these patches, tls should continue to operate successfully
everywhere it always has, and in addition function correctly with
the current Tcl trunk.

What's happening is that during the handshake processing,
an EOF happens on the low-level encrypted socket.

Until recently, Tcl's I/O core has been allowing EOF
status flags to leak between levels in a channel stack.
In this case, the bug was an advantage to tls because it caused
the tls::socket to apparently also present an EOF state,
and this causes [gets] to complete successfully returning
an empty string.

Now that the core bugs are fixed, the EOF doesn't bubble up,
and so the failed handshake gets noticed and reported as
an error.  The failing [gets] causes the test to fail.
 
The eof.patch adds a tiny bit of code to explicitly notice
the low-level EOF and explicitly raise it again at the higher
level.

An additional change that might be worthwhile is to [catch]
the [gets] in the test.  The purpose of the test is to verify
that [readit] is called at all, not whether [gets] succeeds.

dgp added on 2014-07-02 16:31:02:
tlsIO-2.11 failure fixed in Tcl 8.5 and trunk branches.

dgp added on 2014-07-02 15:16:50:
The failure of tclIO-2.11 is a core bug.
I have a fix, and will commit when I have
a test in the core test suite.

dgp added on 2014-06-30 20:26:31:
Attached patch for tls, which was developed for
other reasons, cleans up tls management of chan
events.  Attached here because applying it stops
the failures of tlsIO-2.10.

dgp added on 2014-06-30 19:58:51:
Sorry, no.  The tlsIO-2.10 failures start
with checkin 98763462fb

dgp added on 2014-06-30 19:53:13:
Same checkins also introduce errors and 
failures in tlsIO-2.10.

dgp added on 2014-06-30 19:03:00:
bisecting onto dgp-trunk-flag-repair branch
shows the trouble arising in checkin 960f628ee8

Attachments: