From unknown Sat Jun 21 03:28:22 2025 X-Loop: don@donarmstrong.com Subject: bug#562: 23.0.60; OSX: make-network-process reuses existing file descriptors Reply-To: Markus Triska , 562@debbugs.gnu.org Resent-From: Markus Triska Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 15 Jul 2008 11:40:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 562 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121612164615336 (code B ref -1); Tue, 15 Jul 2008 11:40:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,FOURLA, FVGT_m_MULTI_ODD,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 15 Jul 2008 11:34:06 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6FBY0wY015330 for ; Tue, 15 Jul 2008 04:34:02 -0700 Received: from mail.gnu.org ([199.232.76.166]:33418 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KIimc-0005uU-NJ for emacs-pretest-bug@gnu.org; Tue, 15 Jul 2008 07:33:26 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KIin5-00008W-9E for emacs-pretest-bug@gnu.org; Tue, 15 Jul 2008 07:33:59 -0400 Received: from mail.gmx.net ([213.165.64.20]:43229) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KIin4-00007y-PK for emacs-pretest-bug@gnu.org; Tue, 15 Jul 2008 07:33:55 -0400 Received: (qmail invoked by alias); 15 Jul 2008 11:33:51 -0000 Received: from pnsgw3-client030.demo.tuwien.ac.at (EHLO pnsgw3-client030.demo.tuwien.ac.at) [128.131.196.30] by mail.gmx.net (mp058) with SMTP; 15 Jul 2008 13:33:51 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19g/0gGykhgywzRVjQAQsxsO1sySSWhWEZGf4HERq wymL9DAO60OepN Received: by pnsgw3-client030.demo.tuwien.ac.at (Postfix, from userid 502) id 4BDAF97E627; Tue, 15 Jul 2008 13:33:48 +0200 (CEST) From: Markus Triska To: emacs-pretest-bug@gnu.org Date: Tue, 15 Jul 2008 13:33:48 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) When I evaluate the following form in "emacs -Q": (progn (setq p1 (make-network-process :name "p1" :host "www.fsf.org" :service 80)) (setq p2 (make-network-process :name "p2" :host "www.fsf.org" :service 80)) (setq p3 (make-network-process :name "p3" :host "www.fsf.org" :service 80)) (delete-process p2) (process-send-string p3 "there")) I get: Debugger entered--Lisp error: (file-error "writing to process" "bad file descriptor" #>) process-send-string(#> "hi") This is because p2 and p3 are both created with infd=outfd=0, thus closing the channel for p2 also closes that of p3. In GNU Emacs 23.0.60.1 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9) of 2008-07-13 on mt-computer.local Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000 configured using `configure 'CFLAGS=-O0 -g'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t From unknown Sat Jun 21 03:28:22 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Markus Triska Subject: bug#562 closed by Chong Yidong (Re: 23.0.60; OSX: make-network-process reuses existing file descriptors) Message-ID: References: <87vdy4o1qb.fsf@stupidchicken.com> X-Emacs-PR-Message: they-closed 562 X-Emacs-PR-Package: emacs Reply-To: 562@debbugs.gnu.org Content-Type: multipart/mixed; boundary="----------=_1218675603-29923-1" This is a multi-part message in MIME format... ------------=_1218675603-29923-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #562: 23.0.60; OSX: make-network-process reuses existing file descriptors It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 562: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D562 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1218675603-29923-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From cyd@stupidchicken.com Wed Aug 13 17:53:46 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.4 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 562-done) by emacsbugs.donarmstrong.com; 14 Aug 2008 00:53:46 +0000 Received: from cyd (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7E0rhJi028325 for <562-done@emacsbugs.donarmstrong.com>; Wed, 13 Aug 2008 17:53:44 -0700 Received: by cyd (Postfix, from userid 1000) id 6C8A957E311; Wed, 13 Aug 2008 20:54:20 -0400 (EDT) From: Chong Yidong To: YAMAMOTO Mitsuharu Cc: Markus Triska , 562-done@debbugs.gnu.org Subject: Re: 23.0.60; OSX: make-network-process reuses existing file descriptors Date: Wed, 13 Aug 2008 20:54:20 -0400 Message-ID: <87vdy4o1qb.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > > Commenting out a res_init call in process.c makes this go away for > > me. I do not know what other consequences this has though: > > You can comment it out on Mac OS X, because calling `res_init' does > not make sense at all on that platform. Neither does linking > libresolv. > > http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html > http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01254.html > > So, it turns out to be not only meaningless, but also harmful on a > particular version (10.4) of Mac OS X. I've undef'ed HAVE_LIBRESOLV and HAVE_RES_INIT in s/darwin.h, as you suggested. Thanks. ------------=_1218675603-29923-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From markus.triska@gmx.at Tue Jul 15 04:34:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.1 required=4.0 tests=AWL,BAYES_00,FOURLA, FVGT_m_MULTI_ODD,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 15 Jul 2008 11:34:06 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6FBY0wY015330 for ; Tue, 15 Jul 2008 04:34:02 -0700 Received: from mail.gnu.org ([199.232.76.166]:33418 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KIimc-0005uU-NJ for emacs-pretest-bug@gnu.org; Tue, 15 Jul 2008 07:33:26 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KIin5-00008W-9E for emacs-pretest-bug@gnu.org; Tue, 15 Jul 2008 07:33:59 -0400 Received: from mail.gmx.net ([213.165.64.20]:43229) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KIin4-00007y-PK for emacs-pretest-bug@gnu.org; Tue, 15 Jul 2008 07:33:55 -0400 Received: (qmail invoked by alias); 15 Jul 2008 11:33:51 -0000 Received: from pnsgw3-client030.demo.tuwien.ac.at (EHLO pnsgw3-client030.demo.tuwien.ac.at) [128.131.196.30] by mail.gmx.net (mp058) with SMTP; 15 Jul 2008 13:33:51 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19g/0gGykhgywzRVjQAQsxsO1sySSWhWEZGf4HERq wymL9DAO60OepN Received: by pnsgw3-client030.demo.tuwien.ac.at (Postfix, from userid 502) id 4BDAF97E627; Tue, 15 Jul 2008 13:33:48 +0200 (CEST) From: Markus Triska To: emacs-pretest-bug@gnu.org Subject: 23.0.60; OSX: make-network-process reuses existing file descriptors Date: Tue, 15 Jul 2008 13:33:48 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) When I evaluate the following form in "emacs -Q": (progn (setq p1 (make-network-process :name "p1" :host "www.fsf.org" :service 80)) (setq p2 (make-network-process :name "p2" :host "www.fsf.org" :service 80)) (setq p3 (make-network-process :name "p3" :host "www.fsf.org" :service 80)) (delete-process p2) (process-send-string p3 "there")) I get: Debugger entered--Lisp error: (file-error "writing to process" "bad file descriptor" #>) process-send-string(#> "hi") This is because p2 and p3 are both created with infd=outfd=0, thus closing the channel for p2 also closes that of p3. In GNU Emacs 23.0.60.1 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9) of 2008-07-13 on mt-computer.local Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000 configured using `configure 'CFLAGS=-O0 -g'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t ------------=_1218675603-29923-1-- From unknown Sat Jun 21 03:28:22 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Markus Triska Subject: bug#569 closed by Chong Yidong (Re: 23.0.60; OSX: make-network-process reuses existing file descriptors) Message-ID: References: <87vdy4o1qb.fsf@stupidchicken.com> X-Emacs-PR-Message: they-closed 569 X-Emacs-PR-Package: emacs Reply-To: 569@debbugs.gnu.org Content-Type: multipart/mixed; boundary="----------=_1218675604-29923-3" This is a multi-part message in MIME format... ------------=_1218675604-29923-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #562: 23.0.60; OSX: make-network-process reuses existing file descriptors It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 562: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D562 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1218675604-29923-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From cyd@stupidchicken.com Wed Aug 13 17:53:46 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.4 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 562-done) by emacsbugs.donarmstrong.com; 14 Aug 2008 00:53:46 +0000 Received: from cyd (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7E0rhJi028325 for <562-done@emacsbugs.donarmstrong.com>; Wed, 13 Aug 2008 17:53:44 -0700 Received: by cyd (Postfix, from userid 1000) id 6C8A957E311; Wed, 13 Aug 2008 20:54:20 -0400 (EDT) From: Chong Yidong To: YAMAMOTO Mitsuharu Cc: Markus Triska , 562-done@debbugs.gnu.org Subject: Re: 23.0.60; OSX: make-network-process reuses existing file descriptors Date: Wed, 13 Aug 2008 20:54:20 -0400 Message-ID: <87vdy4o1qb.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > > Commenting out a res_init call in process.c makes this go away for > > me. I do not know what other consequences this has though: > > You can comment it out on Mac OS X, because calling `res_init' does > not make sense at all on that platform. Neither does linking > libresolv. > > http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html > http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01254.html > > So, it turns out to be not only meaningless, but also harmful on a > particular version (10.4) of Mac OS X. I've undef'ed HAVE_LIBRESOLV and HAVE_RES_INIT in s/darwin.h, as you suggested. Thanks. ------------=_1218675604-29923-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From markus.triska@gmx.at Thu Jul 17 07:22:52 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.8 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 17 Jul 2008 14:22:52 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6HEMiBj022432 for ; Thu, 17 Jul 2008 07:22:45 -0700 Received: from mx10.gnu.org ([199.232.76.166]:49995) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KJUMx-00039e-OI for emacs-pretest-bug@gnu.org; Thu, 17 Jul 2008 10:22:07 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KJUNS-000865-Re for emacs-pretest-bug@gnu.org; Thu, 17 Jul 2008 10:22:43 -0400 Received: from mail.gmx.net ([213.165.64.20]:53320) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KJUNS-00084r-9V for emacs-pretest-bug@gnu.org; Thu, 17 Jul 2008 10:22:38 -0400 Received: (qmail invoked by alias); 17 Jul 2008 14:22:34 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp013) with SMTP; 17 Jul 2008 16:22:34 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1/2y9xcEZH2P6w7lOw0AykK+Ds8v7Wx6HjYkLlxbA 68lVvDZvtTaaqq Received: by mt-computer.local (Postfix, from userid 502) id 9F8A6989724; Thu, 17 Jul 2008 16:22:25 +0200 (CEST) From: Markus Triska To: emacs-pretest-bug@gnu.org Subject: Re: 23.0.60; OSX: make-network-process reuses existing file descriptors References: Date: Thu, 17 Jul 2008 16:22:25 +0200 In-Reply-To: (Markus Triska's message of "Tue, 15 Jul 2008 13:33:48 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. > This is because p2 and p3 are both created with infd=outfd=0, thus > closing the channel for p2 also closes that of p3. Commenting out a res_init call in process.c makes this go away for me. I do not know what other consequences this has though: diff --git a/src/process.c b/src/process.c index b0bebeb..b5aebdc 100644 --- a/src/process.c +++ b/src/process.c @@ -3366,7 +3374,7 @@ usage: (make-network-process &rest ARGS) */) hints.ai_protocol = 0; #ifdef HAVE_RES_INIT - res_init (); + /* res_init (); */ #endif ret = getaddrinfo (SDATA (host), portstring, &hints, &res); ------------=_1218675604-29923-3--