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

History Of Ticket 525783ffffffffff

Artifacts Associated With Ticket 525783ffffffffff

  1. Ticket change [6ee0820d89] (rid 100213) by dgp on 2002-03-05 04:03:07:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Previously reported as Tk Bug 525778, tclsh has the
      same problem on Solaris 8:
      
      # FILE: test.tcl 
      for {set i 0} {$i < [lindex $argv 0]} {incr i} { 
        puts $i 
      } 
      
      $ tclsh8.3 test.tcl 5
      0
      1
      2
      3
      4
      $ tclsh8.4 test.tcl 5
      <no output>
      
      $ tclsh8.3 test.tcl 500
      0
      ...
      499
      $ tclsh8.4 test.tcl 5
      0
      ...
      358
      $
      
      I'm assigning to "Channel System" because I think
      that must be where the bug lies.  tclsh calls
      Tcl_FSEvalFile() within Tcl_Main() and wish calls
      Tcl_EvalFile() within Tk_Main(), so they don't have
      code in common, but show the same misbehavior.
      
    4. foundin initialized to: "obsolete: 8.4a4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "25. Channel System"
    10. title initialized to: "no flush on [exit]"
    11. type initialized to: "RFE"
  2. Ticket change [a6543144f3] (rid 98583) by dgp on 2002-03-05 11:35:27:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      tclsh 8.4a3 works properly, so the
      bug has been introduced since that release.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [6bfe5ac400] (rid 128423) by dgp on 2002-03-05 12:55:14:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Sources on Feb 15 worked fine too.  This is a recently
      introduced issue.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [f7b6486c3a] (rid 91417) by dgp on 2002-03-05 13:29:21:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Confirmed.  The changes to unix/tclUnixChan.c
      on 2002-Feb-27 are what broke things.  If this
      can't be fixed quickly, I recommend reverting
      to Revision 1.29 before releasing 8.4a4.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [37ae043b65] (rid 112072) by dkf on 2002-03-05 16:50:09:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      This looks to be TIP#35 related (which stopped serial lines
      from being flushed on [close] because the operation might
      block indefinitely), combined with other changes which made
      stdio channels be recognised as serial channels when used
      interactively.  Both of these make perfect sense in
      themselves, but they interact badly.  Yuck.
      
      I suppose the correct thing to do is to do the flush on
      close only for stdio channels to ttys; i.e. when the fd is 1
      or 2...
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [102d247dc1] (rid 94925) by dkf on 2002-03-05 18:22:27:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Easy fix: exclude stdout and stderr from the magical
      flushing in TtyCloseProc() using the attached patch.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Ticket change [0a7733e94c] (rid 113821) by dkf on 2002-03-05 18:22:28:

    1. icomment:
      
      
      File Added - 18826: flush.patch
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Ticket change [3431bcf4bd] (rid 106717) by dgp on 2002-03-05 23:34:20:

    1. subsystem changed to: "27. Channel Types"
  9. Ticket change [15c1bc29af] (rid 124623) by dkf on 2002-03-05 23:40:47:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      That was only a partial fix; here's a better one
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. subsystem changed to: "25. Channel System"
    5. username: "dkf"
  10. Add attachment "flush3.patch" [5c8f2f4b02] (rid 115323) by dkf on 2002-03-05 23:40:48.

  11. Ticket change [14563d2189] (rid 124380) by dkf on 2002-03-05 23:40:48:

    1. icomment:
      
      
      File Deleted - 18826: 
      
      
      
      File Added - 18835: flush3.patch
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  12. Ticket change [334e9a3fc2] (rid 106569) by dkf on 2002-03-05 23:46:33:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      However, things still foul up if you add
         open [exec tty]
      to the script.  Need fstat() to detect and avoid that. :^(
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  13. Ticket change [53ff9f0ed1] (rid 93861) by hobbs on 2002-03-06 03:07:58:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      A much more reliable test script is:
      
      set size [lindex $argv 0]
      if {![string is int -strict $size]} { set size 100 }
      for {set i 0} {$i < $size} {incr i} {
          puts $i
      }
      puts stderr done
      
      by adding in the data on the extra channel, that seems to 
      add enough perturbation to the tty's to always show the bug.
      
      However, simply changing "tcflush(...)" to "tcdrain((fd))" 
      solves all the problems that I can repeat.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  14. Ticket change [85758a7056] (rid 131319) by hobbs on 2002-03-06 04:01:48:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Attached is my recommend patch (already commited for others 
      to test) to 8.4a4.  This removes use of tcflush and reverts 
      to always calling FileOutputProc for now.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  15. Ticket change [938598e8c9] (rid 105829) by hobbs on 2002-03-06 04:01:49:

    1. icomment:
      
      
      File Added - 18840: 525783.patch
      
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  16. Add attachment "525783.patch" [d57af6609f] (rid 123629) by hobbs on 2002-03-06 04:01:49.

  17. Ticket change [33f6282e46] (rid 106682) by schroedter on 2002-03-06 19:48:52:

    1. icomment:
      Logged In: YES 
      user_id=99573
      
      This problem was probably introduced by two changes:
      1. stdin/stdout are now handled by the TTY driver
      2. The TIP#35 changes (Add serial port handshake support)
      
      There is no doubt, that TCL-exit should not stall if a serial port output is blocked.
      This can happen with handshake support. 
      This could also happen even before the TIP#35 changes, when the serial port handshake is activated by 
      using "stty" settings.
      
      At exit the channel driver sets all unflushed channels to blocking mode and waits until the output is flushed 
      (maybe forever). That's why the serial port driver now calls "tcflush".
      For a serial port this is okay, for stdin/stdout this maybe bad.
      
      Anyway Tcl's behaviour on exit needs further discussion.
      
      
      
    2. login: "schroedter"
    3. mimetype: "text/plain"
    4. username: "schroedter"
  18. Ticket change [1b66cbecfa] (rid 123142) by dkf on 2002-03-06 20:18:16:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      The problem with tcflush on exit is that it can nuke output
      in the OS buffers that came from stderr (say "sayonara" to
      debugging messages!)  Further investigation found that this
      could still happen even with some fairly elaborate measures
      to prevent it (like barring tcflush from operating on FDs 0,
      1 and 2) because it is a race between the data being grabbed
      by the tty and displayed, and the tcflush on an unrelated
      channel (you'll need the [open [exec tty]] addition
      mentioned below to enable this behaviour.)
      
      So as to make sure that people just using Tcl normally would
      not see the problem, and given the short timescale we were
      working on w.r.t. the 8.4a4 release, the tcflush was changed
      to a tcdrain (whose behaviour meets more what non-serial
      people think of by a flush!) even though this is clearly not
      what you were intending when you wrote the code.  A better
      fix will require application-input (since both behaviours
      are right in certain circumstances) which means there's room
      for another thing to [fconfigure], e.g.
      
         fconfigure $fd -onclose wait/discard
      
      (Reset semantics probably ought to be handled in the same
      way, because they are equally surprising when they hit the
      controlling terminal and both styles of behaviour can be
      considered to be correct in some circumstances.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  19. Ticket change [5ad1cfb188] (rid 118212) by dgp on 2002-05-10 23:53:05:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Did this get resolved?
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  20. Ticket change [628154f02e] (rid 92413) by andreas_kupries on 2002-05-11 00:05:10:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      I remember that Jeff did some changes ...
      Changelog ...
      
      2002-03-05  Jeff Hobbs  <[email protected]>
      
      * unix/tclUnixChan.c: initial remedy for [Bug 
      #525783] flush
      problem introduced by TIP #35.  This may not 
      satisfy true serial
      channels, but it restores the correct flushing of 
      std* channels on
      exit.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  21. Ticket change [14c4e0224c] (rid 124455) by dgp on 2002-06-22 00:03:42:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      I can no longer reproduce the problem with the HEAD sources.
      Is this matter closed?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "9 Immediate"
    5. username: "dgp"
  22. Ticket change [d9e8d72be8] (rid 107692) by andreas_kupries on 2002-06-22 00:23:54:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=75003
      
      In a way. See below. Jeff did provide and commit a fix, but he 
      is not completely satisfied with it. The std* channels have the 
      correct behaviour, but true serial channels might not get 
      completely auto-flushed when exiting.
      
      So the bug as reported is fixed, with problems in a different 
      area.
      
      
      
      
    3. login: "andreas_kupries"
    4. mimetype: "text/plain"
    5. username: "andreas_kupries"
  23. Ticket change [26b5d430e4] (rid 88397) by dgp on 2002-06-22 07:30:04:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      hot potato back to you.
      
      all my problems are resolved.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  24. Ticket change [fbe1cd3711] (rid 108136) by dkf on 2002-06-24 17:08:30:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      The current situation results in bugs for the smallest
      number of people; a lot more people use Tcl from a terminal
      on Unix than use serial ports under Unix!  A comment of mine
      below (the -onclose option) contains the germ of a TIP to
      fully resolve this matter (I know of no way to determine
      what the best action is by default, and that is really an OS
      design decision that I agree with in principle, so this
      really belongs in the hands of programmers) and I might get
      around to doing something about it in the future.  Or I
      might not.  Either way, no reason to hold back the b1
      release waiting on this.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. resolution changed to: "Fixed"
    7. username: "dkf"
  25. Ticket change [8fca1cad6f] (rid 120333) by schroedter on 2002-06-24 18:08:44:

    1. icomment:
      Logged In: YES 
      user_id=99573
      
      As the author of the recent serial port changes (TIP#35) I'm supporting Donal's proposal of an additional fconfigure 
      option:
      
          fconfigure $fd -onclose wait/discard
      
      This option should be general for *all* Tcl channels with the obvious default=wait (or flush).
      Please note that this cannot be done by the channel driver's [fconfigure] part because the channels driver cannot 
      easily distinguish between a "normal flush" and a "flush-on-close" situation. 
      Currently Tcl's channel system performs a blocking write before closing/exiting
      
          - Put the channel into blocking mode and
          - Write out all pending data
      
      This should be avoided by calling [fconfigure $chan -onclose discard]. It's really bad that a channel intentionally 
      configured by the user as non-blocking becomes blocking at close. I assume that this could also be useful for 
      other channels (sockets ?).
      
      Rolf.
      
      
      
    2. login: "schroedter"
    3. mimetype: "text/plain"
    4. username: "schroedter"
  26. Ticket change [9bc43a65a5] (rid 111178) by dkf on 2002-06-25 21:30:20:

    1. assignee changed to: "nobody"
    2. foundin changed to: "None"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      This is really an FRQ now
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. subsystem changed to: "None"
    7. title changed to: "Need optional full flush on [exit] for serial"
    8. username: "dkf"
  27. Ticket change [efa1469677] (rid 109028) by dkf on 2002-06-25 21:33:09:

    1. assignee changed to: "dkf"
    2. subsystem changed to: "25. Channel System"
  28. Ticket change [48f02dd50e] (rid 99984) by dgp on 2002-06-25 21:34:07:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      restored assignements lost in Tracker move.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  29. Ticket change [3ee2b74011] (rid 121349) by dgp on 2002-06-25 21:35:45:

    1. assignee changed to: "dkf"
  30. Ticket change [f7ca2c5814] (rid 91430) by dkf on 2003-10-17 17:46:25:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      See TIP#160 http://purl.org/tcl/tip/160
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. resolution changed to: "Remind"
    5. username: "dkf"
  31. Ticket change [6b89c73564] (rid 128345) by dkf on 2003-10-22 22:27:03:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Dropping the prio; it's in the TIP process now
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. priority changed to: "5 Medium"
    5. username: "dkf"
  32. Ticket change [ad0d864484] (rid 101405) by hobbs on 2005-05-31 08:57:43:

    1. assignee changed to: "davygrvy"
  33. Ticket change [6ccd1df610] (rid 128584) by davygrvy on 2005-11-06 05:50:35:

    1. assignee changed to: "patthoyts"
    2. icomment:
      Logged In: YES 
      user_id=7549
      
      Pat, please help, I can't do Tcl programming stuff at this
      time..
      
      
    3. login: "davygrvy"
    4. mimetype: "text/plain"
    5. username: "davygrvy"
  34. Ticket change [8b4b0dadab] (rid 127539) by dkf on 2012-07-03 15:25:25:

    1. assignee changed to: "ferrieux"
    2. icomment:
      This appears to be entangled with TIP #398 concerns...
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  35. Ticket change [fb796015c8] (rid 92070) by dkf on 2012-07-03 15:25:47:

    1. icomment:
      
      
      IP - Comment Removed: 130.88.1.31
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  36. Ticket change [f0048a03f3] (rid 109101) by dkf on 2012-07-03 15:25:57:

    1. icomment:
      
      
      IP - Comment Removed: 130.88.1.31
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  37. Ticket change [892aa2f6c8] (rid 131988) by dkf on 2012-07-03 15:26:17:

    1. icomment:
      
      
      IP - Comment Removed: 130.88.1.31
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  38. Ticket change [a8df8eba88] (rid 99065) by ferrieux on 2012-07-03 22:34:43:

    1. icomment:
      IMO, the "-closemode" of TIP 160 is obsoleted by TIP 398, simply by switching the (serial) channel to blocking or nonblocking before closing. Am I missing something linked with the special nature of serial lines ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  39. Ticket change [5c3a687201] (rid 115263) by dkf on 2012-07-04 02:59:17:

    1. icomment:
      Probably not, other than that compared to everything else they are horribly slow so people _never_ seem to agree on whether to block for them to flush on exit or not.
      
      If you think this FRQ is superseded, just close it. :-)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  40. Ticket change [0967b6b0a0] (rid 89717) by ferrieux on 2012-07-04 04:33:02:

    1. closedate changed to: "2012-07-03T21:33:02"
    2. closer changed to: "ferrieux"
    3. icomment:
      OK, closing as fixed by TIP 348: those who want the data to be flushed with insistence on serial lines (possibly blocking for a long time) should set the channel to blocking mode prior to closing/exiting; those who want a timely exit at the cost of possible data loss should set it to nonblocking mode.
      
      
    4. login: "ferrieux"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "ferrieux"
  41. Ticket change [7b14765002] (rid 90453) by ferrieux on 2012-07-04 04:34:55:

    1. icomment:
      Hum, 398 of course, not 348.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"