Overview
| Artifact ID: | 92e60b08f44db1f6b91af708c307592998a0a4df |
|---|---|
| Ticket: | 1845108fffffffffffffffffffffffffffffffff
FilterInputBytes/GetInput do not handle EINTR |
| User & Date: | jnewbern on 2007-12-05 20:30:37 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
Using tcl8.4.14 on Ubuntu 7.10 (Linux kernel 2.6.22) In interactive mode, the TCL shell blocks in a read() system call waiting for a command to be typed. If a signal is received, the read() call returns EINTR (see note 1) to indicate that the system call was interrupted. The code in FilterInputBytes does not test for the EINTR error code -- it treats it like a hard error even though other routines in the same file which use GetInput do handle the EINTR case. This makes it impossible to use a signal handler with an interactive TCL application. Even if the signal is caught and handled correctly by the application, the interrupted read() syscall will return EINTR and this will be treated like a hard error, dumping me out of the interpreter without a chance to restart the read() call. The behavior I expect is that TCL should detect the EINTR error code and restart the interrupted read(). In my case, I am installing a handler for SIGINT, so that I can catch and make use of a Ctrl-C from the keyboard to safely abort a long-running command. Unfortunately, it currently has the effect of aborting the entire TCL session as well, due to this bug. Thanks, Jeff Newbern [email protected] Note 1: Actually on my system it returns ERESTARTSYS due to a kernel bug, but this is a separate issue from the TCL bug, which remains even after the kernel is fixed.
- foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "jnewbern"
- subsystem changed to: "25. Channel System"
- title changed to: "FilterInputBytes/GetInput do not handle EINTR"
- type changed to: "Bug"