From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71223: 30.0.50; stack overflow after very fast opening and closing of frames Date: Thu, 30 May 2024 14:24:11 -0400 Message-ID: References: <868qzrswpw.fsf@gnu.org> <868qzrqm7h.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10891"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: n142857@gmail.com, cyd@stupidchicken.com, 71223@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 30 20:25:26 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 1sCkSr-0002Qp-44 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 May 2024 20:25:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCkSL-0006YW-65; Thu, 30 May 2024 14:24:53 -0400 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 1sCkSK-0006Y8-7b for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 14:24:52 -0400 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 1sCkSJ-0008L0-SZ for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 14:24:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCkSU-0001YN-EH for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 14:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 18:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71223 X-GNU-PR-Package: emacs Original-Received: via spool by 71223-submit@debbugs.gnu.org id=B71223.17170934745916 (code B ref 71223); Thu, 30 May 2024 18:25:02 +0000 Original-Received: (at 71223) by debbugs.gnu.org; 30 May 2024 18:24:34 +0000 Original-Received: from localhost ([127.0.0.1]:50694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCkS1-0001XM-FM for submit@debbugs.gnu.org; Thu, 30 May 2024 14:24:33 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCkRz-0001X5-0T for 71223@debbugs.gnu.org; Thu, 30 May 2024 14:24:31 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id ED07E44298B; Thu, 30 May 2024 14:24:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1717093452; bh=OJMWbXLjQb+G6rFeyijyN29WfgMXpPwWv6VZZp68Y88=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YAVbOl1pbZ4S+kYaWC6aNNjYkadCfDlV3qzkNvUbRlL6T/eLskelUZliAtCQjVgcP nv1RLyQ8BAQ3waUkS769DZXoD78I+NuuMfPRab2hOWtlE/ndzqfy2zQxWDZ+hBhbxR EUDzoWZ3eD3d45RBR9KDxMrYb6WQ3DoTPPzni4borXtMBT7U3Soh85UgGIj6iSYoyP X+83O8lrAVhfpW28hj+OtoIJNZFhUBnRkvkethhJLUjujpYjULW8oFyDj/S0wwaQaz iCASOLOFA8/P8oHBwPGnNcY8rUYPEwGYvUBtXnNaaa01SSCh/ZJwKaJZoB3I2rfyzs Jes8qPTuzXCNw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1902D442956; Thu, 30 May 2024 14:24:12 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 066AF1204B3; Thu, 30 May 2024 14:24:12 -0400 (EDT) In-Reply-To: <868qzrqm7h.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 May 2024 19:49:22 +0300") 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:286242 Archived-At: >> In my patch these are mostly kept except they are short-circuited when >> there's already some other emacsclient process filtering pending. >> In practice this should rarely make a difference: you need to have at >> least 3 more-or-less-concurrent emacsclients for the difference to show >> up (the first is processed normally, and if there's no 3rd, then by the >> time we process the second there's no other thing pending). > > I'm talking about the mostly-normal situation when a single client > connects and that results in an error. Right, and indeed my code is careful to wait just like old code did, in that case. >> > . let the server and the client have enough time to undo the >> > terminal settings they did when the session started, so that the >> > terminal is left in workable condition after the client exits. >> >> These are kept in the form of timers instead of `sit-for`. >> >> > The bug(s) in question should tell the details. >> >> I don't know which bugs these are, sadly. > > "git log -L" indicates that it's bug#63629. Hmm... I wonder I didn't see it in my `vc-region-history`... Oh, that's because it's something else: commit d6f717cd1dc373707440011a1552b78de2654bba Author: Eli Zaretskii Date: Fri May 26 13:20:56 2023 +0300 Fix emacsclient when there are irrecoverable file-visiting errors * lisp/server.el (server-process-filter, server-return-error): Display the error message to be sent to the client as a regular message, to give the user the opportunity to see it. Delete the terminal immediately after sending the error message to the client, to make sure the terminal's modes are restored. (Bug#63629) is the one where we add the "message + sit-for for 2 seconds" as well as the calls to `delete-terminal`. [ Code which I mostly leave untouched, at least for the "simple" case of a single emacsclient at a time. ] Whereas my question is about commit 2a847524ab57b1b3d6eaa7e12b96be52dbb79509 Author: Chong Yidong Date: Sat Oct 2 20:03:44 2010 -0400 * lisp/server.el (server-process-filter, server-return-error): Give emacsclient time to shut down after receiving an error string. * etc/NEWS: Document tweak to emacsclient exit status. which added the two `sit-for`s (of 1s and 5s respectively) just before `delete-process`. >> [ I must say I don't understand why we need to wait and then call >> `delete-process`. ] > > Because delete-process disconnects us from the terminal, and if we do > that too soon, then neither the error message we sent to the client > nor even the terminal resetting commands will get to their > destination. Or so I concluded at the time; I don't consider myself > an expert on this stuff. I find it odd that "send" followed by "delete process" can result in the send being lost, tho. It seems like it reflects a bug somewhere else. But I'm not an expert in this at all either. E.g. I can't remember why we need to `delete-process`. Stefan