unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: 13018@debbugs.gnu.org, Aidan Gauland <aidalgol@no8wireless.co.nz>
Subject: bug#13018: fport_fill_input should handle EINTR
Date: Wed, 13 Mar 2013 12:44:13 +0100	[thread overview]
Message-ID: <87sj3zh6cy.fsf@pobox.com> (raw)
In-Reply-To: <87ehjc5fh7.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 29 Nov 2012 21:19:48 +0100")

On Thu 29 Nov 2012 21:19, ludo@gnu.org (Ludovic Courtès) writes:

> Aidan Gauland <aidalgol@no8wireless.co.nz> skribis:
>
>> <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.
>
> ‘fport_fill_input’ does this:
>
>   SCM_SYSCALL (count = read (fp->fdes, pt->read_buf, pt->read_buf_size));
>
> and SCM_SYSCALL does that:
>
>   # ifdef EINTR
>   #  if (EINTR > 0)
>   #   define SCM_SYSCALL(line)                    \
>     do                                            \
>       {                                           \
>         errno = 0;                                \
>         line;                                     \
>         if (errno == EINTR)                       \
>           {                                       \
>             SCM_ASYNC_TICK;                       \
>             continue;                             \
>           }                                       \
>       }                                           \
>     while(0)
>   #  endif /*  (EINTR > 0) */
>   # endif /* def EINTR */

I get the feeling the EINTR is coming from somewhere else -- like the
ASYNC_TICK.  The sigaction could cause a thunk to run there.

Aidan, do you have a test case?

Andy
-- 
http://wingolog.org/





  reply	other threads:[~2013-03-13 11:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28  8:19 bug#13018: fport_fill_input should handle EINTR Aidan Gauland
2012-11-29 20:19 ` Ludovic Courtès
2013-03-13 11:44   ` Andy Wingo [this message]
2013-03-29  7:35     ` Aidan Gauland
2013-07-03 19:14     ` Mark H Weaver
2013-08-08 21:39       ` Mark H Weaver
2013-03-05 17:57 ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sj3zh6cy.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=13018@debbugs.gnu.org \
    --cc=aidalgol@no8wireless.co.nz \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).