GNU bug report logs - #13018
fport_fill_input should handle EINTR

Previous Next

Package: guile;

Reported by: Aidan Gauland <aidalgol <at> no8wireless.co.nz>

Date: Wed, 28 Nov 2012 08:22:01 UTC

Severity: normal

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Mark H Weaver <mhw <at> netris.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#13018: closed (fport_fill_input should handle EINTR)
Date: Thu, 08 Aug 2013 21:41:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 08 Aug 2013 17:39:57 -0400
with message-id <87txizuaj6.fsf <at> tines.lan>
and subject line Re: bug#13018: fport_fill_input should handle EINTR
has caused the debbugs.gnu.org bug report #13018,
regarding fport_fill_input should handle EINTR
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
13018: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13018
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Aidan Gauland <aidalgol <at> no8wireless.co.nz>
To: bug-guile <at> gnu.org
Subject: fport_fill_input should handle EINTR
Date: Wed, 28 Nov 2012 21:19:06 +1300
Guile version: 3.2.0-4-amd64
OS: Debian wheezy GNU/Linux, kernel 3.2.0-4-amd64

In a program that maintains a TCP connection with a polling loop, I have
defined a signal handler with the `sigaction' procedure to terminate the
connection gracefully.  When the trapped signal is received (in this
case SIGINT) and the handler called, the following error message is
printed (full backtrace omitted):

ERROR: In procedure %read-line:
ERROR: In procedure fport_fill_input: Interrupted system call

I mentioned this on #guile on freenode and mark_weaver informed me that
I should be setting the SA_RESTART flag to avoid this problem, but that
there is a bug in Guile causing the error.

<mark_weaver> fport_fill_input should handle an EINTR error from 'read',
              and restart the read if that happens.

<mark_weaver> by default on some systems, signals cause 'read', 'write',
              and many other system calls to abort and return an EINTR
              error.

<mark_weaver> basically, at the POSIX level, every call to 'read' has to
              be within a little loop that takes care of the EINTR
              problem.

In short, I don't fully understand the innards to have an opinion on
whether this a bug or users should just set the SA_RESTART flag, bug
Mark assures me this is, indeed, a bug.  Any disagreement, take it up
with him. ;)

Regards,
Aidan Gauland


[Message part 3 (message/rfc822, inline)]
From: Mark H Weaver <mhw <at> netris.org>
To: Aidan Gauland <aidalgol <at> no8wireless.co.nz>
Cc: 13018-done <at> debbugs.gnu.org
Subject: Re: bug#13018: fport_fill_input should handle EINTR
Date: Thu, 08 Aug 2013 17:39:57 -0400
This bug was fixed in fe51c7b3e0a1e93be3bb81dd2d4b18936fe2df3a.

    Thanks!
      Mark


This bug report was last modified 11 years and 346 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.