unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 44180@debbugs.gnu.org
Subject: bug#44180: 28.0.50; Emacs frames won't redisplay unless resized
Date: Tue, 27 Oct 2020 12:48:52 -0700	[thread overview]
Message-ID: <87ft5z1mcb.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <83eeljecd5.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 27 Oct 2020 20:45:58 +0200")

[-- Attachment #1: Type: text/plain, Size: 2486 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  44180@debbugs.gnu.org
>> Date: Tue, 27 Oct 2020 11:11:26 -0700
>> 
>> I think I'm going to need more help here, though. I have built master
>> with optimizations off, I start GDB in a controlling emacs, set a
>> breakpoint at xdisp.c:34381 at the beginning of expose_frame, and then
>> "run -Q".
>> 
>> That pops up a new frame, and we hit the breakpoint.
>
> That's the initial frame, isn't it?  If so, this is not the frame we
> want, we want a frame that was obscured and then gets the focus.
>
> To save yourself from a lot of unwanted breakpoint hits, I suggest
> this paradigm:
>
>  $ gdb ./emacs
>  (gdb) break Frecenter
>  (gdb) r -Q
>
> Inside Emacs:
>
>   M-x blink-cursor-mode RET
>   M-x global-eldoc-mode RET
>
> Now create one or more other frames and make them obscured
> ("iconified").  Now type C-l -- this will hit the breakpoint in
> Frecenter, and GDB will kick in.  Then set a breakpoint in
> expose_frame and type "continue".  Finally, switch to a frame that was
> obscured: does the breakpoint in expose_frame break, and if so, is
> Emacs told to expose the correct frame, the one that was obscured and
> is going to become visible?  If it's the correct frame, show the
> backtrace.
>
> Then do all this again, but after reverting the change which causes
> the problem.  By comparing the backtraces and the behavior, we might
> begin to understand how this change causes the problem in your case.

Okay, hope this is helpful. I start in a workspace with only the
terminal, do the gdb dance, and when I run "r -Q" the first frame
appears, in stacked mode, taking up the whole screen. I create a second
frame: now i3 has a vertical stack of three windows: terminal, emacs1
and emacs2 -- emacs2 is focused.

I shut off blink cursor and global eldoc, note the frame addresses, then
move focus "wrap-around" style down and back around to the terminal, so
the emacs1 window (which is the "stuck" one in master) never receives
focus (that might not be important).

Back in the terminal I pause execution, set the expose_frame breakpoint,
turn on logging, and continue. Then move focus down to emacs1, back up
to the terminal, see the breakpoint has triggered, get a backtrace, and
confirm that the frame in question is indeed emacs1.

I did that exact routine in both master and a "revert" branch, with the
commit reverted.

Fingers crossed!


[-- Attachment #2: master.txt --]
[-- Type: text/plain, Size: 5048 bytes --]

#0  expose_frame (f=0x555556317630, x=0, y=1042, w=1900, h=10) at xdisp.c:34381
#1  0x00005555556f2711 in handle_one_xevent (dpyinfo=0x5555560a2fe0, event=0x7fffffffd420, finish=0x555555e1f6fc <current_finish>, hold_quit=0x7fffffffd730) at xterm.c:8243
#2  0x00005555556f13dd in event_handler_gdk (gxev=0x7fffffffd420, ev=0x555555fecde0, data=0x0) at xterm.c:7768
#3  0x00007ffff75c654f in  () at /usr/lib/libgdk-3.so.0
#4  0x00007ffff75ca10b in  () at /usr/lib/libgdk-3.so.0
#5  0x00007ffff756e15b in gdk_display_get_event () at /usr/lib/libgdk-3.so.0
#6  0x00007ffff75c9e44 in  () at /usr/lib/libgdk-3.so.0
#7  0x00007ffff6f8d914 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#8  0x00007ffff6fe17d1 in  () at /usr/lib/libglib-2.0.so.0
#9  0x00007ffff6f8c121 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#10 0x00007ffff781d597 in gtk_main_iteration () at /usr/lib/libgtk-3.so.0
#11 0x00005555556f5491 in XTread_socket (terminal=0x555555f94d38, hold_quit=0x7fffffffd730) at xterm.c:9395
#12 0x000055555574f92d in gobble_input () at keyboard.c:6890
#13 0x000055555574ff5b in handle_async_input () at keyboard.c:7127
#14 0x000055555574ff7a in process_pending_signals () at keyboard.c:7141
#15 0x0000555555890bab in wait_reading_process_output (time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at process.c:5248
#16 0x00005555555a857f in sit_for (timeout=make_fixnum(30), reading=true, display_option=1) at dispnew.c:6056
#17 0x0000555555744631 in read_char (commandflag=1, map=XIL(0x555555f8dbb3), prev_event=XIL(0), used_mouse_menu=0x7fffffffdf5d, end_time=0x0) at keyboard.c:2742
#18 0x0000555555757125 in read_key_sequence (keybuf=0x7fffffffe140, prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9552
#19 0x000055555573fd76 in command_loop_1 () at keyboard.c:1354
#20 0x000055555581db25 in internal_condition_case (bfun=0x55555573f8dc <command_loop_1>, handlers=XIL(0x90), hfun=0x55555573eed0 <cmd_error>) at eval.c:1359
#21 0x000055555573f4c5 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1095
#22 0x000055555581cf79 in internal_catch (tag=XIL(0xd710), func=0x55555573f498 <command_loop_2>, arg=XIL(0)) at eval.c:1120
#23 0x000055555573f464 in command_loop () at keyboard.c:1074
#24 0x000055555573e9b9 in recursive_edit_1 () at keyboard.c:718
#25 0x000055555573ebb0 in Frecursive_edit () at keyboard.c:790
#26 0x000055555573a984 in main (argc=2, argv=0x7fffffffe5c8) at emacs.c:2047
Continuing.

Thread 1 "emacs" hit Breakpoint 3, expose_frame (f=0x555556317630, x=0, y=1052, w=1916, h=12) at xdisp.c:34381
34381	{
Continuing.

Thread 1 "emacs" received signal SIGTSTP, Stopped (user).
0x00007ffff5af2c96 in pselect () from /usr/lib/libc.so.6
#0  0x00007ffff5af2c96 in pselect () at /usr/lib/libc.so.6
#1  0x00005555558d3322 in really_call_select (arg=0x7fffffffd170) at thread.c:592
#2  0x00005555557e1ff5 in flush_stack_call_func1 (func=0x5555558d325b <really_call_select>, arg=0x7fffffffd170) at alloc.c:5066
#3  0x00005555558d2620 in flush_stack_call_func (func=0x5555558d325b <really_call_select>, arg=0x7fffffffd170) at lisp.h:3791
#4  0x00005555558d341f in thread_select (func=0x7ffff5af2bd0 <pselect>, max_fds=7, rfds=0x7fffffffd280, wfds=0x7fffffffd300, efds=0x0, timeout=0x7fffffffd8d0, sigmask=0x0) at thread.c:624
#5  0x0000555555909f8a in xg_select (fds_lim=7, rfds=0x7fffffffd940, wfds=0x7fffffffd9c0, efds=0x0, timeout=0x7fffffffd8d0, sigmask=0x0) at xgselect.c:131
#6  0x0000555555891bdc in wait_reading_process_output (time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at process.c:5604
#7  0x00005555555a857f in sit_for (timeout=make_fixnum(30), reading=true, display_option=1) at dispnew.c:6056
#8  0x0000555555744631 in read_char (commandflag=1, map=XIL(0x555555f8dbb3), prev_event=XIL(0), used_mouse_menu=0x7fffffffdf5d, end_time=0x0) at keyboard.c:2742
#9  0x0000555555757125 in read_key_sequence (keybuf=0x7fffffffe140, prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9552
#10 0x000055555573fd76 in command_loop_1 () at keyboard.c:1354
#11 0x000055555581db25 in internal_condition_case (bfun=0x55555573f8dc <command_loop_1>, handlers=XIL(0x90), hfun=0x55555573eed0 <cmd_error>) at eval.c:1359
#12 0x000055555573f4c5 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1095
#13 0x000055555581cf79 in internal_catch (tag=XIL(0xd710), func=0x55555573f498 <command_loop_2>, arg=XIL(0)) at eval.c:1120
#14 0x000055555573f464 in command_loop () at keyboard.c:1074
#15 0x000055555573e9b9 in recursive_edit_1 () at keyboard.c:718
#16 0x000055555573ebb0 in Frecursive_edit () at keyboard.c:790
#17 0x000055555573a984 in main (argc=2, argv=0x7fffffffe5c8) at emacs.c:2047
Continuing.
[Thread 0x7ffff1132640 (LWP 49694) exited]
[Thread 0x7ffff2cf3fc0 (LWP 49690) exited]
[Inferior 1 (process 49690) exited normally]

[-- Attachment #3: revert.txt --]
[-- Type: text/plain, Size: 5520 bytes --]

#0  0x00007ffff5af2c96 in pselect () at /usr/lib/libc.so.6
#1  0x000055555576b78c in really_call_select (arg=0x7fffffffcf70) at thread.c:592
#2  0x000055555576c56f in flush_stack_call_func (arg=0x7fffffffcf70, func=0x55555576b720 <really_call_select>) at lisp.h:3791
#3  thread_select (func=<optimized out>, max_fds=max_fds@entry=7, rfds=rfds@entry=0x7fffffffd070, wfds=wfds@entry=0x7fffffffd0f0, efds=efds@entry=0x0, timeout=timeout@entry=0x7fffffffd6a0, sigmask=0x0)
    at thread.c:624
#4  0x0000555555788ffb in xg_select (fds_lim=7, rfds=rfds@entry=0x7fffffffd7b0, wfds=wfds@entry=0x7fffffffd830, efds=efds@entry=0x0, timeout=timeout@entry=0x7fffffffd6a0, sigmask=sigmask@entry=0x0)
    at xgselect.c:131
#5  0x0000555555749dcd in wait_reading_process_output
    (time_limit=time_limit@entry=30, nsecs=nsecs@entry=0, read_kbd=read_kbd@entry=-1, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=XIL(0), wait_proc=wait_proc@entry=0x0, just_wait_proc=0)
    at process.c:5604
#6  0x00005555555ab1ff in sit_for (timeout=timeout@entry=make_fixnum(30), reading=reading@entry=true, display_option=display_option@entry=1) at lisp.h:1007
#7  0x000055555569431f in read_char (commandflag=1, map=XIL(0x55555613fad3), prev_event=XIL(0), used_mouse_menu=0x7fffffffe04b, end_time=0x0) at lisp.h:1122
#8  0x0000555555694d44 in read_key_sequence (keybuf=<optimized out>, prompt=XIL(0), dont_downcase_last=<optimized out>, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=<optimized out>)
    at keyboard.c:9552
#9  0x00005555556966cc in command_loop_1 () at lisp.h:1007
#10 0x0000555555703167 in internal_condition_case (bfun=bfun@entry=0x5555556964e0 <command_loop_1>, handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x55555568cc10 <cmd_error>) at eval.c:1359
#11 0x0000555555687194 in command_loop_2 (ignore=ignore@entry=XIL(0)) at lisp.h:1007
#12 0x00005555557030c1 in internal_catch (tag=tag@entry=XIL(0xd710), func=func@entry=0x555555687170 <command_loop_2>, arg=arg@entry=XIL(0)) at eval.c:1120
#13 0x000055555568713b in command_loop () at lisp.h:1007
#14 0x000055555568c826 in recursive_edit_1 () at keyboard.c:718
#15 0x000055555568cb52 in Frecursive_edit () at keyboard.c:790
#16 0x00005555555a0fcc in main (argc=2, argv=<optimized out>) at emacs.c:2047
Continuing.

Thread 1 "emacs" hit Breakpoint 3, expose_frame (f=0x55555604ae20, x=0, y=1042, w=1916, h=22) at xdisp.c:34381
34381	{
#0  expose_frame (f=0x55555604ae20, x=0, y=1042, w=1916, h=22) at xdisp.c:34381
#1  0x0000555555661b40 in handle_one_xevent (dpyinfo=<optimized out>, event=0x7fffffffd270, finish=0x555555b68ab0 <current_finish>, hold_quit=<optimized out>) at xterm.c:8243
#2  0x0000555555663078 in event_handler_gdk (gxev=0x7fffffffd270, ev=<optimized out>, data=<optimized out>) at xterm.c:7767
#3  0x00007ffff75c654f in  () at /usr/lib/libgdk-3.so.0
#4  0x00007ffff75ca10b in  () at /usr/lib/libgdk-3.so.0
#5  0x00007ffff756e15b in gdk_display_get_event () at /usr/lib/libgdk-3.so.0
#6  0x00007ffff75c9e44 in  () at /usr/lib/libgdk-3.so.0
#7  0x00007ffff6f8d914 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#8  0x00007ffff6fe17d1 in  () at /usr/lib/libglib-2.0.so.0
#9  0x00007ffff6f8c121 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#10 0x00007ffff781d597 in gtk_main_iteration () at /usr/lib/libgtk-3.so.0
#11 0x0000555555655df3 in XTread_socket (terminal=<optimized out>, hold_quit=0x7fffffffd530) at xterm.c:9394
#12 0x000055555568e552 in gobble_input () at keyboard.c:6890
#13 0x000055555568eb35 in handle_async_input () at keyboard.c:7127
#14 process_pending_signals () at keyboard.c:7141
#15 0x0000555555749e1d in wait_reading_process_output
    (time_limit=time_limit@entry=30, nsecs=nsecs@entry=0, read_kbd=read_kbd@entry=-1, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=XIL(0), wait_proc=wait_proc@entry=0x0, just_wait_proc=0)
    at process.c:5248
#16 0x00005555555ab1ff in sit_for (timeout=timeout@entry=make_fixnum(30), reading=reading@entry=true, display_option=display_option@entry=1) at lisp.h:1007
#17 0x000055555569431f in read_char (commandflag=1, map=XIL(0x555555c60ed3), prev_event=XIL(0), used_mouse_menu=0x7fffffffe04b, end_time=0x0) at lisp.h:1122
#18 0x0000555555694d44 in read_key_sequence (keybuf=<optimized out>, prompt=XIL(0), dont_downcase_last=<optimized out>, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=<optimized out>)
    at keyboard.c:9552
#19 0x00005555556966cc in command_loop_1 () at lisp.h:1007
#20 0x0000555555703167 in internal_condition_case (bfun=bfun@entry=0x5555556964e0 <command_loop_1>, handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x55555568cc10 <cmd_error>) at eval.c:1359
#21 0x0000555555687194 in command_loop_2 (ignore=ignore@entry=XIL(0)) at lisp.h:1007
#22 0x00005555557030c1 in internal_catch (tag=tag@entry=XIL(0xd710), func=func@entry=0x555555687170 <command_loop_2>, arg=arg@entry=XIL(0)) at eval.c:1120
#23 0x000055555568713b in command_loop () at lisp.h:1007
#24 0x000055555568c826 in recursive_edit_1 () at keyboard.c:718
#25 0x000055555568cb52 in Frecursive_edit () at keyboard.c:790
#26 0x00005555555a0fcc in main (argc=2, argv=<optimized out>) at emacs.c:2047
Currently logging to "gdb.txt".
Logs will be appended to the log file.
Output will be logged and displayed.
Debug output will be logged and displayed.
Continuing.
[Thread 0x7ffff1133640 (LWP 49752) exited]
[Thread 0x7ffff2cf3fc0 (LWP 49748) exited]
[Inferior 1 (process 49748) exited normally]

  reply	other threads:[~2020-10-27 19:48 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 18:17 bug#44180: 28.0.50; Emacs frames won't redisplay unless resized Eric Abrahamsen
2020-10-23 18:25 ` Eli Zaretskii
2020-10-23 19:07   ` Eric Abrahamsen
2020-10-23 19:38     ` Eli Zaretskii
2020-10-23 21:07       ` Eric Abrahamsen
2020-10-24  6:55         ` martin rudalics
2020-10-24  8:36           ` Eli Zaretskii
2020-10-24 20:19           ` Eric Abrahamsen
2020-10-25 15:08             ` Eli Zaretskii
2020-10-25 16:01               ` Eric Abrahamsen
2020-10-25 16:16                 ` Eli Zaretskii
2020-10-25 16:28                   ` Eric Abrahamsen
2020-10-25 16:55                     ` Eli Zaretskii
2020-10-25 18:26                       ` Eric Abrahamsen
2020-10-26 18:24                 ` martin rudalics
2020-10-26 19:51                   ` Eric Abrahamsen
2020-10-27  9:08                     ` martin rudalics
2020-10-27 18:11                       ` Eric Abrahamsen
2020-10-27 18:45                         ` Eli Zaretskii
2020-10-27 19:48                           ` Eric Abrahamsen [this message]
2020-10-31  8:28                             ` Eli Zaretskii
2020-11-06  1:52                               ` Eric Abrahamsen
2022-04-24 14:08                                 ` Lars Ingebrigtsen
2022-04-24 15:26                                   ` Eric Abrahamsen
2022-04-24 15:27                                     ` Lars Ingebrigtsen
2020-10-25 16:26               ` Sascha Sadeghian
2020-10-25 16:57                 ` Eli Zaretskii
2020-10-24  8:03         ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87ft5z1mcb.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=44180@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).