From: SourceForge.net <no...@so...> - 2007-09-20 09:13:28
|
Bugs item #1779265, was opened at 2007-08-22 10:57 Message generated for change (Comment added) made by mgma You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1779265&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 68. Win Window Operations Group: current: 8.4.15 Status: Open Resolution: None Priority: 8 Private: No Submitted By: Pablo Muñoz (pbmm) Assigned to: Jeffrey Hobbs (hobbs) Summary: GUI freezes in some laptops running Windows Initial Comment: There is a strange problem that only occurs in some notebooks running Windows. I have a Tcl/Tk application that executes another one using 'open |<command> r+', the pipe returned by open is used to communicate to the standard input/output of the new process. The second process works fine until any key is pressed when any of its windows owns the focus, then the GUI freezes. But if something is written in its 'stdin' it wakes up, then the key event is received, and everything works again. After that no more key presses causes a freeze. This pair of Tcl files recreates the error: ########################################## ## File run-hello.tcl proc read-pipe {pipe} { if {![eof $pipe]} { puts [gets $pipe] } else { close $pipe } } set pipe [open "| tclsh.exe hello.tcl" r+] fconfigure $pipe -buffering line fileevent $pipe readable [list read-pipe $pipe] package require Tk button .b -text {Send -wake up-} -command [list puts $pipe {wake up}] pack .b ########################################## ########################################## ## File hello.tcl proc read-pipe {pipe} { if {![eof $pipe]} { puts [gets $pipe] } else { close $pipe } } fileevent stdin readable {read-pipe stdin} package require Tk button .b -text Hello -command {puts Hello!} pack .b ########################################## This code seems to be correct and it works fine in Unix and most Windows machines, it only hangs in some laptops running Windows. The laptop were I detected the bug, is a Compaq nc6400. But I know it happened also in an IBM Thinkpad. I have tested it with some versions of tcl, and the problem has always appeared: ActiveTcl 8.4.7 ActiveTcl 8.4.15 dqkit 8.4.13 tclkit 8.5.a6 OS version: Windows XP Professional SP2 Other info: env(PROCESSOR_ARCHITECTURE) = x86 env(PROCESSOR_IDENTIFIER) = x86 Family 6 Model 14 Stepping 8, GenuineIntel env(PROCESSOR_LEVEL) = 6 env(PROCESSOR_REVISION) = 0e08 tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.1 tcl_platform(platform) = windows tcl_platform(wordSize) = 4 ---------------------------------------------------------------------- Comment By: mgma (mgma) Date: 2007-09-20 11:13 Message: Logged In: YES user_id=1556756 Originator: NO We've gathered some more information about the bug. Maybe you find it useful. First, we've detected this issue in two other laptop models: Dell Latitude D620 and Toshiba Tecra running Windows. Sorry but we don't have additional information about software versions, apart from the Tcl data given by Pablo. And also I give you some more details about the workaround found by Pablo. Maybe it gives you some clue. When the child interpreter is blocked, if the parent sends an end-of-line character through the pipe the child unblocks and becomes responsive again. So what we do is to have the parent application sending periodically a keep-alive message to the child. Once the child interpreter has blocked and unblocked, it never blocks again when you use the keyboard. Kind regards, Miguel ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=1779265&group_id=12997 |