From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#13018: fport_fill_input should handle EINTR Date: Wed, 03 Jul 2013 15:14:10 -0400 Message-ID: <87zju3e9rx.fsf@tines.lan> References: <87vccqnnr9.fsf@dimension8.tehua.net> <87ehjc5fh7.fsf@gnu.org> <87sj3zh6cy.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1372878922 32536 80.91.229.3 (3 Jul 2013 19:15:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Jul 2013 19:15:22 +0000 (UTC) To: Aidan Gauland , 13018@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Jul 03 21:15:22 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UuSWQ-0007tH-Gm for guile-bugs@m.gmane.org; Wed, 03 Jul 2013 21:15:22 +0200 Original-Received: from localhost ([::1]:41894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuSWQ-0001Ee-3J for guile-bugs@m.gmane.org; Wed, 03 Jul 2013 15:15:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuSWI-0001DM-No for bug-guile@gnu.org; Wed, 03 Jul 2013 15:15:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuSW7-0006zl-Do for bug-guile@gnu.org; Wed, 03 Jul 2013 15:15:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuSW7-0006xp-78 for bug-guile@gnu.org; Wed, 03 Jul 2013 15:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UuSW5-0002ib-PJ for bug-guile@gnu.org; Wed, 03 Jul 2013 15:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 03 Jul 2013 19:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13018 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 13018-submit@debbugs.gnu.org id=B13018.137287886910357 (code B ref 13018); Wed, 03 Jul 2013 19:15:01 +0000 Original-Received: (at 13018) by debbugs.gnu.org; 3 Jul 2013 19:14:29 +0000 Original-Received: from localhost ([127.0.0.1]:55296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UuSVY-0002gy-Nh for submit@debbugs.gnu.org; Wed, 03 Jul 2013 15:14:29 -0400 Original-Received: from world.peace.net ([96.39.62.75]:44209 ident=hope8) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UuSVV-0002gn-Ug for 13018@debbugs.gnu.org; Wed, 03 Jul 2013 15:14:27 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UuSVO-0002hY-Lc; Wed, 03 Jul 2013 15:14:18 -0400 In-Reply-To: <87sj3zh6cy.fsf@pobox.com> (Andy Wingo's message of "Wed, 13 Mar 2013 12:44:13 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7194 Archived-At: We now finally understand the cause of this bug. See below. Andy Wingo writes: > On Thu 29 Nov 2012 21:19, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Aidan Gauland skribis: >> >>> fport_fill_input should handle an EINTR error from 'read', >>> and restart the read if that happens. >>> >>> by default on some systems, signals cause 'read', 'write', >>> and many other system calls to abort and return an EINTR >>> error. >>> >>> basically, at the POSIX level, every call to 'read' has to >>> be within a little loop that takes care of the EINTR >>> problem. >> >> =E2=80=98fport_fill_input=E2=80=99 does this: >> >> SCM_SYSCALL (count =3D 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 =3D 0; \ >> line; \ >> if (errno =3D=3D EINTR) \ >> { \ >> SCM_ASYNC_TICK; \ >> continue; \ >> } \ >> } \ >> while(0) >> # endif /* (EINTR > 0) */ >> # endif /* def EINTR */ > > I get the feeling the EINTR is coming from somewhere else [...] As Ludovic finally realized, the 'continue' above always exits the loop, because 'continue' jumps to the test, rather than unconditionally jumping to the top of the loop body. This bug was introduced in Guile 2.0.0. We are now discussing how to proceed on guile-devel: http://lists.gnu.org/archive/html/guile-devel/2013-06/msg00050.html http://lists.gnu.org/archive/html/guile-devel/2013-07/msg00002.html Thanks, Mark