From: <no...@so...> - 2001-10-25 03:54:40
|
Bugs item #471374, was opened at 2001-10-15 10:27 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=471374&group_id=10894 Category: 23. Channel Commands Group: 8.4a3 Status: Open Resolution: None Priority: 5 Submitted By: Christopher Nelson (chris_nelson) Assigned to: Andreas Kupries (andreas_kupries) Summary: Child process doesn't detach with & Initial Comment: On at leats Soliaris (`uname -a` gives "SunOS urchin 5.8 Generic_108528-05 sun4u sparc SUNW,UltraSPARC-IIi-Engine"), scripts which start children with & to background and detach the child process seem to hand on some channel i/o when backgrounded. A sample parent script: set wish [file join [file dirname [info nameofexecutable]] wish] set script execTestChild.tcl set options [list >& /dev/null &] eval exec [list $wish $script] $options after 30000 A stupid child script: tk_messageBox -message "I'm the child" exit Now, run the parent with: tclsh execTest.tcl & In 8.4a3, when the after has expired and the parent wants to exit, it hangs. `jobs` reports: [1] + Suspended (tty output) ... Furthermore, the child freezes. If a window is put over the message box and removed, the message box does not redraw. Foregrounding the parent and letting it terminate lets the child redraw. (Note that there is no actual output from the parent when it it foregrounded.) This behavior is not seen in 8.2. That is, in 8.2, the parent exits cleanly without the tty output suspension and the child appears to be properly detached. ---------------------------------------------------------------------- >Comment By: Andreas Kupries (andreas_kupries) Date: 2001-10-24 20:54 Message: Logged In: YES user_id=75003 I remember that I made a stab at the bug which introduced this problem and gave up when Donal came with his solution and it worked. I believe it is the change in Tcl_MakeFileChannel which causes this. The child calls TclpGetDefaultStdChannel () for its stdin, this in turn goes through Tcl_MakeFileChannel (). Since v1.20 this now detects and configures the channel as tty. The essential difference is that now the os handle is queried for the tty configuration. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2001-10-24 09:27 Message: Logged In: YES user_id=80530 It refers to Tcl Patch 219137. http://sf.net/tracker/index.php?func=detail&aid=219137&group_id=10894&atid=310894 ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2001-10-24 08:54 Message: Logged In: YES user_id=107514 Building Tcl 8.4a3 with 1.19 of tclUnixChan.c seems to fix the problem. That fixes it for _us_ for the time being but I'll try to spend _some_ time figuring out what about tclUnixChan.c v1.20 is broken. BTW, I can't find a bug 219137 as mentioned below and in the Tcl ChangeLog. tclUnixChan.c v1.20 is supposed to address that bug but I can't figure out what it's about. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2001-10-23 15:27 Message: Logged In: YES user_id=80530 Confirmed this bug was introduced somewhere between the Tcl 8.4a2 and Tcl 8.4a3 releases. Suspects (see ChangeLog): Patch 402924 Bug 219137 Patch 442636 ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2001-10-23 13:52 Message: Logged In: YES user_id=80530 Ah! Now I can confirm the problem in the current HEAD. No bug in Tcl 8.3.4 though. Now tracking down the various Tcl 8.4aX releases... ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2001-10-23 13:46 Message: Logged In: YES user_id=107514 Thanks, Don. I'm an idiot. You have to invoke the script with: tclsh execTest.tcl & (That is, it must be backgrounded.) ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2001-10-23 13:39 Message: Logged In: YES user_id=80530 I cannot reproduce this using Tcl 8.4a3 (or any other Tcl) on SunOS ... 5.8 Generic_108528-10 sun4u sparc SUNW,Ultra-80 ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2001-10-15 13:45 Message: Logged In: YES user_id=107514 I think you are mistaken (or this is a different problem). I've reduced this to: exec emacs foo.test >& /dev/null & after 15000 which I invoke with: tclsh execTest.tcl After 15 seconds, tclsh goes suspended and the emacs window won't update. When I fg the tclsh, it terminates cleanly (with no output) and the emacs window is responsive again. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2001-10-15 13:33 Message: Logged In: YES user_id=80530 Unless I'm mistaken, this is a bug in wish (thus Tk) not in Tcl/tclsh. See http://sf.net/tracker/index.php?func=detail&aid=465761&group_id=12997&atid=112997 ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2001-10-15 10:37 Message: Logged In: YES user_id=107514 This also fails on HP-UX (HP-UX xxxx B.10.20 A 9000/715 2002497068 two-user license), AIX (AIX xxxx 3 4 003C87964C00), and Linux (Linux xxxx.pinebush.com 2.2.17-8enterprise #1 SMP Fri Nov 17 16:02:20 EST 2000 i686 unknown). ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=471374&group_id=10894 |