Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7945c4b68e3693037ecb884b7a0f05a418bce794
Ticket: 780533ffffffffffffffffffffffffffffffffff
[fcopy] callback sometimes fails to trigger
User & Date: msofer on 2003-07-30 21:45:03
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Assigned to dgp for review, as it might have something
    to do with [Bug 218203]).
    
    What I see is: let $s be a socket, $f a normal file,
    $nBytes a "large" number (8kB or above seems to trigger
    the error with good probability), both channels with
    "-translation binary". Then the trouble is that
      fcopy $s $f -size $nBytes -command myCallback
    often fails to notice that $nBytes *were* already
    written to $f, and hence never calls myCallback.
    
    It might be an off-by-one heisenbug: as I said, it
    happens often but not always - and it seems never to
    happen if one more byte than promised comes through the
    socket.
    
    I attached here a script that produces the error with
    good probability; uncommenting line 72 does the "one
    more byte" trick. 
    
    The script attached below produces the following
    results on RH7.2 (relevant??):
     [mig@mini test2]$ /CVS/tcl_SF_clean/unix/tclsh test.tcl 
     /CVS/tcl_SF_clean/unix/tclsh - 8.5a0
     client: done sending
     server: copying 16384 bytes to tempFile
     client: won't wait anymore ...
     server: [fcopy] wanted 16384, and got 16384
     server: [fcopy] doesn't tell us we are finished, exit
    anyway
    
    whereas the correct output (uncommenting line 72) is
     [mig@mini test2]$ /CVS/tcl_SF_clean/unix/tclsh test.tcl 
     /CVS/tcl_SF_clean/unix/tclsh - 8.5a0
     server: copying 16384 bytes to tempFile
     client: done sending
     server: copied  16384 bytes to tempFile.
     server: all done
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "msofer"
  9. subsystem changed to: "None"
  10. title changed to: "[fcopy] callback sometimes fails to trigger"
  11. type changed to: "Bug"