Subject: bug#76406: 31.0.50; Crash with tty child frames

From: Gerd Möllmann <[email-masked]>
Date: Wed, 19 Feb 2025 06:01:30 +0100

Gerd Möllmann <[email-masked]> writes:

> With my latest patch and tty-child-frames.el, doing C-l M-l and C-M-l to
> get me three child frames, clicking into the yellow frame and trying to
> change its buffer by clicking at the *Messages* menu item I get
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000054a24e in FACE_FROM_ID (f=0x26306a68, id=11) at ../../src/frame.h:1631
> 1631	  eassert (0 <= id && id < FRAME_FACE_CACHE (f)->used);
> (gdb) bt>

Hi Martin, I need some more info because I can't reproduce this yet.

I've build master 849475695a1136ffaefd26c72616ec319da45119 plus your
diff on top, which I have attached to the bug report. The build is with
checking, --enable-checking=yes,glyphs. Complete config:

#define EMACS_CONFIG_OPTIONS "--without-ns --cache-file /var/folders/1d/k_6t25f94sl83szqbf8gpkrh0000gn/T//config.cache.martin --enable-checking=yes,glyphs --with-native-compilation=no CC=clang 'CFLAGS=-Wgnu-imaginary-constant -Wunused-result -g -g -O0 -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks -Wno-ignored-attributes -Wno-flag-enum -Wno-missing-method-return-type -Wno-variadic-macros -Wno-strict-prototypes -Wno-availability -Wno-nullability-completeness' --prefix=/Users/gerd/.local"

I'm using this as the file to make child frames:

The only change compared to your original should be that I load tm.el,
activate tm-menu-mode, and use M-g <n> key bindings instead of C-l and
so on.

With this, emacs -Q, I

- open tty-1, tty-2, tty-3 in that order

- then I click in the yellow frame

- click on the Buffer menu in the menu-bar

- click on *Messages*.

Effect is a bit strange, some complaints about mouse bindings in the
root frame, but no assertion.

So I guess I'm missing something important. Any ideas?