all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: n142857@gmail.com, cyd@stupidchicken.com, 71223@debbugs.gnu.org
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	[thread overview]
Message-ID: <jwvcyp3rws5.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <868qzrqm7h.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 May 2024 19:49:22 +0300")

>> 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 <eliz@gnu.org>
    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 <cyd@gnu.org>
    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






  reply	other threads:[~2024-05-30 18:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 11:01 bug#71223: 30.0.50; stack overflow after very fast opening and closing of frames Daniel Clemente
2024-05-27 12:23 ` Eli Zaretskii
2024-05-27 12:36   ` Eli Zaretskii
2024-05-27 14:44     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-27 15:21       ` Eli Zaretskii
2024-05-27 17:49         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-27 18:15           ` Eli Zaretskii
2024-05-27 18:33             ` Eli Zaretskii
2024-05-29  0:30               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 11:48                 ` Eli Zaretskii
2024-05-29 20:58                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30  5:12                     ` Eli Zaretskii
2024-05-30 13:40                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30 15:29                         ` Eli Zaretskii
2024-05-27 15:21     ` Daniel Clemente
2024-05-27 15:26       ` Eli Zaretskii
2024-05-29  0:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 10:54   ` Daniel Clemente
2024-05-29 19:56     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30  4:56       ` Eli Zaretskii
2024-05-30 13:35         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 21:07   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30  5:19     ` Eli Zaretskii
2024-05-30 16:09       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30 16:49         ` Eli Zaretskii
2024-05-30 18:24           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-30 22:39             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-31  5:45               ` Eli Zaretskii
2024-05-31 12:41                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30 11:22     ` Daniel Clemente

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvcyp3rws5.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=71223@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=n142857@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.