From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.lisp.guile.bugs Subject: bug#13018: fport_fill_input should handle EINTR Date: Wed, 28 Nov 2012 21:19:06 +1300 Message-ID: <87vccqnnr9.fsf@dimension8.tehua.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1354098132 10168 80.91.229.3 (28 Nov 2012 10:22:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Nov 2012 10:22:12 +0000 (UTC) To: 13018@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Nov 28 11:22:24 2012 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 1Tdemc-0000UV-Jt for guile-bugs@m.gmane.org; Wed, 28 Nov 2012 11:22:22 +0100 Original-Received: from localhost ([::1]:51133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdemR-00020Q-Cj for guile-bugs@m.gmane.org; Wed, 28 Nov 2012 05:22:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdcsQ-0004ds-GN for bug-guile@gnu.org; Wed, 28 Nov 2012 03:20:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdcsL-0005Ha-IX for bug-guile@gnu.org; Wed, 28 Nov 2012 03:20:14 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdcsL-0005HW-Ew for bug-guile@gnu.org; Wed, 28 Nov 2012 03:20:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TdcuA-0001vr-3l for bug-guile@gnu.org; Wed, 28 Nov 2012 03:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aidan Gauland Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 28 Nov 2012 08:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13018 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13540909027398 (code B ref -1); Wed, 28 Nov 2012 08:22:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Nov 2012 08:21:42 +0000 Original-Received: from localhost ([127.0.0.1]:42546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tdctq-0001vG-9r for submit@debbugs.gnu.org; Wed, 28 Nov 2012 03:21:42 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59298) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tdctn-0001v9-Qz for submit@debbugs.gnu.org; Wed, 28 Nov 2012 03:21:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tdcrs-00050m-VO for submit@debbugs.gnu.org; Wed, 28 Nov 2012 03:19:46 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:60903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdcrs-00050g-SH for submit@debbugs.gnu.org; Wed, 28 Nov 2012 03:19:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdcrj-0004XG-FV for bug-guile@gnu.org; Wed, 28 Nov 2012 03:19:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tdcrd-0004zG-OC for bug-guile@gnu.org; Wed, 28 Nov 2012 03:19:31 -0500 Original-Received: from jersey.rurallink.co.nz ([114.134.15.197]:36462 helo=smtp.rurallink.co.nz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdcrd-0004rp-D1 for bug-guile@gnu.org; Wed, 28 Nov 2012 03:19:25 -0500 Original-Received: from 114-134-8-154.rurallink.co.nz ([114.134.8.154] helo=dimension8.tehua.net) by smtp.rurallink.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TdcrR-0007Sk-5w for bug-guile@gnu.org; Wed, 28 Nov 2012 21:19:15 +1300 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Rurallink-Authenticated-User: aidalgol@no8wireless.co.nz X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Wed, 28 Nov 2012 05:22:09 -0500 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:6608 Archived-At: 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. 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. 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