Skip to content
Tcl Source Code History Of Ticket 218003ffffffffff
Login

History Of Ticket 218003ffffffffff

Artifacts Associated With Ticket 218003ffffffffff

  1. Ticket change [00368836b0] (rid 119275) by nobody on 2000-10-26 00:51:52:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 700 Bug
      Version: 8.0.3
      SubmitDate: '1998-10-09'
      LastModified: '1999-08-09'
      Severity: MED
      Status: Closed
      Submitter: suresh
      ChangedBy: redman
      OS: All
      OSVersion: NA
      Machine: NA
      FixedDate: '2000-10-25'
      FixedInVersion: 8.2b2
      ClosedDate: '1999-08-09'
      
      
      Basically there appears to be a bug in the handling of events via the "fileevent" command on Windows.  The bug is that on Windows, fileevents come in at unpredictable times and inconsistent with the same script that runs on UNIX.   See the script below and the produced output on both Windows and UNIX.
      
      See the following script
      
      =======================================
      # fileevent-bug.tcl
      set hosts {pop hippo cerridwen}
      proc myProc {f host hostDone} {
          if {![eof $f]} {
      puts "0 [clock sec] $host $f -- readable"
      read $f
          } else {
      puts "1 [clock sec] $host $f -- eof"
      set ::$hostDone $host
          }
      }
      set sleepTime 0
      foreach host $hosts {
          set hostFiles($host) [open "| rsh $host sleep [incr sleepTime 10]"]
          puts "$host $hostFiles($host)"
      }
      set allHostsDone 0
      foreach host [array name hostFiles] {
          fileevent $hostFiles($host) readable  [list myProc $hostFiles($host) $host hostDone]
      }
      while {[array size hostFiles]} {
          vwait hostDone
          puts "2 [clock sec] $hostDone $hostFiles($hostDone) -- hostdone"
          catch {close $hostFiles($hostDone)} result
          unset hostFiles($hostDone)
      }
      =======================================
      
      If you run this script on Windows, you will get the following output:
      
      =======================================
      [c:\temp]tclsh80 z:\fileevent-bug.tcl
      pop file160
      hippo file76
      cerridwen file24
      0 907963252 pop file160 -- readable
      0 907963262 cerridwen file24 -- readable
      0 907963284 hippo file76 -- readable
      1 907963284 pop file160 -- eof
      2 907963284 pop file160 -- hostdone
      1 907963284 cerridwen file24 -- eof
      2 907963284 cerridwen file24 -- hostdone
      1 907963284 hippo file76 -- eof
      2 907963284 hippo file76 -- hostdone
      =======================================
      
      However, on UNIX you get:
      
      =======================================
      pop> tcls8.0h fileevent-bug.tcl 
      pop file3
      hippo file5
      cerridwen file8
      0 907963245 pop file3 -- readable
      1 907963245 pop file3 -- eof
      2 907963245 pop file3 -- hostdone
      0 907963255 hippo file5 -- readable
      1 907963255 hippo file5 -- eof
      2 907963255 hippo file5 -- hostdone
      0 907963266 cerridwen file8 -- readable
      1 907963266 cerridwen file8 -- eof
      2 907963266 cerridwen file8 -- hostdone
      =======================================
      
      
      
      This bug was discovered during development of TclPro nightly build script.  The script kicks off UNIX hosts in parallel from Windows via the Windows RSH.EXE command;  if you look at the build output e-mail, you see that all the UNIX builds finish exactly at the same time (to the second), which is unlikely and is due to "fileevent" waiting for all hosts to "remove" themselves from the "fileevent" list.  (suresh:981009)
      
      
      
    4. foundin initialized to: "obsolete: 8.0.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "62. (unused)"
    10. title initialized to:
      "readable" fileevents behave inaccurately on Windows
      
    11. type initialized to: "Bug"
  2. Ticket change [736650a14c] (rid 105040) by welch on 2000-10-26 08:12:11:

    1. closedate changed to: "2000-10-26T01:12:11"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [bedd810d8e] (rid 102161) by dgp on 2001-04-03 07:45:27:

    1. closedate changed to: "2001-04-03T00:45:27"
    2. closer changed to: "dgp"
    3. subsystem changed to: "27. Channel Types"
    4. title changed to:
      "readable" fileevents behave inaccurately on Windows