This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, libgfortran] PR 67585 Handle EINTR


On Fri, Oct 7, 2016 at 2:41 PM, FX <fxcoudert@gmail.com> wrote:
>> Many POSIX systems have the bad habit of not restarting interrupted
>> syscalls. On these systems it's up to the user to check for an error
>> with errno == EINTR and restart manually. This patch does this for
>> libgfortran, so that GFortran users don't have to do it.
>
> I have not much experience with EINTR, but is it garanteed that those EINTR loops will never cycle forever?

Hmm, no I don't think so, but I don't think it'll be a problem. So on
systems where syscalls are not restarted automatically, EINTR happens
when the process receives a signal while blocked in a system call [1].
So I suppose in theory you could have a situation where something
continuously fires signals at the process, and the result is some kind
of race between the process restarting the syscall which then never
manages to complete before being interrupted again. But I think this
goes into the "Doctor, this hurts! Then don't do that" territory.

There's some more info in https://www.python.org/dev/peps/pep-0475/
(Python nowadays does the same as this patch).

>
> Apart from that, OK to commit.
>
> FX



-- 
Janne Blomqvist


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]