From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bobstopper@australispro.com.au Newsgroups: gmane.lisp.guile.bugs Subject: Re: Thread + Socket + Pipes Bug? Date: Mon, 11 Aug 2003 18:02:23 +0800 Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Message-ID: <20030811100223.GA29235@australispro.com.au> References: <1060243090.29489.46.camel@helicon> <1060304971.30311.2.camel@helicon> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1060596264 27287 80.91.224.253 (11 Aug 2003 10:04:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2003 10:04:24 +0000 (UTC) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Aug 11 12:04:22 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19m9XK-0004CP-00 for ; Mon, 11 Aug 2003 12:04:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19m9Wk-0006A9-Rk for guile-bugs@m.gmane.org; Mon, 11 Aug 2003 06:03:46 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19m9WH-0005tW-7J for bug-guile@gnu.org; Mon, 11 Aug 2003 06:03:17 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19m9Vh-0004kD-WE for bug-guile@gnu.org; Mon, 11 Aug 2003 06:03:13 -0400 Original-Received: from [203.59.125.227] (helo=babelfish.australispro.com.au) by monty-python.gnu.org with esmtp (Exim 4.20) id 19m9Vg-0004Ob-3a for bug-guile@gnu.org; Mon, 11 Aug 2003 06:02:40 -0400 Original-Received: from babelfish.australispro.com.au (bobstopper@localhost [127.0.0.1]) by babelfish.australispro.com.au (8.12.3/8.12.3/Debian-6.4) with ESMTP id h7BA2Of7029720 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 11 Aug 2003 18:02:24 +0800 Original-Received: (from bobstopper@localhost) by babelfish.australispro.com.au (8.12.3/8.12.3/Debian-6.4) id h7BA2N5S029718 for bug-guile@gnu.org; Mon, 11 Aug 2003 18:02:23 +0800 Original-To: bug-guile@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.2 Precedence: list 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 Xref: main.gmane.org gmane.lisp.guile.bugs:889 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.bugs:889 Hi Neil Thanks for your response. My responses are below On Sun, Aug 10, 2003 at 10:19:52PM +0100, Neil Jerram wrote: > Robert, > > I'm having trouble reproducing the problem, and I also have some > questions about the code. > > 1. Repro > > Can you be precise about "dumping data" to port 6008. I've tried > running with just ./buggy.scm in one window, and the following in > another window... > > [neil@laruns ~]$ telnet localhost 6008 > Trying ::1... > telnet: connect to address ::1: Connection refused > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > bye > bye again > ^] > telnet> close > Connection closed. > [neil@laruns ~]$ telnet localhost 6008 > Trying ::1... > telnet: connect to address ::1: Connection refused > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > hello > hello again > hello 3 > hello 4 > ^] > telnet> close > Connection closed. > > ...but I don't see any error (or any other output/result) anywhere. Ok, well that's pretty annoying. That's certainly what I do to get it complaining. Sometimes it takes a few attempts at dumping output there before it complains but generally speaking it will crash in the first attempt. I've had it doing it on 3 different computers. Do you have anything related installed which might be working around the problem? By the way, the output drawn from the port 6008 connection should appear on the server terminal after about 10 seconds under normal operation. That's also where any errors will appear. > 2. Code > > Why do you need to lock and unlock the mutex so much on the main > thread? It looks to me as though the data protected by the mutex is > just `message' - is that correct? Yeah, I started out just protecting that but because I was getting file descriptor errors everywhere and because they always seemed related to the threading, I started locking whenever I performed operations on file descriptors. That did seem to work for most of the errors. However nothing I lock seems to help this particular problem with select without reverting the whole program to a thread blocking accept. Am I correct that simple file descriptor operations should not need mutex locks? If so, that's probably a related bug which you could reveal simply by removing unnecessary mutex locks around port/pipe operations. Upon doing that the errors should include more "bad file descriptor" errors and eventually broken pipes. -- Regards, Robert Marlow _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://mail.gnu.org/mailman/listinfo/bug-guile