all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Clemente <n142857@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 71223@debbugs.gnu.org
Subject: bug#71223: 30.0.50; stack overflow after very fast opening and closing of frames
Date: Wed, 29 May 2024 10:54:47 +0000	[thread overview]
Message-ID: <CAJKAhPDk9y+sFcajjBj6o6p+-CKpWAf4W2+h1uzQtcC07Fh8BA@mail.gmail.com> (raw)
In-Reply-To: <jwv34q131k4.fsf-monnier+emacs@gnu.org>

> Could you try the patch below which sequentializes the processing of the
> process-filters to avoid such recursion?

Running on d9512da49514623ef3e35524dc894c06f2c0ce20 (from yesterday)
with only this patch, and a simple loop (10 seconds are enough):

for j in `seq 10`; do for i in `seq 10`; do urxvt -e emacsclient '-nw'
'-e' '(dired "~")' &; done; sleep 1 && killall emacsclient; done

(gdb) run --fg-daemon -Q
Starting program: /opt/dc/emacs/bin/emacs --fg-daemon -Q
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Starting Emacs daemon.
[Detaching after vfork from child process 1028]
[Detaching after vfork from child process 1033]
[Detaching after vfork from child process 1034]
process server <5> no longer connected to pipe; closed it
Process server <6> not running: connection broken by remote peer

Process server <7> not running: connection broken by remote peer

Process server <8> not running: connection broken by remote peer

Process server <9> not running: connection broken by remote peer

Process server <10> not running: connection broken by remote peer

Process server <11> not running: connection broken by remote peer

Process server <12> not running: connection broken by remote peer

Process server <13> not running: connection broken by remote peer

Process server <14> not running: connection broken by remote peer

Process server <15> not running: connection broken by remote peer

Process server <16> not running: connection broken by remote peer

Process server <17> not running: connection broken by remote peer

Process server <18> not running: connection broken by remote peer

Process server <19> not running: connection broken by remote peer

Process server <20> not running: connection broken by remote peer

Process server <21> not running: connection broken by remote peer

Process server <22> not running: connection broken by remote peer

Process server <23> not running: connection broken by remote peer

Process server <24> not running: connection broken by remote peer

Process server <25> not running: connection broken by remote peer

Process server <26> not running: connection broken by remote peer

Process server <27> not running: connection broken by remote peer

[…]
(new message appearing every 2 seconds)

At that point, it's unresponsive and I can't open new emacsclient.
They open a black window, where after a time I see "Server not
responding". If I wait until all the "connection broken" errors slowly
end, then these frames will load (i.e. dired is visible), and new
frames will load too.

With casual usage, i.e. just opening a few frames and closing them
after they are fully loaded (visible text inside) there are no
"connection broken" messages. I think the error appears only when I'm
closing a frame that was still in the process of being opened.

I stopped it when it was hung:

^Z
Program received signal SIGTSTP, Stopped (user).
pselect64_syscall (sigmask=0x0, timeout=<optimized out>,
exceptfds=0x0, writefds=0x7fffffffa5b0, readfds=0x7fffffffa630,
nfds=14)
    at ../sysdeps/unix/sysv/linux/pselect.c:34
34    in ../sysdeps/unix/sysv/linux/pselect.c
(gdb) bt
#0  pselect64_syscall (sigmask=0x0, timeout=<optimized out>,
exceptfds=0x0, writefds=0x7fffffffa5b0, readfds=0x7fffffffa630,
nfds=14)
    at ../sysdeps/unix/sysv/linux/pselect.c:34
#1  __pselect (nfds=14, readfds=0x7fffffffa630,
writefds=0x7fffffffa5b0, exceptfds=0x0, timeout=<optimized out>,
sigmask=0x0)
    at ../sysdeps/unix/sysv/linux/pselect.c:56
#2  0x00005555557de65c in really_call_select (arg=0x7fffffffa370) at
thread.c:624
#3  0x00005555556ff539 in flush_stack_call_func1 (func=0x5555557de5c2
<really_call_select>, arg=0x7fffffffa370) at alloc.c:5534
#4  0x00005555557dda79 in flush_stack_call_func (func=0x5555557de5c2
<really_call_select>, arg=0x7fffffffa370) at /w/emacs/src/lisp.h:4507
#5  0x00005555557de717 in thread_select (func=0x7ffff551d980
<__pselect>, max_fds=14, rfds=0x7fffffffa630, wfds=0x7fffffffa5b0,
efds=0x0,
    timeout=0x7fffffffa590, sigmask=0x0) at thread.c:656
#6  0x00005555557a8c4e in wait_reading_process_output (time_limit=1,
nsecs=999978544, read_kbd=-1, do_display=true, wait_for_cell=XIL(0),
    wait_proc=0x0, just_wait_proc=0) at process.c:5752
#7  0x0000555555678b60 in kbd_buffer_get_event (kbp=0x7fffffffa968,
used_mouse_menu=0x0, end_time=0x7fffffffafe0) at keyboard.c:4058
#8  0x0000555555674cd7 in read_event_from_main_queue
(end_time=0x7fffffffafe0, local_getcjmp=0x7fffffffadb0,
used_mouse_menu=0x0)
    at keyboard.c:2330
#9  0x0000555555674f8b in read_decoded_event_from_main_queue
(end_time=0x7fffffffafe0, local_getcjmp=0x7fffffffadb0,
prev_event=XIL(0),
    used_mouse_menu=0x0) at keyboard.c:2394
#10 0x0000555555676735 in read_char (commandflag=0, map=XIL(0),
prev_event=XIL(0), used_mouse_menu=0x0, end_time=0x7fffffffafe0) at
keyboard.c:3015
#11 0x000055555576c91b in read_filtered_event (no_switch_frame=false,
ascii_required=false, error_nonascii=false, input_method=true,
    seconds=make_fixnum(2)) at lread.c:791
#12 0x000055555576cc8d in Fread_event (prompt=XIL(0),
inherit_input_method=XIL(0x30), seconds=make_fixnum(2)) at lread.c:941
#13 0x00007ffff18c8dbf in F7369742d666f72_sit_for_0 ()
   from /opt/dc/emacs/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-ea7acd4b/preloaded/subr-13adf6a6-0e73955f.eln
#14 0x0000555555736ba3 in funcall_subr (subr=0x7ffff1a173b0,
numargs=1, args=0x7fffffffb208) at eval.c:3163
#15 0x0000555555736611 in funcall_general (fun=XIL(0x7ffff1a173b5),
numargs=1, args=0x7fffffffb208) at eval.c:3040
#16 0x00005555557368c2 in Ffuncall (nargs=2, args=0x7fffffffb200) at eval.c:3093
#17 0x00007ffff11943c3 in
F7365727665722d72657475726e2d6572726f72_server_return_error_0 ()
   from /home/dc/.emacs.d/eln-cache/30.0.50-ea7acd4b/server-0cc44189-25489db9.eln
#18 0x0000555555736ba3 in funcall_subr (subr=0x555555ee49f0,
numargs=2, args=0x7fffffffb3d0) at eval.c:3163
#19 0x0000555555736611 in funcall_general (fun=XIL(0x555555ee49f5),
numargs=2, args=0x7fffffffb3d0) at eval.c:3040
#20 0x00005555557368c2 in Ffuncall (nargs=3, args=0x7fffffffb3c8) at eval.c:3093
#21 0x00007ffff1191258 in
F7365727665722d2d70726f636573732d66696c746572_server__process_filter_0
()
   from /home/dc/.emacs.d/eln-cache/30.0.50-ea7acd4b/server-0cc44189-25489db9.eln
#22 0x0000555555736ba3 in funcall_subr (subr=0x555555ee4940,
numargs=2, args=0x7fffffffb628) at eval.c:3163
#23 0x0000555555736611 in funcall_general (fun=XIL(0x555555ee4945),
numargs=2, args=0x7fffffffb628) at eval.c:3040
#24 0x00005555557368c2 in Ffuncall (nargs=3, args=0x7fffffffb620) at eval.c:3093
#25 0x00007ffff1190dcc in
F7365727665722d70726f636573732d66696c746572_server_process_filter_0 ()
   from /home/dc/.emacs.d/eln-cache/30.0.50-ea7acd4b/server-0cc44189-25489db9.eln
#26 0x0000555555736ba3 in funcall_subr (subr=0x555555ee48e8,
numargs=2, args=0x7fffffffb7b8) at eval.c:3163
#27 0x0000555555736611 in funcall_general (fun=XIL(0x555555ee48ed),
numargs=2, args=0x7fffffffb7b8) at eval.c:3040
#28 0x00005555557368c2 in Ffuncall (nargs=3, args=0x7fffffffb7b0) at eval.c:3093
#29 0x0000555555735dc3 in Fapply (nargs=2, args=0x7fffffffb860) at eval.c:2765
#30 0x000055555573636e in apply1 (fn=XIL(0x118d50),
arg=XIL(0x7ffff2b56373)) at eval.c:2981
#31 0x00005555557a9b4a in read_process_output_call
(fun_and_args=XIL(0x7ffff2b56363)) at process.c:6130
#32 0x0000555555732f95 in internal_condition_case_1
(bfun=0x5555557a9b13 <read_process_output_call>,
arg=XIL(0x7ffff2b56363), handlers=XIL(0x90),
    hfun=0x5555557a9b50 <read_process_output_error_handler>) at eval.c:1637
#33 0x00005555557aa462 in read_and_dispose_of_process_output (p=0x5555565d77a0,
    chars=0x7fffffffb980 "-env MAIL=/var/mail/dc -env
LANGUAGE=en_US:en -env GTK_CSD=0 -env
WORKON_HOME=/home/dc/.virtualenvs -env USER=dc -env XDG_SEAT=seat0
-env VAGRANT_DISABLE_VBOXSYMLINKCREATE=1 -env SSH_AGENT_PID=1016
-e"..., nbytes=3744, coding=0x55555608a1f0) at process.c:6354
#34 0x00005555557aa06e in read_process_output
(proc=XIL(0x5555565d77a5), channel=17) at process.c:6264
#35 0x00005555557a92ee in wait_reading_process_output (time_limit=0,
nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0),
wait_proc=0x0,
    just_wait_proc=0) at process.c:5948
#36 0x0000555555678cf3 in kbd_buffer_get_event (kbp=0x7fffffffd008,
used_mouse_menu=0x7fffffffd68f, end_time=0x0) at keyboard.c:4079
#37 0x0000555555674cd7 in read_event_from_main_queue (end_time=0x0,
local_getcjmp=0x7fffffffd450, used_mouse_menu=0x7fffffffd68f)
    at keyboard.c:2330
#38 0x0000555555674f8b in read_decoded_event_from_main_queue
(end_time=0x0, local_getcjmp=0x7fffffffd450, prev_event=XIL(0),
    used_mouse_menu=0x7fffffffd68f) at keyboard.c:2394
#39 0x0000555555676735 in read_char (commandflag=1,
map=XIL(0x7ffff03edd83), prev_event=XIL(0),
used_mouse_menu=0x7fffffffd68f, end_time=0x0)
    at keyboard.c:3015
#40 0x0000555555686142 in read_key_sequence (keybuf=0x7fffffffd8a0,
prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true,
    fix_current_buffer=true, prevent_redisplay=false,
disable_text_conversion_p=false) at keyboard.c:10728
#41 0x000055555567263c in command_loop_1 () at keyboard.c:1429
#42 0x0000555555732eee in internal_condition_case (bfun=0x555555672249
<command_loop_1>, handlers=XIL(0x90), hfun=0x5555556717eb <cmd_error>)
--Type <RET> for more, q to quit, c to continue without paging--
    at eval.c:1613
#43 0x0000555555671ea6 in command_loop_2 (handlers=XIL(0x90)) at keyboard.c:1168
#44 0x00005555557323f5 in internal_catch (tag=XIL(0xfc60),
func=0x555555671e7c <command_loop_2>, arg=XIL(0x90)) at eval.c:1292
#45 0x0000555555671e38 in command_loop () at keyboard.c:1146
#46 0x000055555567138d in recursive_edit_1 () at keyboard.c:754
#47 0x0000555555671539 in Frecursive_edit () at keyboard.c:837
#48 0x000055555566da30 in main (argc=3, argv=0x7fffffffdec8) at emacs.c:2621
(gdb) xbacktrace
"sit-for" (0xffffb208)
"server-return-error" (0xffffb3d0)
"server--process-filter" (0xffffb628)
"server-process-filter" (0xffffb7b8)
(gdb)





  reply	other threads:[~2024-05-29 10:54 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 [this message]
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
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=CAJKAhPDk9y+sFcajjBj6o6p+-CKpWAf4W2+h1uzQtcC07Fh8BA@mail.gmail.com \
    --to=n142857@gmail.com \
    --cc=71223@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.