From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68799: 30.0.50; emacs --fg-daemon fails silently if server-start fails Date: Sat, 10 Feb 2024 22:05:58 +0200 Message-ID: <868r3st789.fsf@gnu.org> References: <86y1c82hfb.fsf@gnu.org> <86wmrs2h41.fsf@gnu.org> <86v87c2fw4.fsf@gnu.org> <86sf2g2btj.fsf@gnu.org> <86r0hz2fcz.fsf@gnu.org> <875xywp08p.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1004"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68799@debbugs.gnu.org, sbaugh@janestreet.com To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 10 21:11:02 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rYtgj-000Aa5-Sx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Feb 2024 21:11:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYtgW-0001rA-H2; Sat, 10 Feb 2024 15:10:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYtgV-0001qm-3I for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 15:10:47 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYtgU-0006RE-QW for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 15:10:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYtgk-0007Ko-Do for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 15:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Feb 2024 20:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68799 X-GNU-PR-Package: emacs Original-Received: via spool by 68799-submit@debbugs.gnu.org id=B68799.170759581828062 (code B ref 68799); Sat, 10 Feb 2024 20:11:02 +0000 Original-Received: (at 68799) by debbugs.gnu.org; 10 Feb 2024 20:10:18 +0000 Original-Received: from localhost ([127.0.0.1]:37967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYtg1-0007IR-Ip for submit@debbugs.gnu.org; Sat, 10 Feb 2024 15:10:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYtcF-000750-2S for 68799@debbugs.gnu.org; Sat, 10 Feb 2024 15:06:24 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYtbt-0005Y0-Ev; Sat, 10 Feb 2024 15:06:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hcsiEIAR7DLvbZywJMgIa5I8GElJxTiufEogL0wTf1Q=; b=PCZt8Lwh5KgO U4ldpGUJpvh/rNlj2Wh/378kCEPxqyxq4nAH1iEjbB1AqC0bnRKPLNS5WiIZOUBd/F5uBVT4f9+BD tBYOB9UWyM1nV11k7U5t+EqQn99/LxuCS6G7sPtBaalBOFYeiA0hBA5tzDpSjK6ExpiYROP0lBWw8 uXLo6AKVzCrviaSTan1h978Nkpqo+iHWVmtMr1qtNiN/oqcCj63pR1cM6s1RP+IT76647ENWbOeKC vhJFzhSSnCcC8BBkfxQqzCL8srCoC3069IckhQToLUVEGgEVrLMSmM0NebVkyArtSyE3MtvCRtAMj GfASf7dEe7A8h72YfLU3Rg==; In-Reply-To: <875xywp08p.fsf@catern.com> (sbaugh@catern.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279794 Archived-At: > From: sbaugh@catern.com > Date: Sat, 10 Feb 2024 19:50:20 +0000 (UTC) > Cc: Spencer Baugh , 68799@debbugs.gnu.org > > Eli Zaretskii writes: > > >> > Thanks, this needs a comment explaining why we need condition-case and > >> > where does error-message-string come from. > >> > >> Actually, on second thought, we could fail anywhere in startup.el, not > >> just in server-start. So should we actually have a wrapper around all > >> of normal-top-level which detects an error at startup in a daemon? > > > > I'd prefer to handle each specific problem specially, to make sure the > > error message is self-explanatory. Also, if the error happens after > > the server has been started, there's no reason to forcibly exit. > > > > So I think we should for now solve this particular issue, and not try > > generalizing too much. > > To be clear, right now any error anywhere in command-line causes "emacs > --fg-daemon" and "emacs --bg-daemon" to hang indefinitely, without > printing an error, with no way to ever interact with the Emacs process. That's not what you said before: you said "anywhere in startup.el", which is much more general. Now you are saying something different. What exactly is meant by "anywhere in command-line"? the function command-line in startup.el? or something else? > This error can come from any code, so if we have *any* bugs anywhere in > code called from command-line, it will cause Emacs to enter this state. Why would we assume that *any code* there will signal an error? That's like saying that Emacs is a useless program that always signals errors in random places. That's a non-starter here. > We can add good error messages for individual classes of error, but we > should also have a catch-all check to make sure that Emacs doesn't enter > this broken state if we (or the user) write code which contains a bug. There's no reason to have a catch-all check where no error is expected. Do you always wrap all of your code in condition-case and the likes? If not, why not? > I have concrete reasons to want this: I think there's a bug in > command-line in trunk which some of my users using emacs --daemon have > run into. But I have zero information about what caused the bug, > because Emacs just hangs without printing any error message in this > case. Then please debug that, and let's talk when you do have concrete data. > To allow users to report bugs that are at all useful, we should at least > print the error that occurred, even if we don't kill Emacs. Users aren't supposed to debug Emacs, it's the job of developers. And developers know how to run Emacs under a debugger and do any number of other debugging tricks. Injecting debugging code into Emacs just because some of your users did something wrong is not a good idea. Or maybe it is -- but we won't know until we understand what exactly goes wrong in those cases.