Skip to content
Tcl Source Code History Of Ticket 1939509fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1939509fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1939509fffffffffffffffffffffffffffffffff

  1. Ticket change [3361d40245] (rid 106586) by nobody on 2008-04-10 15:34:55:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Sender: Wolfgang Schmid
              Siemens AG
              Munich, Germany
      E-Mail: [email protected]
      Phone:  +49 89 636 41098
      
      
      "Tclsh83" and "tclsh85" hang in exec command, if running on multiprocessor platforms. (The test program is running on a Windows-2003-Server with 2 Dual-Core-Xeons without HyperThreading.)
      
      
      That's our test environment:
      
      ("load,bat" runs "tclsh85" with the script "testexec.tcl" in an endless; "testexec.tcl" starts 5 times a program (Dos-Batch-Script) using "exec" command; the DOS-Batch-Script simply does "exit 0"))
      
      load.bat: (to be called from DOS prompt):
      =========
      :loop
      
      D:\Tcl8.5.0\bin\tclsh85.exe clock.tcl>> trace.txt
      
      D:\Tcl8.5.0\bin\tclsh85.exe testexec.tcl
      
      goto loop
      
      
      testexec.tcl:
      =============
      
      set fd [open "traceexec.txt" "w"]
      
      puts $fd "\ncallexec 1 started"
      flush $fd
      
      set status [catch { exec ./callexec.bat p1 p2 } outcmd]
      
      puts $fd "status: $status, result: $outcmd"
      puts $fd "callexec 1 terminated"
      flush $fd
      
      
      # 5 times the same stuff as above
      
      
      close $fd
      exit 0
      
      
      
      callexec.bat:Batch-Script that does nothing:
      =============  
      
      @echo off
      
      rem echo "callproc started" >> callproc.txt
      
      exit 0
      
      
      Two trace file will be created:
      - trace.txt 
           contains time stamps when "tclsh85" is started
      - traceexec.txt
           contains loggings that "callexec.bat" was running and the appropriate exit codes
      
      
      After a short time (15 - 20 minutes), "tclsh85" hangs.
      ("No more trace entries are written to "trace.txt")
      
      Is there a chance of fining the error in Tcl8.3 ?
      
      Feel free to contact me via e-mail if information is missing.
      
      Regards,
      Wolfgang
      
      
    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: "nobody"
    10. subsystem initialized to: "16. Commands A-H"
    11. title initialized to: "Tcl hangs in "exec" (on multi-processor machines)"
    12. type initialized to: "Bug"
  2. Ticket change [6d7ae087dc] (rid 128706) by dkf on 2008-04-11 16:11:07:

    1. assignee changed to: "andreas_kupries"
    2. foundin changed to: "obsolete: 8.5.2"
    3. priority changed to: "9 Immediate"
    4. subsystem changed to: "24. Channel Commands"
  3. Ticket change [576950d41c] (rid 94485) by ferrieux on 2008-04-11 17:34:32:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Thanks for bumping it to prio 9 Donal, that's well deserved ;-)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  4. Ticket change [e05f82a60e] (rid 115180) by dkf on 2008-04-11 21:13:12:

    1. icomment:
      Logged In: YES 
      user_id=79902
      Originator: NO
      
      Someone's got to do bug triage, and crashes and hangs merit the highest priority initially.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [6902521e69] (rid 103169) by andreas_kupries on 2008-04-12 00:40:50:

    1. icomment:
      Logged In: YES 
      user_id=75003
      Originator: NO
      
      Note that I cannot help with this.
      I have no multi-core box.
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  6. Ticket change [48c89f0126] (rid 99957) by nobody on 2008-04-14 15:26:23:

    1. icomment:
      Logged In: NO 
      
      Small updates on the problem description (from Wolfgang Schmid):
      
      We tried to run the test scripts on different multi-processor platforms and came to the following results:
      - Windows Server 2003 (SP1) 32-Bit with 4 CPUs (Xeon): Test scripts are running fine; no problems with "exec"
      - Windows Server 2003 R2, Standard 64 Bit edition with 4 CPUs (Xeon): Test fails
      
      The problem seems to happen, if "tclsh" (32 bit application) is running on a 64 Bit machine.
      
      
      Furhtermore I provide a small update of the test scripts: (as there were small inconsistencies in the scripts.
      
      
      load.bat: (to be called from DOS prompt):
      =========
      :loop
      
      D:\Tcl8.5.0\bin\tclsh85.exe testexec.tcl >> trace.txt
      
      goto loop
      
      
      testexec.tcl:
      =============
      
      puts "started at [clock format [clock seconds]]"
      flush stdout
      
      set fd [open "traceexec.txt" "w"]
      
      for {set i 0} {$i < 5} {incr i} {
          puts $fd "\ncallexec $i started"
          flush $fd
      
          set status [catch { exec ./callexec.bat p1 p2 } outcmd]
      
          puts $fd "status: $status, result: $outcmd"
          puts $fd "callexec $i terminated"
          flush $fd
      }
      
      close $fd
      exit 0
      
      
      callexec.bat: 
      =============
      no changes
      
      
      
    2. login: "[email protected]"
    3. mimetype: "text/plain"
    4. username: "[email protected]"
  7. Ticket change [c67c7c2ccb] (rid 121779) by nobody on 2008-05-21 18:26:49:

    1. icomment:
      Logged In: NO 
      
      I have a similar problem, just under window XP (32 bit, dual core). Unix is fine.
      There are three scripts involved: A.tcl B.tcl D.tcl.
      D.tcl is a daemon and runs forever.
      A.tcl start B.tcl and waits on its return. B.tcl executes D.tcl in background
      (exec tclsh d.tcl). Then B.tcl calls exit, but A.tcl hangs in its exec call. 
      If D.tcl is not excuted, A.tcl doesn't hang. It is always reproducable. A.tcl seems 
      to hang on these lines from tclWinPipe.c:2899
      
      if (ReadFile(handle, NULL, 0, &count, NULL) == FALSE ||
      PeekNamedPipe(handle, NULL, 0, NULL, &count, NULL) == FALSE) {
      
      (There are three threads: PipeReaderThread, CallibrationThread, and TclTkProvide_Ex).
      
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  8. Ticket change [615f37aba5] (rid 92231) by fridolin on 2008-05-23 16:52:30:

    1. icomment:
      Logged In: YES 
      user_id=13583
      Originator: NO
      
      Update for the last comment: maybe this problem is not related to the orignal one, 
      because now I can reproduce it on a single core machine and under linux.
      
      a.tcl:
      exec wish b.tcl
      # exec never returns, but b.tcl calls "exit"
      tk_messageBox -message return
      
      b.tcl:
      exec wish d.tcl &
      tk_messageBox -message exit
      # message exit appears
      if { [catch exit err] } {
          # you could also replace this block with a plain "exit"
          tk_messageBox -message err=$err
      }
      
      d.tcl:
      tk_messageBox -message d.tcl
      vwait forever
      
      when exec hangs, ps shows a zombi process 'wish <defunct>'
      Any ideas? 
      
      
      Regards,
      Christoph Bauer
      
      
    2. login: "fridolin"
    3. mimetype: "text/plain"
    4. username: "fridolin"
  9. Ticket change [1b3716562b] (rid 123106) by ferrieux on 2008-08-21 06:00:49:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Just a reminder, this may be another facet of [Bug 1997007], the investigation of which is stalled for lack of an easy reproducing setup. All this smells like some fast sequence of Win32 calls near CreateProcess hit a race in the Vista kernel. Things like that can survive very long in a popular OS if the dominant usage is a different sequence...
      
      Anybody here knowing about Windows kernel-debugging ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  10. Ticket change [6cebb93585] (rid 128606) by ferrieux on 2008-08-21 06:02:03:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Just a reminder, this may be another facet of [Bug 1997007], the investigation of which is stalled for lack of an easy reproducing setup. All this smells like some fast sequence of Win32 calls near CreateProcess hit a race in the Vista kernel. Things like that can survive very long in a popular OS if the dominant usage is a different sequence...
      
      Anybody here knowing about Windows kernel-debugging ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  11. Ticket change [c302e6014c] (rid 111585) by ferrieux on 2009-03-26 21:29:08:

    1. icomment:
      In hindsight, it seems hard to reproduce (no other complaints), and possibly restricted to Vista (can you try on W7 beta?). So I'm starting to regret the prio-9 remark. Maybe we could downgrade it to 8 to leave room for real show-stoppers ?
      
      IOW: I can't imagine tracking this without support from a Vista kernel debugger and/or wizard !
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  12. Ticket change [539cfa00d8] (rid 93788) by ferrieux on 2009-05-01 00:01:51:

    1. icomment:
      Lowering to prio 8 for the reasons given before.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. priority changed to: "8"
    5. username: "ferrieux"
  13. Ticket change [319c2a2643] (rid 93457) by pherricoxide on 2009-09-24 06:31:50:

    1. icomment:
      I've experienced this same problem with both a TCL script calling the Cadence command line utility dsreportgen.exe using exec and also with a TCL script calling another tclsh85 process with exec. It is very intermittent though.
      
      Hardware,
      
      Windows Vista Business Service Pack 2
      Dual Intel Xeon L5408's
      8GB RAM
      
      If anyone could look into this it would really be appreciated.
      
      
    2. login: "pherricoxide"
    3. mimetype: "text/plain"
    4. username: "pherricoxide"
  14. Ticket change [94d79324e8] (rid 106066) by ferrieux on 2009-09-24 13:36:29:

    1. icomment:
      A good way to make progress would be to increase the probability of the bug, and also to try to correlate with timing aspects:
        - relative frequencies with the child being (a) dsreportgen, (b) tclsh and (c) cmd (bat files) ?
        - lifecycle in each case: is the child short or long-lived ? Do you spawn many of them quickly at the time of hang, or is it just an isolated [exec] ? If many, do you spawn them from the same parent or in parallel ones ?
      
      Other things to consider too:
       - try fiddling with the various compatibility and admin-rights flags of the parent and child executables
       - any possibility of trying Windows7 ?
       - any knowledge of advanced Windows kernel debugging tools (logging on serial port etc) ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  15. Ticket change [1bacb6f85a] (rid 123191) by ferrieux on 2010-06-13 00:34:03:

    1. icomment:
      Interestingly, forcing proc affinity to the child solves the deadlock:
      
      http://groups.google.com/group/comp.lang.tcl/tree/browse_frm/thread/0cff7fd479f75ea7/4332bb3a0d7ddefb?rnum=1&_done=%2Fgroup%2Fcomp.lang.tcl%2Fbrowse_frm%2Fthread%2F0cff7fd479f75ea7%2F975e5a2cb6c7b291%3F#doc_ac3dfecffa4a245d
      
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  16. Ticket change [ffaa438263] (rid 153490) by sebres on 2017-05-03 10:42:20:

    1. assignee changed to: "aku"
    2. closedate changed to: "2457876.94607473"
    3. closer changed to: "sebres"
    4. comment changed to:
      Sender: Wolfgang Schmid
              Siemens AG
              Munich, Germany
      E-Mail: [email protected]
      Phone:  +49 89 636 41098
      
      
      "Tclsh83" and "tclsh85" hang in exec command, if running on multiprocessor platforms. (The test program is running on a Windows-2003-Server with 2 Dual-Core-Xeons without HyperThreading.)
      
      
      That's our test environment:
      
      ("load,bat" runs "tclsh85" with the script "testexec.tcl" in an endless; "testexec.tcl" starts 5 times a program (Dos-Batch-Script) using "exec" command; the DOS-Batch-Script simply does "exit 0"))
      
      load.bat: (to be called from DOS prompt):
      =========
      :loop
      
      D:\Tcl8.5.0\bin\tclsh85.exe clock.tcl>> trace.txt
      
      D:\Tcl8.5.0\bin\tclsh85.exe testexec.tcl
      
      goto loop
      
      
      testexec.tcl:
      =============
      
      set fd [open "traceexec.txt" "w"]
      
      puts $fd "\ncallexec 1 started"
      flush $fd
      
      set status [catch { exec ./callexec.bat p1 p2 } outcmd]
      
      puts $fd "status: $status, result: $outcmd"
      puts $fd "callexec 1 terminated"
      flush $fd
      
      
      # 5 times the same stuff as above
      
      
      close $fd
      exit 0
      
      
      
      callexec.bat:Batch-Script that does nothing:
      =============  
      
      @echo off
      
      rem echo "callproc started" >> callproc.txt
      
      exit 0
      
      
      Two trace file will be created:
      - trace.txt 
           contains time stamps when "tclsh85" is started
      - traceexec.txt
           contains loggings that "callexec.bat" was running and the appropriate exit codes
      
      
      After a short time (15 - 20 minutes), "tclsh85" hangs.
      ("No more trace entries are written to "trace.txt")
      
      Is there a chance of fining the error in Tcl8.3 ?
      
      Feel free to contact me via e-mail if information is missing.
      
      Regards,
      Wolfgang
      
    5. icomment:
      fixed in core-8-5-branch-fix-1997007 (and in fix-1997007 for 8.6/trunk)
      
    6. login: "sebres"
    7. mimetype: "text/plain"
    8. resolution changed to: "Fixed"
    9. severity changed to: "Minor"
    10. status changed to: "Closed"