Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1ce8f5711c4128c8b81af3a76151d945271279a5
Ticket: 218495ffffffffffffffffffffffffffffffffff
tcl 8.0.3 incompatibility in Tcl_CreateChannelHandler
User & Date: nobody on 2000-10-26 01:01:19
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 714 Bug
    Version: 8.0.3
    SubmitDate: '1998-10-13'
    LastModified: '1999-10-21'
    Severity: SER
    Status: Released
    Submitter: admin
    ChangedBy: hobbs
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '1999-10-21'
    FixedInVersion: 8.2.1
    ClosedDate: '2000-10-25'
    
    
     > I've been fighting with a bug/feature of Tcl 8.0.3 until I read the solution
     > on comp.lang.tcl.  The problem is that I've been using some Tcl channels
     > that I never register with an interpreter.  I register a channel handler 
     > which only works for one event under 8.0.3 whereas it worked without fail
     > under 8.0p2 and ealier.
     > 
     > I understand that you've changed Tcl_CreateChannelHandler internally so
     > that it now requires you to have registered the channel or it will be closed
     > on the first event.  Since this is a SIGNIFICANT CHANGE, I think this should
     > be noted somewhere as either a known bug or at least an incompatibility
     > introduced in the 8.0.3 release to save others the waste of time that I
     > experienced.  Adding a call to Tcl_RegisterChannel is simple enough, but it
     > should be posted somewhere visisble, IMHO.  :-)
     > 
     > -- Mike
    
    Colin and Jacob made this fix.  It seems there is a possibility
    that a channel structure can get garbage collected out from under
    Tcl_NotifyChannel if the channel is closed during the notify callback.
    In particular, a fileevent script that closes its handle seems to
    have triggered this bug in some plug-in context.
    
    The fix they made is just wrong, however, as it precludes the close
    from having any effect, so if you wanted to see error codes from
    the Tcl close command, they would be lost.  I believe the fix is
    to use TclPreserve instead of Tcl_RegisterChannel.
    
    --Brent
    
    
    As of 8.2.1, Tcl_NotifyChannel uses Tcl_Preserve/Tcl_Release
    (fix made sometime before 8.2). 
    -- 10/21/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.0.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "37. File System"
  10. title changed to:
    tcl 8.0.3 incompatibility in Tcl_CreateChannelHandler
    
  11. type changed to: "Bug"