From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rixed@happyleptic.org Newsgroups: gmane.lisp.guile.user Subject: Re: debugging guile runtime Date: Tue, 30 Aug 2011 18:25:27 +0200 Message-ID: <20110830162527.GA20481@ccellier.rd.securactive.lan> References: <20110829125030.GB30079@ccellier.rd.securactive.lan> <20110829162400.GB21699@ccellier.rd.securactive.lan> <87y5ycowh3.fsf@ambire.localdomain> <20110830105642.GA16079@ccellier.rd.securactive.lan> <87wrduhp1x.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1314721555 26908 80.91.229.12 (30 Aug 2011 16:25:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Aug 2011 16:25:55 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Aug 30 18:25:51 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QyR8D-0003oZ-Ue for guile-user@m.gmane.org; Tue, 30 Aug 2011 18:25:46 +0200 Original-Received: from localhost ([::1]:48330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyR8D-0005Iy-09 for guile-user@m.gmane.org; Tue, 30 Aug 2011 12:25:45 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyR8A-0005IN-OI for guile-user@gnu.org; Tue, 30 Aug 2011 12:25:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyR88-0002Yh-0J for guile-user@gnu.org; Tue, 30 Aug 2011 12:25:42 -0400 Original-Received: from eneide.happyleptic.org ([213.251.171.101]:45885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyR87-0002XM-Qp for guile-user@gnu.org; Tue, 30 Aug 2011 12:25:39 -0400 Original-Received: from extranet.securactive.org ([82.234.213.170] helo=ccellier.rd.securactive.lan) by eneide.happyleptic.org with esmtp (Exim 4.72) (envelope-from ) id 1QyR80-0001Om-Jj for guile-user@gnu.org; Tue, 30 Aug 2011 18:25:32 +0200 Original-Received: from rixed by ccellier.rd.securactive.lan with local (Exim 4.72) (envelope-from ) id 1QyR7v-0005QJ-Lt for guile-user@gnu.org; Tue, 30 Aug 2011 18:25:27 +0200 Mail-Followup-To: rixed@happyleptic.org, guile-user@gnu.org Content-Disposition: inline In-Reply-To: <87wrduhp1x.fsf@gnu.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.251.171.101 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8750 Archived-At: -[ Tue, Aug 30, 2011 at 05:55:22PM +0200, Ludovic Courtès ]---- > Like in C, it???s up to the application to close those ports that it > considers worth closing upon exec. I was under the impression that the idiom was to close all files before execing a coprocess, but I just checked POSIX popen, R.Stevens and libslack and none does that. Well, the lib I'm used to does that and it felt natural to do so that I erroneously assumed it was a mandated behavior (so that running a coprocess is similar to running a program from a shell). OK then, so it's not a bug and I have to live with this behavior (BTW, if anyone knows the rational behind this, I would be glad to know). > If what you want is to close every FD from 3 to ???, then the typical way > to do this is to loop over those numbers and call close(2) (that???s how > libdaemon and similar tools do that.) Except that, as previously discussed in another thread, there is no easy way to do that between the fork and the exec (since I don't want to actually close these files in the main program that starts the pipe). Anyway, what about the other bugs? Is there anything I could do to advance the thread-safety issue for instance?