I tried the patch, it still happens at the same point, and the stack is ~12k calls, like in previous tests. process server <664> no longer connected to pipe; closed it process server <665> no longer connected to pipe; closed it error in process sentinel: Lisp nesting exceeds `max-lisp-eval-depth': 1601 error in process sentinel: Lisp nesting exceeds `max-lisp-eval-depth': 1601 error in process filter: Lisp nesting exceeds `max-lisp-eval-depth': 1601 error in process filter: Lisp nesting exceeds `max-lisp-eval-depth': 1601 error in process filter: Lisp nesting exceeds `max-lisp-eval-depth': 1601 error in process sentinel: Lisp nesting exceeds `max-lisp-eval-depth': 1601 […] (gdb) bt #0 pselect64_syscall (sigmask=0x0, timeout=, exceptfds=0x0, writefds=0x7fffffb95010, readfds=0x7fffffb95090, nfds=11) at ../sysdeps/unix/sysv/linux/pselect.c:34 #1 __pselect (nfds=11, readfds=0x7fffffb95090, writefds=0x7fffffb95010, exceptfds=0x0, timeout=, sigmask=0x0) at ../sysdeps/unix/sysv/linux/pselect.c:56 #2 0x00005555557de64a in really_call_select (arg=0x7fffffb94dd0) at thread.c:624 #3 0x00005555556ff527 in flush_stack_call_func1 (func=0x5555557de5b0 , arg=0x7fffffb94dd0) at alloc.c:5534 #4 0x00005555557dda67 in flush_stack_call_func (func=0x5555557de5b0 , arg=0x7fffffb94dd0) at /w/emacs/src/lisp.h:4507 #5 0x00005555557de705 in thread_select (func=0x7ffff551d980 <__pselect>, max_fds=11, rfds=0x7fffffb95090, wfds=0x7fffffb95010, efds=0x0, timeout=0x7fffffb94ff0, sigmask=0x0) at thread.c:656 #6 0x00005555557a8c3c in wait_reading_process_output (time_limit=1, nsecs=0, read_kbd=0, do_display=false, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at process.c:5752 --Type for more, q to quit, c to continue without paging-- #7 0x0000555555592512 in Fsleep_for (seconds=make_fixnum(1), milliseconds=XIL(0)) at dispnew.c:6231 #8 0x00005555557accee in exec_sentinel_error_handler (error_val=XIL(0x7ffff01db9d3)) at process.c:7619 #9 0x0000555555732f74 in internal_condition_case_1 (bfun=0x5555557a9b01 , arg=XIL(0x7ffff01db9f3), handlers=XIL(0x90), hfun=0x5555557acc4d ) at eval.c:1633 #10 0x00005555557ace83 in exec_sentinel (proc=XIL(0x55555657d38d), reason=XIL(0x5555565cf904)) at process.c:7669 #11 0x00005555557ad103 in status_notify (deleting_process=0x0, wait_proc=0x0) at process.c:7761 #12 0x00005555557a8399 in wait_reading_process_output (time_limit=1, nsecs=0, read_kbd=0, do_display=false, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at process.c:5493 #13 0x0000555555592512 in Fsleep_for (seconds=make_fixnum(1), milliseconds=XIL(0)) at dispnew.c:6231 #14 0x00005555557accee in exec_sentinel_error_handler (error_val=XIL(0x7ffff01dd203)) at process.c:7619 #15 0x0000555555732f74 in internal_condition_case_1 (bfun=0x5555557a9b01 , arg=XIL(0x7ffff01dd223), handlers=XIL(0x90), --Type for more, q to quit, c to continue without paging-- hfun=0x5555557acc4d ) at eval.c:1633 #16 0x00005555557ace83 in exec_sentinel (proc=XIL(0x5555567c3b65), reason=XIL(0x555556506a54)) at process.c:7669 #17 0x00005555557ad103 in status_notify (deleting_process=0x0, wait_proc=0x0) at process.c:7761 #18 0x00005555557a8399 in wait_reading_process_output (time_limit=1, nsecs=0, read_kbd=0, do_display=false, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at process.c:5493 #19 0x0000555555592512 in Fsleep_for (seconds=make_fixnum(1), milliseconds=XIL(0)) at dispnew.c:6231 […] (gdb) xbacktrace "sit-for" (0xffc518f8) "server--sit-for" (0xffc51a88) "server-return-error" (0xffc51c50) "server-process-filter" (0xffc51ea8) "sit-for" (0xffc53fa8) "server--sit-for" (0xffc54138) "server-return-error" (0xffc54300) "server-process-filter" (0xffc54558) "sit-for" (0xffc56658) "server--sit-for" (0xffc567e8) "server-return-error" (0xffc569b0) […] On Mon, 27 May 2024 at 12:36, Eli Zaretskii wrote: > > Cc: 71223@debbugs.gnu.org > > Date: Mon, 27 May 2024 15:23:01 +0300 > > From: Eli Zaretskii > > > > Does the patch below help? > > Actually, the more thorough patch below should be better. Can you see > if it solves the problems with "Lisp nesting exceeds > `max-lisp-eval-depth'"? > > Stefan, any comments about the problem and the proposed solution? > > diff --git a/lisp/server.el b/lisp/server.el > index b650532..fcaf0ab 100644 > --- a/lisp/server.el > +++ b/lisp/server.el > @@ -1034,6 +1034,15 @@ server-goto-toplevel > (run-with-timer 0 nil (lambda () (server-execute-continuation proc))) > (top-level))) > > +(defun server--sit-for (proc seconds) > + "Like `sit-for', but disable filter of process PROC and don't > redisplay." > + (let ((orig-filter (process-filter proc))) > + (unwind-protect > + (progn > + (set-process-filter proc nil) > + (sit-for seconds t)) > + (set-process-filter proc orig-filter)))) > + > ;; We use various special properties on process objects: > ;; - `env' stores the info about the environment of the emacsclient > process. > ;; - `continuation' is a no-arg function that we need to execute. It > contains > @@ -1159,7 +1168,7 @@ server-process-filter > ;; it, in case the error written by emacsclient to stderr is not > ;; visible for some reason. > (message "Authentication failed") > - (sit-for 2) > + (server--sit-for proc 2) > (server-send-string > proc (concat "-error " (server-quote-arg "Authentication failed"))) > (unless (eq system-type 'windows-nt) > @@ -1169,7 +1178,7 @@ server-process-filter > (delete-terminal terminal)))) > ;; Before calling `delete-process', give emacsclient time to > ;; receive the error string and shut down on its own. > - (sit-for 1) > + (server--sit-for proc 1) > (delete-process proc) > ;; We return immediately. > (cl-return-from server-process-filter))) > @@ -1508,7 +1517,7 @@ server-return-error > ;; it, in case the error written by emacsclient to stderr is not > ;; visible for some reason. > (message (error-message-string err)) > - (sit-for 2) > + (server--sit-for proc 2) > (server-send-string > proc (concat "-error " (server-quote-arg > (error-message-string err)))) > @@ -1520,7 +1529,7 @@ server-return-error > (delete-terminal terminal)))) > ;; Before calling `delete-process', give emacsclient time to > ;; receive the error string and shut down on its own. > - (sit-for 5) > + (server--sit-for proc 5) > (delete-process proc))) > > (defun server-goto-line-column (line-col) >