From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Detlev Zundel Newsgroups: gmane.lisp.guile.bugs Subject: Re: Problem with netcat Date: Thu, 07 Apr 2011 18:04:49 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1302284544 30224 80.91.229.12 (8 Apr 2011 17:42:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2011 17:42:24 +0000 (UTC) Cc: bug-guile mailing list To: John Proctor Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Apr 08 19:42:20 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q8FhH-0004jo-0c for guile-bugs@m.gmane.org; Fri, 08 Apr 2011 19:42:15 +0200 Original-Received: from localhost ([127.0.0.1]:38741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8FhG-0004o0-EC for guile-bugs@m.gmane.org; Fri, 08 Apr 2011 13:42:14 -0400 Original-Received: from [140.186.70.92] (port=49075 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7rho-00036c-7T for bug-guile@gnu.org; Thu, 07 Apr 2011 12:05:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7rhV-00033K-2L for bug-guile@gnu.org; Thu, 07 Apr 2011 12:04:54 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.9]:44191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7rhU-00032I-Q5 for bug-guile@gnu.org; Thu, 07 Apr 2011 12:04:53 -0400 Original-Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 6AD911C08E18; Thu, 7 Apr 2011 18:04:49 +0200 (CEST) X-Auth-Info: Mz7StjRXBNiAOF9Bzlw+mWyDzFdiOuJdmJQ3s2DSb5U= Original-Received: from mail.denx.de (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 641441C0010C; Thu, 7 Apr 2011 18:04:49 +0200 (CEST) Original-Received: from ohwell.denx.de (ohwell [10.0.40.4]) by mail.denx.de (Postfix) with ESMTP id 415434BC1537; Thu, 7 Apr 2011 18:04:49 +0200 (CEST) Original-Received: from dzu by ohwell.denx.de with local (Exim 4.72) (envelope-from ) id 1Q7rhR-0000zz-21; Thu, 07 Apr 2011 18:04:49 +0200 In-Reply-To: (John Proctor's message of "Thu, 7 Apr 2011 10:41:54 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 212.18.0.9 X-Mailman-Approved-At: Fri, 08 Apr 2011 13:38:36 -0400 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5439 Archived-At: Hi John, > Attached is the output of two strace runs. > strace.netcat is of 'strace -r guile --listen=9000' with 'netcat localhost > 9000 < a.ss' run against it. > strace.interactive is of 'strace -r guile --listen=9000' with 'netcat > localhost 9000' used to access it and me manually typing (+ 5 3) then > hitting -d in both windows to terminate. > > Thanks Andy and Detlev. Thanks for the input - I think the problem is clear to see here: > 0.000033 rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0 > 0.000039 write(90, "scheme@(guile-user)> ", 21scheme@(guile-user)> ) = 21 > 0.000028 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 > 0.000022 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 > 0.000032 read(0, > 30.150227 +++ killed by SIGPIPE +++ This is from the problematic log. It turns out that an "strace -f" would have be better advice for you so we would have seen the actual socket process but funnily enough I now sometimes can regenerate the error (usually by pressing C-c in netcat). This is the last I see for such a case: [pid 706] times({tms_utime=26, tms_stime=3, tms_cutime=0, tms_cstime=0}) = -1349846525 [pid 706] select(1024, [81], [], [], {0, 0}) = 0 (Timeout) [pid 706] brk(0x9353000) = 0x9353000 [pid 706] brk(0x934b000) = 0x934b000 [pid 706] write(81, "scheme@(guile-user) [1]> ", 25) = 25 [pid 706] read(81, "", 1) = 0 [pid 706] write(81, "\n", 1) = 1 [pid 706] select(1024, [81], [], [], {0, 0}) = 1 (in [81], left {0, 0}) [pid 706] read(81, "", 1) = 0 [pid 706] select(1024, [81], [], [], {0, 0}) = 1 (in [81], left {0, 0}) [pid 706] read(81, "", 1) = 0 [pid 706] write(81, "\n", 1) = -1 EPIPE (Broken pipe) [pid 706] --- SIGPIPE (Broken pipe) @ 0 (0) --- Process 706 detached [pid 32521] +++ killed by SIGPIPE +++ [pid 32520] +++ killed by SIGPIPE +++ +++ killed by SIGPIPE +++ So it seems like guile wants simply to output a newline but the socket is closed already and the process then gets the SIGPIPE signal which guile is not prepared for. I will need to dig deeper into the innards of guile to find an answer on how to prevent that. If someone beats me to it I'll still be happy ;) Cheers Detlev -- Number theorists do it perfectly and rationally.