Skip to content
Tcl Source Code History Of Ticket 2444274fffffffff
Login

History Of Ticket 2444274fffffffff

Artifacts Associated With Ticket 2444274fffffffff

  1. Ticket change [41ad9f6bd2] (rid 116233) by dgp on 2008-12-18 04:15:45:

    1. assignee initialized to: "ferrieux"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      Sometime after test chan-io-73.1
      passes, an error aborts the evaluation
      of chanio.test:
      
      ---- chan-io-73.1 start
      ++++ chan-io-73.1 PASSED
      Test file error: error flushing "file5": broken pipe
          while executing
      "chan flush $f"
      
      The error message is mysterious
      since it blames a [chan flush]
      command, and there are no visible
      [chan flush] commands in the part
      of chanio.test that follows test
      chan-io-73.1.  Perhaps its in the
      body of some proc, or in some trace
      handler, but in those cases I'd expect
      a longer stack trace revealing that
      context as well.
      
      Based on the timing only, I suspect
      the TIP 332 commit is to blame.
      
      
      
      
    4. foundin initialized to: "obsolete: 8.6a4"
    5. is_private initialized to: "0"
    6. priority initialized to: "9 Immediate"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "dgp"
    10. subsystem initialized to: "25. Channel System"
    11. title initialized to: "chanio.test file error"
    12. type initialized to: "Bug"
  2. Ticket change [02116a1a19] (rid 119582) by dgp on 2008-12-18 12:12:47:

    1. icomment:
      
      the error appears to arise
      not during evaluation of
      chanio.test, but in the
      command [close $pipeFd] at
      line 2767 of tcltest.tcl
      in the tcltest package.
      
      The error message is still broken.
      
      The fact that only chanio.test
      suffers, indicates there's some
      interaction with it going on.
      
      Attempts to learn more with the
      -singleproc 1 option led to more
      confusion.  There's some nastiness
      here where tricky testing of things
      like std channels and their flush
      patterns (?) are getting messed
      with while the testing harness
      needs them functioning reliably.
      Maybe?
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [bcc2dce0d3] (rid 101809) by dgp on 2008-12-18 12:32:45:

    1. icomment:
      
      some indications the 
      original [chan flush]
      error happens in test
      chan-io-29.31.  Don't know
      why it's escaping to stderr
      at all, let alone at unpredictable
      times.
      
      Even weirder:
      $ make test TESTFLAGS="-file chanio.test -singleproc 1 -verbose bpste -skip chan-io-29.31"
      ...
      ---- chan-io-29.35 start
      could not find interpreter "y"
          while executing
      "interp delete y"
      ++++ chan-io-29.35 PASSED
      ...
      
      Some partial stack trace just
      thrown out there on some visible
      channel, but with no test failure,
      nor any test file error reported.
      
      I can't get a handle on things, but
      indications are there's some significant
      troubles in the recent commit.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [3ad42fee8e] (rid 112627) by ferrieux on 2008-12-18 16:53:48:

    1. icomment:
      FWIW, disabling test chan-io-28.6 (half-close) makes the problem disappear.
      Just committed this change to avoid polluting others' lives.
      But I'm not pulling it under the rug :-)
      Investigation ongoing...
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Ticket change [a0a065674d] (rid 96848) by ferrieux on 2008-12-18 17:23:23:

    1. icomment:
      Strace investigation shows that the original "broken pipe" occurs in chanio-29.27.
      Strangely, the error mentions "file5" while the EPIPE occurs on descriptor 4:
      
       9927  10:34:27.076443 write(4, "output\n", 7) = -1 EPIPE (Broken pipe)
       9927  10:34:27.076472 --- SIGPIPE (Broken pipe) @ 0 (0) ---
       ...
       9927  10:34:27.077022 write(1, "++++ chan-io-29.27 PASSED\n", 26) = 26
      
      So I suspect incorrect cleanup in the channel system during half-close.
      For this I'd like Andreas' help since he wrote the generic layer of #332.
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  6. Ticket change [7a77c4f9a6] (rid 90325) by ferrieux on 2008-12-18 20:34:21:

    1. icomment:
      Homing in on the 6-legged animal:
      
       set f [open "|echo" r+]
       gets $f
       after 1000
       puts $f yay
       close $f w
      ==> should flush and report EPIPE
      ==> but doesn't complain
       close $f 
      ==> barfs "bad file number"
      
      Shouldn't be long now :)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  7. Ticket change [ca1449dee0] (rid 122400) by ferrieux on 2008-12-18 20:59:26:

    1. icomment:
      OK confirmed, it's the same bug as mentioned in the patch entry, re the crash on [close w] of an unflushed channel: currently the Flush is ill-positioned within  the tearoff sequence, occurring too late.
      Will try to refactor alone in the absence of Andreas, but help welcome.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  8. Ticket change [61cce90892] (rid 92311) by ferrieux on 2008-12-19 00:00:57:

    1. icomment:
      Just committed code doing a specific flush in the half-close-w pathway (because the normal flush is inside UnregisterChannel which must not be called for the "first half").
      Andreas can you verify I'm doing it right, because I don't grok the subtleties of flagging blocks READY nor Tcl_Flush vs FlushChannel etc.
      
      This doesn't solve the bug obtained when re-enabling chanio-28.6 though.
      
      My investigation so far seems to indicate we are witnessing a "ghost error status" in a stale channel-related structure.
      By this I mean, the _message_ is from an innocuous, previously caught error (a [chan flush] in a previous test), while possibly the TCL_ERROR status is fresh and is the core of the bug.
      
      The error goes to the child tcltest's stderr because it occurs within a vwait (hence a bgerror or default C-level background error handler must be just spitting to stderr).
      The vwait is:  vwait [namespace which -variable counter]  (near the end of chanio-29.31).
      
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  9. Ticket change [869e015320] (rid 131547) by ferrieux on 2008-12-19 01:25:33:

    1. icomment:
      New data point: I have played a bit with chanio.test, re-enabling 28.6 and skipping 28.7..29.30.
      In 29.31 where the offending vwait is, I added:
      
        proc myhan args {exec echo "BGERROR:$args >>> $::errorInfo <<<" > /dev/tty}
        interp bgerror {} [namespace which myhan]
      
      this has the nice property of spitting out synchronously (which I find pretty hard to do in tcltest):
      
      ---- chan-io-29.31 start
      BGERROR:{} {-code 0 -level 1} >>> can't read "ConstraintInitializer(asyncPipeChan)": no such element in array
          while executing
      "return $ConstraintInitializer($constraint)"
          (procedure "ConstraintInitializer" line 5)
          invoked from within
      "ConstraintInitializer $n2" <<<
      ++++ chan-io-29.31 PASSED
      
      I notice an empty direct error message and a ghost errorInfo...FWIW
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  10. Ticket change [310c305853] (rid 93357) by dgp on 2008-12-19 02:39:05:

    1. icomment:
      
      While this won't solve the underlying
      bug, if tcltest is getting confused
      due to writes to stderr from background
      error reporting, then setting an
      [interp bgerror] handler to avoid that
      during those tests should at least be
      an improvement while the real bug is
      tackled.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  11. Ticket change [c0442e8792] (rid 102376) by dgp on 2008-12-19 02:42:27:

    1. icomment:
      
      You should not expect the $::errorInfo
      seen in an [interp bgerror] handler to
      be in sync.  [interp bgerror] handlers
      are supposed to pull errorinfo data
      out of the second dict argument.
      
      The weird thing is the indication that
      the handler is being called when there's
      no exception for it to report.  Arguments
      indicate a TCL_OK return code and an
      empty result.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [a2bc1fa5b9] (rid 109945) by dgp on 2008-12-19 04:13:54:

    1. icomment:
      
      dropping prio just a tiny bit
      since this no longer prevents
      a(n apparent) clean test suite run.
      
      Bugs should still get fixed
      of course, but if it's hard
      enough to take a while fixing,
      I don't think we need to 
      block 8.6b1 (which no one expects
      to be bug free) waiting for
      the fix.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "8"
    5. username: "dgp"
  13. Ticket change [4a0cefd62f] (rid 126467) by andreas_kupries on 2008-12-19 05:07:17:

    1. icomment:
      Put the script from 'Homing in on ...' into a script hc1.tcl.
      Running it with the rewrite as explained in the mail ...
      
      andreask@gila:~/workbench/HalfClose/build/tcl86> ./tclsh hc1.tcl
      broken pipe
          while executing
      "close $f w"
          (file "hc1.tcl" line 5)
      
      
      Which is the expected result. Next now to test the chan-io-28.* cases.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. priority changed to: "9 Immediate"
    5. username: "andreas_kupries"
  14. Ticket change [131ee005d7] (rid 124163) by andreas_kupries on 2008-12-19 05:53:03:

    1. icomment:
      Ok, fixed a missing initialization and a place where a flag name was not properly modified, and the two chan-io-28.[67] test cases pass as well.
      
      What I still have is
      
      ++++ chan-io-73.1 PASSED
      Test file error: can't read "ConstraintInitializer(asyncPipeChan)": no such element in array
          while executing
      "return $ConstraintInitializer($constraint)"
          (procedure "ConstraintInitializer" line 5)
          invoked from within
      "ConstraintInitializer $n2"
      error flushing "file5": broken pipe
          while executing
      "chan flush $f"
      
      
      Running with -singleproc 1 this vanishes ... Checking. Yes, this is written to stderr by something ... 
      
      Ok, we have _two_ places writing to stderr.
      
      One, during chan-io-28.7 we get
      Test file error: can't read "ConstraintInitializer(asyncPipeChan)": no such element in array
          while executing
      "return $ConstraintInitializer($constraint)"
          (procedure "ConstraintInitializer" line 5)
          invoked from within
      "ConstraintInitializer $n2"
      
      And two, 
      error flushing "file5": broken pipe
          while executing
      "chan flush $f"
      comes from io-29.31
      
      I ran the chanio file with -singleproc 1 -verbose bpste, then captured stdout and stderr in one file to get the proper order.
      
      So, even with the rewrite this ghost thing is still present. Digging on ...
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. priority changed to: "8"
    5. username: "andreas_kupries"
  15. Ticket change [b3ce9749b5] (rid 124917) by andreas_kupries on 2008-12-19 06:13:38:

    1. icomment:
      The first output to stderr is something which points into tcltest ...
      Note: Using tclsh as shell in test cases is not good, it uses whatever it finds in the PATH.
      Changed to [interpreter], which is a command to get the current executable.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  16. Ticket change [91001395a4] (rid 120557) by dgp on 2008-12-19 06:15:23:

    1. icomment:
      
      Commit what you have and I will
      look into the background error
      troubles.  I suspect you are
      expressing concern about normal
      background handling behavior.
      
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  17. Ticket change [da380eb58e] (rid 107737) by ferrieux on 2008-12-19 06:23:23:

    1. icomment:
      FWIW, the background reporting is not mysterious; [interp bgerror] actually keeps it under control instead of confusing us by going to stderr and being delayed to the end of the test. So in my bg handler (in 29.31) I used the [testpanic] trick you gave me on the chat, and got a core with an explorable stack frame. Andreas/Don maybe you can do the same and understand what exactly is the cause of this ghost background error ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  18. Ticket change [26969b2c5b] (rid 88368) by dgp on 2008-12-19 06:28:04:

    1. icomment:
      
      background error handling is
      done asynchronously!  This may
      be confusing or unexpected, but
      it is not a bug.  I have not
      taken time to confirm, but I suspect
      all this talk of "ghost errors"
      is normal functioning of an
      asynchronous reporting mechanism.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  19. Ticket change [959bc96bab] (rid 106183) by andreas_kupries on 2008-12-19 06:28:49:

    1. icomment:
      Instrumenting the test case ...
      
      ~~~~~~~~~~~~~~~~~~~~~~~
      ---- chan-io-28.7 start
      MAKE/ECHO
      OPEN/PIPE/ECHO
      GETS/PORT
      OPEN/SOCK
      PUTS/HEY
      PIPE/CLOSE
      SETUP/LOOP
      LOOP
      can't read "ConstraintInitializer(asyncPipeChan)": no such element in array
          while executing
      "return $ConstraintInitializer($constraint)"
          (procedure "ConstraintInitializer" line 5)
          invoked from within
      "ConstraintInitializer $n2"
      CLOSE/SOCK
      CLOSE/PIPE
      DONE
      ++++ chan-io-28.7 PASSED
      ~~~~~~~~~~~~~~~~~~~~~
      
      This is something written during the vwait event loop.
      
      Ah. The error message is by 'chan-io-28.3', which is a skipped test. And is was skipped because of missing constraint asyncPipeChan. And the 28.7 test case somehow writes this to stderr ... Hrrm.
      
      Note: Just running test 28.[367] generates the output. Running [67] generates a different output about a missing interpreter "z". Running 7 alone is ok.
      
      Note: Looking at 28.[67] I see that the 'after 1000 ...' events are not canceled!! This can (well, with murphy, will) cause breakage in any other test coming later and using vwait on the same variable. Fixed that. Doesn't fix the isssue at hand however.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  20. Ticket change [a3d92965e7] (rid 110107) by andreas_kupries on 2008-12-19 06:36:43:

    1. icomment:
      Oi. I should read SF more often. I missed all the discussion regarding bgerror and such.
      Ok. I will undo my instrumentation, leave in the after cancel's I added and then
      commit the fixes.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  21. Ticket change [7a04c5b921] (rid 90233) by andreas_kupries on 2008-12-19 06:50:22:

    1. icomment:
      Committed my changes.
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  22. Ticket change [36bd3d6ac6] (rid 107160) by ferrieux on 2008-12-19 07:39:43:

    1. icomment:
      Thanks. First off, chanio-28.7 still fails on Windows (mingw): nothing is received back from the server.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  23. Ticket change [823aee92a0] (rid 117196) by andreas_kupries on 2008-12-19 08:33:46:

    1. icomment:
      Ok, this is now going into places (Windows, Windows Pipes) I have no real knowledge off. I could try tomorrow, when I am back in the office, at a Win system, however no promises there. tclguy and davygrvy are likely better suited.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  24. Ticket change [24979e6e5e] (rid 131134) by dgp on 2008-12-19 10:31:06:

    1. closedate changed to: "2008-12-19T03:31:06"
    2. closer changed to: "dgp"
    3. icomment:
      
      tests chan-io-28.[67] both
      had [chan event] handler scripts
      that returned the TCL_RETURN
      error code.  That's the source
      of the reporting of historical
      stack traces to stderr.
      
      Committing fix for that.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Pending"
    8. username: "dgp"
  25. Ticket change [4b5d0dda70] (rid 126697) by ferrieux on 2008-12-19 14:28:47:

    1. icomment:
      Yikes !
      
      Don, can you elaborate ? I mean, I can see you have removed my [return]s from the fileevent handlers, but what's the bottom line ?
      Surely it is nowhere documented as forbidden to use [return] in a fileevent... So what exactly is the set of circumstances which turn a TCL_RETURN into a ghost error ? Tcltest only ? Other ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  26. Ticket change [19021bd61e] (rid 122751) by dgp on 2008-12-19 21:04:07:

    1. icomment:
      
      Alex, we'll track that at 2449154.
      But *not* until after 8.6b1 is
      out the door.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "dgp"
  27. Ticket change [2735f6d908] (rid 88482) by dgp on 2008-12-19 21:21:28:

    1. closedate changed to: "2008-12-19T14:21:28"
    2. closer changed to: "dgp"
    3. status changed to: "Closed"