Skip to content
Tcl Source Code View Ticket
Login

View Ticket

GetInput() doesn't allow for result=EINTR

Closed / Fixed218076ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:54
OriginalBugID: 1631 Bug
Version: 8.0.3
SubmitDate: '1999-03-25'
LastModified: '2000-10-25'
Severity: SER
Status: Closed
Submitter: pat
OS: HP-UX
OSVersion: 10.2
Machine: Other
FixedDate: '2000-10-25'
FixedInVersion: NA
ClosedDate: '1999-04-19'


Name:

Willi Lohmann


CVS:

tclIO.c 1.244 96/11/12 14:47:28


Extensions:

none


CustomShell:

Have redefined the following to add a couple of args (they just call the real version after checking for the additional args - no actual new functionality):


ReproducibleScript:

    Reproducing this is hit or miss.  I have applications

    that seemingly do the same thing, but one works and one

    fails.  Its extremely dependent on the user's os environment

    and how many interrupts are occuring.  Sorry (but I have

    the fix).


ObservedBehavior:

    Within GetInput's while (1) loop, one of the possible read errno values

    is EINTR.  This means some system interrupt interrupted the io

    operation.

    Nothing bad happened and the io needs to be continued.  But its

    currently

    being treated as a hard io error.


    When running with a lot of interrupts (like itimers to do ui updates)

    this

    happens all the time on some os's (like hpux) when a tcl exec command is

    executed and return data is being read.  I have heard from someone who

    has

    seen this on solaris also.


DesiredBehavior:

    I want to see exec not return a "interrupted system call" error.


Patch:

Simply changing this line in GetInput():


if ((result == EWOULDBLOCK) || (result == EAGAIN)) {


to


if ((result == EWOULDBLOCK) || (result == EAGAIN) || (result == EINTR)) {


seems to fix the problem.


PatchFiles:

    tckIO.c




4/19/99 - redman - Not a bug. The code should specifically NOT check for EINTR to allow programs to handle and deal with it correctly.
welch Closed ticket [218076ffff]. [History diff]2000-10-26 08:14:45
bluemoonplain2000-11-29 04:13:53
Umm... there isn't any way that a program can restart the
underlying read() call within the Tcl IO routines. Even if
an interrupt handler catches the interrupt, what can it do
to cause Tcl to not report an error and restart the read?
dgp Ticket [218076ffff]: 3 changes [History diff]2001-04-16 22:53:51
Log in (anonymous is fine) to add a comment.