Skip to content
Tcl Source Code History Of Ticket 219311
Login

History Of Ticket 219311

Artifacts Associated With Ticket 219311

  1. Ticket change [9ee106116a] (rid 96553) by nobody on 2000-10-26 05:10:31:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 3648 Bug
      Version: 8.2.2
      SubmitDate: '1999-11-23'
      LastModified: '1999-12-07'
      Severity: SER
      Status: UnAssn
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Windows NT
      FixedDate: '2000-10-25'
      ClosedDate: '2000-10-25'
      
      
      Name:
      Alexandre Ferrieux
      
      ReproducibleScript:
      # to be fed to tclsh82.exe
      set com [open COM1: r]
      set nul [open c:/big.dat w]
      fconfigure $com -translation binary -mode 115200,n,8,1 
      fconfigure $nul -translation binary
      
      proc go args {puts CALLBACK;fcopy $::com $::nul -size 8000 -command go}
      
      after idle {puts IDLE!!!!!!!}
      go
      vwait forever
      
      ObservedBehavior:
      Run the script while something is feeding the serial port at full speed (eg another PC via a null modem cable)."CALLBACK"s are slowly output as expected (every 550ms at this speed of 115200 bauds), but the IDLE!!!! comes only when you starve the port.  Clearly the internal polling of the port (10ms) mistakenly postpones idletasks.
      Notice that this happens only if the destination file is a true disk file (with nonzero write overheads). If you use NUL: instead there is no problem ! Also, with a true file the hard drive makes an awful noise, suggesting a lot of microscopic writes. Interestingly, a synchronous fcopy to the same file makes a normal noise (suggesting larger buffers). This happens on W95, W98, and NT. So the culprit is at the intersection of 8.2.2, WIndows, serial port, fcopy -command, nontrivial writes...
      
      DesiredBehavior:
      The idletask should occur immediately, just as it does on unix or if the file is NUL:
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.2.2"
    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: "63. (unused)"
    10. title initialized to:
      [fcopy -command] on serial port floods the event queue
      
    11. type initialized to: "Bug"
  2. Ticket change [893f972edd] (rid 131994) by dkf on 2001-01-16 20:50:56:

    1. icomment:
      Does changing the -pollinterval option on the serial channel make any difference?
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. subsystem changed to: "62. (unused)"
    5. username: "dkf"
  3. Ticket change [2430a55c28] (rid 131073) by dkf on 2001-02-05 04:28:48:

    1. subsystem changed to: "27. Channel Types"
  4. Ticket change [00ddac4827] (rid 119384) by dgp on 2001-02-08 12:48:04:

    1. icomment:
      Check whether Patch #103432 has fixed this.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [11a2792bce] (rid 95183) by andreas_kupries on 2001-08-24 04:58:51:

    1. assignee changed to: "schroedter"
    2. icomment:
      Logged In: YES 
      user_id=75003
      
      This might affect or be affected by your rewrite of serials
      
      
      
    3. login: "andreas_kupries"
    4. mimetype: "text/plain"
    5. username: "andreas_kupries"
  6. Ticket change [470a2ba35a] (rid 99616) by schroedter on 2001-09-05 21:48:58:

    1. icomment:
      Logged In: YES 
      user_id=99573
      
      Sorry for responding so late - I just returned from 
      vacation.
      
      There are a few specialities around serial ports:
      - A serial fileevent occures when there is at least 
        1 char available.
        In the case above this should happen at nearly every
        event check.
      - A non-blocking read returns the number of available 
        bytes in the input queue.
      
      When there are contineous fileevents obviously 
      no IDLE callbacks will be executed. 
      IMO that's intentional done.
      I also see, that -pollinterval doesn't change anything
      (see 3. below).
      
      Debugging the script above shows some strangeness 
      when applied to the serial channel.
      It contineously performs non-blocking reads 
      while resetting the event mask:
      
      1. SerialBlockProc(mode=1) 
              # Set non-blocking mode
      2. SerialInputProc() 
              # Returns a few bytes from the serial port
              # Writes these bytes to output channel 
      (microscopic writes !!!)
      3. SerialWatchProc(mask=0) 
              # mask=0 -> Tcl_SetMaxBlockTime() not called
              # That's why -pollinterval doesn't help.
              # This also resets the internal watch mask.
      4. SerialCheckProc()
              # Doesn't detect any event, because watch mask 
              has been reset by 3.
      5. Repeat steps 2.-5. 
              # Until 8000 bytes have been read
      6. SerialBlockProc(mode=0) 
              # Restore original blocking mode
      
      It seems to me, that the there is at least 1 problem
      with fcopy and serial ports.
      
      tclIO.c:CopyData() considers only to cases after 
      DoRead():
          size < 0:  Error
          size == 0: Install a readable handler
      But in our case we almost always will have the case that
          0 < size < toRead
      IMO this should at least enable the -pollinterval option 
      to avoid microscopic writes.
      But I'm not sure, whether installing an event handler for 
      (0 < size < toRead) would help with the IDLE problem. 
      
      BTW there one more potential problem with fcopy, when 
      writing to a serial
      port:
      - The current (Tcl8.2-8.3) implementation of the serial 
        driver doesn't support non-blocking writes.
        That will be changed with TIP#35.
      
      Rolf.
      
      
      
    2. login: "schroedter"
    3. mimetype: "text/plain"
    4. username: "schroedter"
  7. Ticket change [6fffa4efa7] (rid 100401) by schroedter on 2001-10-08 15:50:28:

    1. icomment:
      Logged In: YES 
      user_id=99573
      
      IMO two changes are necessary to correct the behaviour 
      of fcopy for serial inputs:
      
      1. Avoid flooding the event queue:
      Change tclWinSerial.c that is doesn't queue readable
      events faster then [fconfigure -pollinterval].
      
      2. fcopy correction:
      In tclIO.c CopyData() shouldn't disable event checking 
      after reading (0 < size < toRead) bytes from the 
      serial port.
      
      I'm discussing that with Andreas Kupries.
      
      Rolf.
      
      
    2. login: "schroedter"
    3. mimetype: "text/plain"
    4. username: "schroedter"
  8. Ticket change [6eeb4c0503] (rid 100222) by schroedter on 2001-10-19 14:42:22:

    1. icomment:
      Logged In: YES 
      user_id=99573
      
      Here are the patches: bug219311_patch1.0.zip .
      It contains two *independent* patches:
      
      1. Bug #219311-A: Serial port may flood the event queue
         - tclWinSerial.c.patch: To be applied *after* TIP#35
      
      2. Bug ##219311-B: fcopy doesn't install readable 
      handler for continuous incoming data
         - tclIO.c.patch: Correct handling of the input channel if 
      (0<size<toRead)
         - io.test.patch: Added a test for this patch
      
      Rolf.
      
      
      
      
      
    2. login: "schroedter"
    3. mimetype: "text/plain"
    4. username: "schroedter"
  9. Add attachment "bug219311_patch1.0.zip" [2e2891c890] (rid 119175) by schroedter on 2001-10-19 14:43:45.

  10. Ticket change [12fe4cfe60] (rid 124142) by schroedter on 2001-10-19 14:43:46:

    1. icomment:
      
      
      File Added - 12192: bug219311_patch1.0.zip
      
      
      
    2. login: "schroedter"
    3. mimetype: "text/plain"
    4. username: "schroedter"
  11. Ticket change [56185d2547] (rid 94263) by schroedter on 2001-12-14 16:17:20:

    1. icomment:
      Logged In: YES 
      user_id=99573
      
      What prevents the patch from beeing implemented ?
      Rolf.
      
      
      
    2. login: "schroedter"
    3. mimetype: "text/plain"
    4. username: "schroedter"
  12. Ticket change [65818dcf71] (rid 102561) by andreas_kupries on 2001-12-15 00:07:58:

    1. icomment:
      Logged In: YES 
      user_id=75003
      
      I believe they pass the testsuite, do they not ?
      In that case I ask you to commit. If you don't
      want to do this, assign this item to me. But
      note that I am on vacation from Dec 18 to Jan 6
      and will be busy with preparing for this in the
      next days.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  13. Ticket change [9b654737ca] (rid 111112) by schroedter on 2001-12-17 13:44:44:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      Logged In: YES 
      user_id=99573
      
      Yes, they passed the tests on Linux and Win98/2000 in 
      October. Moreover a special test (io-53.7 flooding fcopy) 
      has been added.
      It would be fine, if you could apply the patch when you'll 
      back in January. Have a nice vacation.
      Rolf.
      
      
    3. login: "schroedter"
    4. mimetype: "text/plain"
    5. username: "schroedter"
  14. Ticket change [5c4a7dd550] (rid 115276) by andreas_kupries on 2001-12-18 05:56:19:

    1. closedate changed to: "2001-12-17T22:56:19"
    2. closer changed to: "andreas_kupries"
    3. icomment:
      Logged In: YES 
      user_id=75003
      
      Adapted patches to CVS head and committed.
      
      
    4. login: "andreas_kupries"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "andreas_kupries"
  15. Add attachment "bug219311_patch1.0.zip" [aeb25be002] (rid 170575) by chrstphrchvz on 2019-03-30 14:50:23.