Subject: Re: bug#75056: 31.0.50; tty-child-frames with server / multiple clients possible hangs

From: martin rudalics <[email-masked]>
Date: Sat, 15 Feb 2025 19:20:38 +0100

> Works perfectly, thanks!

There's a problem with moving nested child frames out of their child
parents.  Load the attached tty-child-frames.el do first M-l and then
C-M-l.  You should see a grey child frame embedded in an orange child
frame.  Now do

(set-frame-parameter tty-3 'left (- 30))

This gets me

Program received signal SIGSEGV, Segmentation fault.
0x00000000005497d2 in FACE_FROM_ID (f=0xc383e60, id=0) at ../../src/frame.h:1631
1631	  eassert (0 <= id && id < FRAME_FACE_CACHE (f)->used);
(gdb) bt
#0  0x00000000005497d2 in FACE_FROM_ID (f=0xc383e60, id=0) at ../../src/frame.h:1631
#1  0x000000000054bc11 in tty_write_glyphs (f=0xc2c9d30, string=0x7fb8f65f86e0, len=71) at ../../src/term.c:793
#2  0x00000000005571c2 in write_glyphs (f=0xc2c9d30, string=0x7fb8f65f84b0, len=71) at ../../src/terminal.c:182
#3  0x000000000042c80b in write_row (f=0xc2c9d30, vpos=12, updating_menu_p=false) at ../../src/dispnew.c:5917
#4  0x000000000042bd05 in write_matrix (f=0xc2c9d30, inhibit_id_p=false, updating_menu_p=false) at ../../src/dispnew.c:5698
#5  0x0000000000427544 in combine_updates_for_frame (f=0xc2c9d30, inhibit_scrolling=false) at ../../src/dispnew.c:4001
#6  0x0000000000427880 in combine_updates (roots=XIL(0x7fb8f3a6a0d3)) at ../../src/dispnew.c:4050
#7  0x0000000000483026 in redisplay_internal () at ../../src/xdisp.c:17613
#8  0x00000000004808db in redisplay () at ../../src/xdisp.c:16670
#9  0x00000000005f6708 in read_char (commandflag=1, map=XIL(0x7fb8f3a6ab83), prev_event=XIL(0), used_mouse_menu=0x7ffd6018477f, end_time=0x0) at ../../src/keyboard.c:2672
#10 0x000000000060a767 in read_key_sequence (keybuf=0x7ffd60184930, 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 ../../src/keyboard.c:10757
#11 0x00000000005f2a89 in command_loop_1 () at ../../src/keyboard.c:1424
#12 0x00000000006d02d5 in internal_condition_case (bfun=0x5f265a <command_loop_1>, handlers=XIL(0x90), hfun=0x5f1adc <cmd_error>) at ../../src/eval.c:1602
#13 0x00000000005f2221 in command_loop_2 (handlers=XIL(0x90)) at ../../src/keyboard.c:1163
#14 0x00000000006cf73f in internal_catch (tag=XIL(0x12390), func=0x5f21f7 <command_loop_2>, arg=XIL(0x90)) at ../../src/eval.c:1282
#15 0x00000000005f21b3 in command_loop () at ../../src/keyboard.c:1141
#16 0x00000000005f157e in recursive_edit_1 () at ../../src/keyboard.c:749
#17 0x00000000005f17aa in Frecursive_edit () at ../../src/keyboard.c:832
#18 0x00000000005ecf8c in main (argc=5, argv=0x7ffd60184f68) at ../../src/emacs.c:2558

Lisp Backtrace:
"redisplay_internal (C function)" (0x0)

If you see no simple way to fix this, we can disallow moving child
frames outside their non-root parents.  It's a bit inconsistent because
the scenario works on GUIs and it works for tty child frames with a root
parent.

martin