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
Jeffrey Hobbs
68. Win Window Operations
obsolete: 8.4.15
Public
|
Date: 2007-10-10 13:46
|
|
Date: 2007-09-20 09:13
|
| Field | Old Value | Date | By |
|---|---|---|---|
| category_id | None | 2007-08-26 21:42 | dkf |
| artifact_group_id | None | 2007-08-26 21:42 | dkf |
| priority | 5 | 2007-08-26 21:42 | dkf |
| assigned_to | nobody | 2007-08-26 21:42 | dkf |
| summary | GUi freezes in some laptops running Windows | 2007-08-22 08:58 | pbmm |