From unknown Thu Aug 14 21:45:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#16262 <16262@debbugs.gnu.org> To: bug#16262 <16262@debbugs.gnu.org> Subject: Status: 24.3.50; Mac OSX emacs --daemon reports "server did not start correctly" Reply-To: bug#16262 <16262@debbugs.gnu.org> Date: Fri, 15 Aug 2025 04:45:01 +0000 retitle 16262 24.3.50; Mac OSX emacs --daemon reports "server did not start= correctly" reassign 16262 emacs submitter 16262 Phillip Dixon severity 16262 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 26 19:31:48 2013 Received: (at submit) by debbugs.gnu.org; 27 Dec 2013 00:31:48 +0000 Received: from localhost ([127.0.0.1]:44854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VwLL9-0005yh-1X for submit@debbugs.gnu.org; Thu, 26 Dec 2013 19:31:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37464) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VwJXr-0002Ly-89 for submit@debbugs.gnu.org; Thu, 26 Dec 2013 17:36:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VwJXh-0001m9-Ao for submit@debbugs.gnu.org; Thu, 26 Dec 2013 17:36:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwJXh-0001m5-7Y for submit@debbugs.gnu.org; Thu, 26 Dec 2013 17:36:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwJXZ-0002e3-T7 for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2013 17:36:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VwJXO-0001jF-JT for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2013 17:36:29 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:47023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VwJXO-0001iw-Da for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2013 17:36:18 -0500 Received: by mail-pd0-f181.google.com with SMTP id p10so8378300pdj.40 for ; Thu, 26 Dec 2013 14:36:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=ic3mCKlgV0vbesdgubwl31UsAdwfOw2lY2x+pFUlYVU=; b=L8GgtU7Eg37xIRXmqzcLDDCqcMvh6dLklhdRZxLGnViz+6p6RG6mZkMCs3uPnOQLnd W4H4A0TXnp36A0YEjsgSyxNheHftkM25vh12x0GabQUIgwaDEdP1uss/ClMnE+ZP+v7G DM+QJ/RsDCHFaKdKUEByLvA7tefnuz/SEkwhefMPzRT+sjmlHkgThiTQ021xDxiP6IU+ W5DAX7y7Xeohovsccp1S1/wE/uzkgY0aHsS1Y+blthUWMYaenknw0cEWyMF433aB8fb2 RBaJN5nFMzeaFm+rHOFm7L9aDmkx7Bjmhqu/Lq9uEB+GIuTvmPDYqeXdgaoyDcQq32vF Cgqg== X-Gm-Message-State: ALoCoQlYxRaVFmrKEZRwqb8cmCpTOeFpIDNAwPp4twIVs5aJwww7qG1QmXmW4ZvzYdaa7NxvZ2gg X-Received: by 10.68.91.3 with SMTP id ca3mr46536397pbb.20.1388097376671; Thu, 26 Dec 2013 14:36:16 -0800 (PST) Received: from pdAir.local (121-73-99-140.cable.telstraclear.net. [121.73.99.140]) by mx.google.com with ESMTPSA id ir5sm9349393pbc.14.2013.12.26.14.36.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Dec 2013 14:36:16 -0800 (PST) From: Phillip Dixon To: bug-gnu-emacs@gnu.org Subject: 24.3.50; Mac OSX emacs --daemon reports "server did not start correctly" Date: Fri, 27 Dec 2013 11:36:10 +1300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 26 Dec 2013 19:31:45 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) In GNU Emacs 24.3.50.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00) of 2013-12-25 on pdAir.local Windowing system distributor `Apple', version 10.3.1265 Configured using: `configure --with-ns' Important settings: locale-coding-system: utf-8-unix When launch emacs using emacs -Q --daemon The daemon starts but reports Error: server did not start correctly Among other things this means that trying to auto launch the daemon using emacsclient -a "" doesn't work. emacs 24.3 correctly reports that the daemon launch. The issue appears to have been introduced by changeset rev. 113315, Make file descriptors close-on-exec when possible. The NS port uses a pipe between the parent and child processes to signal when the newly forked child is ready. rev 113315 makes the pipe used to do this synchronisation unavailable to the child process. The following patch reverts the portions of rev. 113315 that impact daemon launch on NS. It seems to fix the problem for me. diff --git a/src/emacs.c b/src/emacs.c index 35e8ff3..53f65c0 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1026,7 +1026,7 @@ main (int argc, char **argv) use a pipe for synchronization. The parent waits for the child to close its end of the pipe (using `daemon-initialized') before exiting. */ - if (emacs_pipe (daemon_pipe) != 0) + if (pipe(daemon_pipe) == -1) { fprintf (stderr, "Cannot pipe!\n"); exit (1); @@ -1122,7 +1122,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem daemon_name = xstrdup (dname_arg); /* Close unused reading end of the pipe. */ emacs_close (daemon_pipe[0]); - + /* Make sure that the used end of the pipe is closed on exec, + that it is not accessible to programs started from .emacs. */ + fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC); setsid (); #else /* DOS_NT */ fprintf (stderr, "This platform does not support the -daemon flag.\n"); From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 28 18:00:24 2013 Received: (at 16262) by debbugs.gnu.org; 28 Dec 2013 23:00:24 +0000 Received: from localhost ([127.0.0.1]:49212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vx2ro-0007Vs-05 for submit@debbugs.gnu.org; Sat, 28 Dec 2013 18:00:24 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:56642) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vx2rk-0007Vh-0U for 16262@debbugs.gnu.org; Sat, 28 Dec 2013 18:00:21 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 224E439E811D; Sat, 28 Dec 2013 15:00:19 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SRYMk0sq+pJ5; Sat, 28 Dec 2013 15:00:18 -0800 (PST) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id BAF0439E810E; Sat, 28 Dec 2013 15:00:18 -0800 (PST) Message-ID: <52BF5802.8050206@cs.ucla.edu> Date: Sat, 28 Dec 2013 15:00:18 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Phillip Dixon Subject: Re: 24.3.50; Mac OSX emacs --daemon reports "server did not start correctly" X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 16262 Cc: 16262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) Thanks for the bug report. Your fix has a small race condition, in that some other thread could fork and exec while the pipe's close-on-exec flag is clear. I installed a different fix as trunk bzr 115799, which should avoid that race condition. Please give it a try when you have the chance. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 29 13:35:02 2013 Received: (at control) by debbugs.gnu.org; 29 Dec 2013 18:35:02 +0000 Received: from localhost ([127.0.0.1]:50572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VxLCX-0001gK-6I for submit@debbugs.gnu.org; Sun, 29 Dec 2013 13:35:01 -0500 Received: from smtp.cs.ucla.edu ([131.179.128.62]:57388) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VxLCV-0001g8-48 for control@debbugs.gnu.org; Sun, 29 Dec 2013 13:34:59 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id A6340A60004 for ; Sun, 29 Dec 2013 10:34:58 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Frlxiv-8qe+w for ; Sun, 29 Dec 2013 10:34:58 -0800 (PST) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5F995A60002 for ; Sun, 29 Dec 2013 10:34:58 -0800 (PST) Message-ID: <52C06B52.80303@cs.ucla.edu> Date: Sun, 29 Dec 2013 10:34:58 -0800 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: 16262 is fixed Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) close 16262 thanks The bug seems to be fixed now. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 02 17:02:24 2014 Received: (at 16262) by debbugs.gnu.org; 2 Jan 2014 22:02:25 +0000 Received: from localhost ([127.0.0.1]:58636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VyqLQ-0002Fm-K1 for submit@debbugs.gnu.org; Thu, 02 Jan 2014 17:02:24 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:55332) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VyqLM-0002Fd-V9 for 16262@debbugs.gnu.org; Thu, 02 Jan 2014 17:02:22 -0500 Received: by mail-pb0-f42.google.com with SMTP id uo5so15052109pbc.1 for <16262@debbugs.gnu.org>; Thu, 02 Jan 2014 14:02:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=mG2AaEVR/3Jz568D13JtOIy3+eZZKBNn1Ba85/iBCGI=; b=WmJ/14SG5cXrtKMohLlNiU9FwvlL/nTvYnHEIj0YvcVLLszczG7WQuAw8bSONVfzxJ QQ3xNFFGTngCcXbhJtJj8MswdeseQ0sC6ipKh/TKtHwUBmQBqPV+kbep4kX/idodU1zR S/KYS3VL5zTg7p2z+TnFcQU9TpgnA5xO9STeShKw7yguhtrDXr1MKoi8qb7KpCmJl6wP MlR4YoQU4wLor8ptt7iT7CtbUcql6d4e2KVLI3NLullO2khnrZIHXPTm9OahWeTRKrXA StmB3XFoJs35fW8Oh6fwxhJ76B3YZc0txKjwK3JdBX79xZDLv+1wk5yQzpU6PwJrWi/s zSMA== X-Gm-Message-State: ALoCoQnVShDMQXno3p2XgeFaAp7NF1g5HueVX7vMGlUm2XryGZm5l3fHJ3FrlMtEZ/uG3gVerNSJ X-Received: by 10.68.229.10 with SMTP id sm10mr25854406pbc.154.1388700139834; Thu, 02 Jan 2014 14:02:19 -0800 (PST) Received: from pdAir.local (121-73-99-140.cable.telstraclear.net. [121.73.99.140]) by mx.google.com with ESMTPSA id qw8sm104132511pbb.27.2014.01.02.14.02.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jan 2014 14:02:19 -0800 (PST) From: Phillip Dixon To: Paul Eggert Subject: Re: 24.3.50; Mac OSX emacs --daemon reports "server did not start correctly" References: <52BF5802.8050206@cs.ucla.edu> Date: Fri, 03 Jan 2014 11:02:12 +1300 In-Reply-To: <52BF5802.8050206@cs.ucla.edu> (Paul Eggert's message of "Sat, 28 Dec 2013 15:00:18 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16262 Cc: 16262@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi, Your fix is working correctly on my machine (Mac OSX 10.9). Thank you Phil From unknown Thu Aug 14 21:45:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 31 Jan 2014 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 29 19:54:04 2014 Received: (at control) by debbugs.gnu.org; 29 Jul 2014 23:54:04 +0000 Received: from localhost ([127.0.0.1]:42369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCHDX-0007W9-MP for submit@debbugs.gnu.org; Tue, 29 Jul 2014 19:54:04 -0400 Received: from nihrelayxway3.hub.nih.gov ([128.231.90.108]:31550) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XCBZM-0007QI-5t for control@debbugs.gnu.org; Tue, 29 Jul 2014 13:52:16 -0400 X-IronPortListener: NIH_Relay X-SBRS: None X-IronPort-AV: E=Sophos;i="5.01,758,1400040000"; d="scan'208";a="202230225" Received: from cesedge01.nih.gov (HELO mailfwd.nih.gov) ([128.231.90.107]) by nihrelayxway3.hub.nih.gov with ESMTP/TLS/AES128-SHA; 29 Jul 2014 13:52:04 -0400 Received: from omega1.localnet (10.133.9.67) by mailfwd.nih.gov (128.231.90.107) with Microsoft SMTP Server id 14.3.158.1; Tue, 29 Jul 2014 13:52:04 -0400 From: Grant Izmirlian To: Subject: unarchive 16262 Date: Tue, 29 Jul 2014 13:52:04 -0400 Message-ID: <1596008.LIcf4bpRvo@omega1> User-Agent: KMail/4.11.5 (Linux/3.11.10-17-desktop; KDE/4.11.5; x86_64; ; ) In-Reply-To: <2f4104$9sumha@nihcesxway6.hub.nih.gov> References: <2f4104$9sumha@nihcesxway6.hub.nih.gov> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: control X-Mailman-Approved-At: Tue, 29 Jul 2014 19:54:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) unarchive 16262 From unknown Thu Aug 14 21:45:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 27 Aug 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator