Skip to content
Tcl Source Code History Of Ticket 1932639
Login

History Of Ticket 1932639

Artifacts Associated With Ticket 1932639

  1. Ticket change [7b19a96058] (rid 90460) by ferrieux on 2008-04-02 20:49:20:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      In the course of the investigation for [Bug 780533], I
      stumbled upon the following weirdness of the implementation (quoting
      myself since nobody answered that part ;-):
      
      > A side-note about the implementation: if I read correctly, the
      > asynchronous [fcopy] does its first chunk synchronously (in
      > non-blocking mode). This is a bit unusual in event-driven style: setup
      > procedures just set things up, the real work being done only from
      > within [vwait]. While here, a small bit of the copy may be done
      > immediately, even if the program doesn't call vwait before some
      > time...
      > Why is it done this way ? To factor code between sync and async cases ?
      > Do we want it to be this way ? Could it explain nasty context-dependent bugs ?
      
      Now, I'd like to pour in additional evidence that this is just plain wrong.
      
      The idea is that, since [fcopy -command] is both sync and async, an
      error raised in the callback may pop out either synchronously (subject
      to a catch on [fcopy] itslef) or asynchronously (subject to bgerror):
      
      1) Fast transfer (2 bytes):
      
       % proc plop args {puts stderr PLOP:$args;set ::done 1;error yo}
       % set f [open ha r]
       % set n [open nul: w]
       % fconfigure $f -translation binary
       % fconfigure $n -translation binary
       % fcopy $f $n -size 2 -command plop
      PLOP:2
      
       % puts $::errorInfo
      
         while executing
      "fcopy $f $n -size 2 -command plop"
      
      (notice also that the error status is lost, while errorInfo is OK. Yet
      another bug.)
      
      2) Slow transfer (20000 bytes)
      # do the same with -size 20000 and a file longer than that
       - fcopy returns control without PLOP
       - you need to enter a vwait to get the PLOP
      
       (yuck -- the error is lost again; but if it wasn't, it'd be a bgerror)
      
      Questions:
      
       - Is the disabling of errors in the callback intentional, in order to
      hide that catch/bgerror dichotomy ?
      
       - If not, would you accept a patch straightening both issues simultaneously by:
      
            - removing the sync part of [fcopy -async]
            - re-enabling errors in the callback (hell if I know how to do
      this right now)
      
      This way, both examples above would end up in bgerror.
      (Needless to say, I volunteer for the patch)
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "ferrieux"
    10. subsystem initialized to: "24. Channel Commands"
    11. title initialized to: "Mixed sync/async [fcopy -command]"
    12. type initialized to: "Bug"
  2. Add attachment "fcopy-async.patch" [9d1a7ed101] (rid 96252) by ferrieux on 2008-04-03 05:02:41.

  3. Ticket change [5d71f0b41f] (rid 115464) by ferrieux on 2008-04-03 05:02:41:

    1. icomment:
      
      
      File Added - 272954: fcopy-async.patch
      
      Logged In: YES 
      user_id=496139
      Originator: YES
      
      Fixed.
      
      The attached patch fixes the issue of unwanted synchronous part.
      The error suppression in the sync case was due to the fact that the code always called TclBackgroundException, regardless of the potentially synchronous status. This makes me think that the synchronous part was not intentional.
      The bgerror works now. I mistakenly thought there was also error suppression in that case, dur to yet anothe bug not yet entered (the strange lappend-like concatenation of arguments to the callback, preventing callbacks like {puts FOO;error BAR}).
      
      The patch is against vanilla code (without the -command patch), and includes the -command patch.
      If you apply it against patched version, prepare for and ignore a failed hunk on the cmdPtr test.
      
      Test suite OK.
      File Added: fcopy-async.patch
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Add attachment "fcopy-async-tcl8.4.patch" [acd1e4bc8e] (rid 101364) by andreas_kupries on 2008-04-03 05:45:27.

  5. Ticket change [142301982e] (rid 124339) by andreas_kupries on 2008-04-03 05:45:27:

    1. icomment:
      
      
      File Added - 272961: fcopy-async-tcl8.4.patch
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  6. Ticket change [1bcbc4670b] (rid 123210) by andreas_kupries on 2008-04-03 05:45:28:

    1. icomment:
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      File Added: fcopy-async-tcl8.4.patch
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  7. Add attachment "fcopy-async-tcl8.5.patch" [b2bcc311de] (rid 98395) by andreas_kupries on 2008-04-03 05:45:57.

  8. Ticket change [4ddd3e0c43] (rid 127129) by andreas_kupries on 2008-04-03 05:45:57:

    1. icomment:
      
      
      File Added - 272962: fcopy-async-tcl8.5.patch
      
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      File Added: fcopy-async-tcl8.5.patch
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  9. Add attachment "fcopy-async-tcl8.6.patch" [0b71e3e604] (rid 113987) by andreas_kupries on 2008-04-03 05:46:13.

  10. Ticket change [45368b51c8] (rid 116842) by andreas_kupries on 2008-04-03 05:46:14:

    1. icomment:
      
      
      File Added - 272963: fcopy-async-tcl8.6.patch
      
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      File Added: fcopy-async-tcl8.6.patch
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  11. Ticket change [f25cb30806] (rid 109524) by andreas_kupries on 2008-04-03 06:37:48:

    1. icomment:
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      Confirm that patched Tcl core passes the regular testsuite. Tested for 8.4, 8.5, Head, non-threaded, non-debug build, linux.
      
      Alexandre, do you have a small test script we could add to the testsuite, which demos the new bgerror handling (and would fail pre-patch)?
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  12. Add attachment "fcasync.tcl" [06542e7e49] (rid 89208) by ferrieux on 2008-04-03 16:49:39.

  13. Ticket change [90a6f4510c] (rid 120488) by ferrieux on 2008-04-03 16:49:40:

    1. icomment:
      
      
      File Added - 273031: fcasync.tcl
      
      Logged In: YES 
      user_id=496139
      Originator: YES
      
      Attaching a test script.
      It tests two separate things: (1) suppression of the synchronous part (2) bgerror.
      What you will see, is that (1) was clearly not working before the patch (detected by the growth of the output file), but (2) worked anyway because of the other bug prevented the callback from firing in the synchronous part ! Of course, my previous patch made (2) reappear :-)
      
      In summary:
      - use stock Tcl to see 1=FAILURE 2=SUCCESS
      - use [-command] patch to see 1=FAILURE 2=FAILURE
      - use this patch to see 1=SUCCESS 2=SUCCESS
      
      
      File Added: fcasync.tcl
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  14. Ticket change [fab710aa66] (rid 91926) by andreas_kupries on 2008-04-04 00:42:40:

    1. icomment:
      
      
      File Added - 273099: final-fcopy-async-patches.tar.gz
      
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      File Added: final-fcopy-async-patches.tar.gz
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  15. Add attachment "final-fcopy-async-patches.tar.gz" [51e390e919] (rid 126206) by andreas_kupries on 2008-04-04 00:42:40.

  16. Ticket change [634cc293d1] (rid 92551) by andreas_kupries on 2008-04-04 01:08:05:

    1. icomment:
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      Well, the final patches are not quite final. For 8.5/Head copy the nerw testcase to chanio.test and tweak a bit for use of the 'chan' command. committed to 8.4, 8.5, and Head. All passing the extended testsuite.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  17. Ticket change [74978be509] (rid 105229) by andreas_kupries on 2008-04-04 01:08:06:

    1. closedate changed to: "2008-04-03T18:08:06"
    2. closer changed to: "andreas_kupries"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"