Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ec018a96fa4bdb4898c481c1e9a97b28a9370509
Ticket: 2818131fffffffffffffffffffffffffffffffff
Crash in zlib when bumped into TCP stack
User & Date: patthoyts on 2009-07-11 04:26:07
Changes

  1. icomment:
    The crucial requirement for this crash is that we use gets and not read and that an error occurs during the underlying read from the channel. Provided we additionally fail to unhook the fileevents we get a crash caused by a fileevent from the windows socket code trying to process an event on the channel structure that has already been deleted.
    We can generate the channel error using a mismatched compress/decompress pair so that the read/gets call will error. This matched with a channel event handler like:
    proc Read {type chan} {
        #set data [read $chan]
        if {[gets $chan line] < 0} {
            puts "error?"
            #chan event $chan {}
            close $chan
            return
        }
        puts "Read $type [string length $data]"
        if {[eof $chan]} {
            puts "Eof $type $chan"
            close $sock
        }
    }
    will crash. If we use read it isssues an error message. If we unset the event handler it will be ok too.
    
    
  2. login: "patthoyts"
  3. mimetype: "text/plain"
  4. username: "patthoyts"