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

History Of Ticket 1941063fffffffff

Artifacts Associated With Ticket 1941063fffffffff

  1. Ticket change [3c5a8b4ce5] (rid 120904) by nobody on 2008-04-12 21:21:10:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      With the Tcl HEAD from today with Ubuntu 7.0.4.  I ran make test 5 times and found this once:
      
      ==== exec-9.7 commands returning errors FAILED
      ==== Contents of test case:
      
          list [catch {exec [interpreter] "$path(sh)" -c "\"$path(echo)\" error msg 1>
      &2 ; \"$path(sleep)\" 1"  | [interpreter] "$path(sh)" -c "\"$path(echo)\" error 
      msg 1>&2 ; \"$path(sleep)\" 1"} msg] $msg
      
      ---- Result was:
      1 {error msg}
      ---- Result should have been (exact matching):
      1 {error msg
      error msg}
      ==== exec-9.7 FAILED
      
      
    4. foundin initialized to: "obsolete: 8.6a0"
    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: "nobody"
    10. subsystem initialized to: "16. Commands A-H"
    11. title initialized to: "test exec-9.7 fails randomly"
    12. type initialized to: "Bug"
  2. Ticket change [96a790b880] (rid 106357) by ferrieux on 2008-04-13 16:06:28:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Donal, two questions:
      
      (1) Scary. What about prio 9 ?
      
      (2)Isn't the test case itself risking a race ? Indeed, it spawns in parallel two instances of
      
          sh -c {echo error msg >&2;sleep 1}
      
      In this setup, descriptor 2 of both children is the err pipe to Tcl.
      Of course, those are small writes which are supposed to be atomic; but in principle nothing prevents the OS from doing a task switch in the middle. The result seen in $msg could then be any "crossover" like "errorerror msmsg
      g
      "
      I would have found much safer to have & child doing
           echo error msg >&2;sleep 1
      and the other one doing
           sleep 1;echo error msg >&2
      
      OK, now investigating, looking for the order of EOF and waitpid in the child-reaping process.
      Has this changed recently ?
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  3. Ticket change [60b46b74d9] (rid 116041) by ferrieux on 2008-04-13 16:58:56:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      To the OP: could you please send an strace -f -tt of the thing ?
      Thanks.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [5455151bc2] (rid 93929) by dkf on 2008-04-13 18:04:02:

    1. assignee changed to: "andreas_kupries"
    2. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      Individual writes *should* be atomic; the OS should serialize them.
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. subsystem changed to: "24. Channel Commands"
    7. username: "dkf"
  5. Ticket change [6ed71bf34f] (rid 100210) by das on 2008-04-14 05:18:36:

    1. icomment:
      Logged In: YES 
      user_id=90580
      Originator: NO
      
      this test has been failing intermittently on OSX for me for years, particularly frequently on multi-processor boxes... since I added the two sleeps ~1 month ago I have only seen it failing rarely.
      
      While I was fiddling with it I noticed that if the two messages are made distinct, I would frequently see the order of the messages reversed from what was expected (on a dual-core box)...
      
       
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  6. Ticket change [568cc1a5a5] (rid 94342) by ferrieux on 2008-04-14 06:05:52:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Hmmm, I'm wondering, doesn't all this look like an OS bug ?
      Couldn't we try to reproduce without Tcl ?
      
      Indeed, what we observe is similar to what happens when two processes write to the same file through two separately opened file descriptors; while the Tcl code properly uses a single fd that is dup2'ed to the 2's of all children. But since this apparently happens (only?) on bi-processor machines, it could also be interpreted as: buggy kernel code, failing to lock the SMP master lock when updating the seek pointer of the same undelying kernel-fd. The two processors, running in true parallelism, start with local copies of the seek pointer (both 0), and write the same bytes in parallel instead of sequence, hence the seek pointer ends up at the end of just one message.
      
      All this is wild speculation. I hope I'm wrong, and that SMP has been around for long enough that such trivial master lock issues are no longer thinkable. But...
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  7. Ticket change [edfe4a8579] (rid 104006) by dkf on 2008-04-14 15:35:15:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      Could it be that it's actually dependent on whether the error descriptor has the correct flags?  (I suspect that O_APPEND is needed when going to a file, for example.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Ticket change [84ff2f02b1] (rid 131249) by ferrieux on 2008-04-14 16:21:48:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      That couldn't explain the "race" nature...
      Or are you saying that yes, there's a kernel bug, and predicting that O_APPEND could drag it under the rug ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  9. Ticket change [98bd8798ef] (rid 110660) by ferrieux on 2008-04-14 17:10:29:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Oh, these SMP-seek issues seem to have been active not so long ago:
      
      http://osdir.com/ml/file-systems.pvfs2.users/2006-02/msg00003.html
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  10. Ticket change [a962efe14c] (rid 99141) by dkf on 2008-04-14 17:18:25:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      <sarcasm> A bug in the OS with SMP and appending? Who'd have thought it? </sarcasm>
      
      All we can really try for is doing the right thing ourselves; working around everyone else's bugs is something we should try to avoid (except on Windows, where the platform is fundamentally borkenated anyway...)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. priority changed to: "7 High"
    5. username: "dkf"
  11. Ticket change [f728feafbd] (rid 91331) by ferrieux on 2008-04-14 17:25:55:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Well, I'd like to be sure first:
      
          Please, "Nobody", whoever posted that report, come back !
      
      We definitely need somebody able to reproduce this, *and* an strace -tt -f.
      Only this will allow us to firmly blame the OS.
      
      Now regarding the possible workarounds, things are open.
      One possibility would be to verify (that's a personal prediction) that the bug doesn't happen on pipes, and modify the test case to use a pipe instead of Tcl's internal temporary file:
      
             set errpipe [open "|cat > $tmpfile" w]
             the_original_exec_command_line 2>@ $errpipe
      
      But let do the strace investigation first !
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  12. Ticket change [f440de52fc] (rid 129876) by ferrieux on 2008-04-14 17:27:58:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Well, I'd like to be sure first:
      
          Please, "Nobody", whoever posted that report, come back !
      
      We definitely need somebody able to reproduce this, *and* an strace -tt -f.
      Only this will allow us to firmly blame the OS.
      
      Now regarding the possible workarounds, things are open.
      One possibility would be to verify (that's a personal prediction) that the bug doesn't happen on pipes, and modify the test case to use a pipe instead of Tcl's internal temporary file:
      
             set errpipe [open "|cat > $tmpfile" w]
             the_original_exec_command_line 2>@ $errpipe
      
      But let do the strace investigation first !
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  13. Ticket change [29aecb34ad] (rid 88909) by ferrieux on 2011-09-24 05:16:07:

    1. closedate changed to: "2011-09-23T22:16:07"
    2. closer changed to: "ferrieux"
    3. icomment:
      Timing out on request for followups.
      
      
    4. login: "ferrieux"
    5. mimetype: "text/plain"
    6. resolution changed to: "Works For Me"
    7. status changed to: "Pending"
    8. username: "ferrieux"
  14. Ticket change [07f403312d] (rid 134179) by dkf on 2013-09-24 21:58:27:

    1. assignee changed to: "aku"
    2. closedate changed to: "2456560.41559933"
    3. closer changed to: "dkf"
    4. comment changed to:
      With the Tcl HEAD from today with Ubuntu 7.0.4.  I ran make test 5 times and found this once:
      
      ==== exec-9.7 commands returning errors FAILED
      ==== Contents of test case:
      
          list [catch {exec [interpreter] "$path(sh)" -c "\"$path(echo)\" error msg 1>
      &2 ; \"$path(sleep)\" 1"  | [interpreter] "$path(sh)" -c "\"$path(echo)\" error 
      msg 1>&2 ; \"$path(sleep)\" 1"} msg] $msg
      
      ---- Result was:
      1 {error msg}
      ---- Result should have been (exact matching):
      1 {error msg
      error msg}
      ==== exec-9.7 FAILED
      
    5. login: "dkf"
    6. mimetype: "text/plain"
    7. severity changed to: "Minor"
    8. status changed to: "Closed"