Subject: Re: bug#78937: Emacs crashes when trying to view fonts by family

From: "Paul Walker" <[email-masked]>
Date: Wed, 02 Jul 2025 15:43:03 +0100

Sure. I see there's still quite a few things marked "optimized out"; do you want me to rebuild with optimisation disabled/limited in some way?

(I did look for a "maintainer mode" flag to configure but couldn't see one.)

$ gdb ~/built/bin/emacs-31.0.50-git -ex "set args -Q"
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/pw921828/built/bin/emacs-31.0.50-git...
SIGINT is used by the debugger.
Are you sure you want to change it? (y or n) [answered Y; input not from terminal]
DISPLAY = localhost:10.0
TERM = xterm-256color
Breakpoint 1 at 0x4ebe5: file emacs.c, line 443.
Breakpoint 2 at 0x1436b0: file xterm.c, line 27072.
(gdb) run
Starting program: /home/pw921828/built/bin/emacs-31.0.50-git -Q
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee89c6c0 (LWP 196595)]
[New Thread 0x7fffee09b6c0 (LWP 196596)]
[New Thread 0x7fffed89a6c0 (LWP 196597)]

Thread 1 "emacs-31.0.50-g" hit Breakpoint 2, x_error_quitter (display=0x555555af8260, event=0x0) at xterm.c:27072
27072     if (event->error_code == BadName)
(gdb) bt
#0  x_error_quitter (display=0x555555af8260, event=0x0) at xterm.c:27072
#1  0x0000555555697806 in x_error_handler (display=0x555555af8260, event=0x7fffffffccb0) at xterm.c:27051
#2  0x00007ffff7b739eb in _XError () at /lib/x86_64-linux-gnu/libX11.so.6
#3  0x00007ffff7b70657 in  () at /lib/x86_64-linux-gnu/libX11.so.6
#4  0x00007ffff7b706f5 in  () at /lib/x86_64-linux-gnu/libX11.so.6
#5  0x00007ffff7b7184d in _XReply () at /lib/x86_64-linux-gnu/libX11.so.6
#6  0x00007ffff7b6ce8b in XSync () at /lib/x86_64-linux-gnu/libX11.so.6
#7  0x00007ffff7b6cf2b in  () at /lib/x86_64-linux-gnu/libX11.so.6
#8  0x00007ffff7b4fbd3 in XCreatePixmap () at /lib/x86_64-linux-gnu/libX11.so.6
#9  0x000055555582d40c in create_pixmap_for_menu (ws=0x55555858e9a0, mw=mw@entry=0x55555b16fdf0) at xlwmenu.c:1549
#10 0x000055555582f45b in XlwMenuRealize (w=0x55555b16fdf0, valueMask=<optimized out>, attributes=<optimized out>) at xlwmenu.c:2218
#11 0x00007ffff7cd89fd in  () at /lib/x86_64-linux-gnu/libXt.so.6
#12 0x00007ffff7cd8b5b in  () at /lib/x86_64-linux-gnu/libXt.so.6
#13 0x00007ffff7cd8df9 in XtRealizeWidget () at /lib/x86_64-linux-gnu/libXt.so.6
#14 0x00007ffff7ce0060 in _XtPopup () at /lib/x86_64-linux-gnu/libXt.so.6
#15 0x00007ffff7ce0160 in XtPopup () at /lib/x86_64-linux-gnu/libXt.so.6
#16 0x0000555555830b36 in pop_up_menu (event=0x7fffffffd4b0, mw=0x55555b16fdf0) at xlwmenu.c:2858
#17 Start (params=<optimized out>, num_params=<optimized out>, ev=0x7fffffffd4b0, w=0x55555b16fdf0) at xlwmenu.c:2507
#18 Start (w=0x55555b16fdf0, ev=0x7fffffffd4b0, params=<optimized out>, num_params=<optimized out>) at xlwmenu.c:2493
#19 0x00007ffff7ceff54 in XtCallActionProc () at /lib/x86_64-linux-gnu/libXt.so.6
#20 0x000055555582bee6 in xlw_popup_menu (widget=<optimized out>, event=<optimized out>) at lwlib-Xlw.c:244
#21 0x000055555582b52b in lw_popup_menu (widget=widget@entry=0x55555b16fc60, event=event@entry=0x7fffffffd4b0) at lwlib.c:975
#22 0x000055555561f3bc in create_and_show_popup_menu (for_click=false, y=<optimized out>, x=<optimized out>, first_wv=<optimized out>, f=0x555555b84e70) at xmenu.c:1856
#23 x_menu_show (f=<optimized out>, x=307, y=476, menuflags=0, title=<optimized out>, error_name=<optimized out>) at xmenu.c:2092
#24 0x000055555561cb9d in x_popup_menu_1 (position=<optimized out>, menu=XIL(0x7fffefa52bf3)) at menu.c:1415
#25 0x00007fffef4fe479 in F6d6f7573652d73656c6563742d666f6e74_mouse_select_font_0 () at /home/pw921828/built/bin/../lib/emacs/31.0.50/native-lisp/31.0.50-e37778b5/preloaded/mouse-15f283fa-e3fbaf7e.eln
#26 0x000055555575efd6 in Ffuncall (nargs=1, args=0x7fffffffd740) at eval.c:3151
#27 0x00007fffef57a97c in F6d656e752d7365742d666f6e74_menu_set_font_0 () at /home/pw921828/built/bin/../lib/emacs/31.0.50/native-lisp/31.0.50-e37778b5/preloaded/menu-bar-4f46ea94-8053e2c3.eln
#28 0x000055555575efd6 in Ffuncall (nargs=nargs@entry=1, args=args@entry=0x7fffffffd948) at eval.c:3151
#29 0x000055555575ac6e in Ffuncall_interactively (nargs=1, args=0x7fffffffd948) at callint.c:250
#30 0x000055555575efd6 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7fffffffd940) at eval.c:3151
#31 0x000055555575f4b8 in Fapply (nargs=nargs@entry=3, args=args@entry=0x7fffffffd940) at eval.c:2776
#32 0x000055555575c579 in Fcall_interactively (function=XIL(0x2aaa9a4d9db8), record_flag=XIL(0), keys=XIL(0x555555cb8255)) at callint.c:342
#33 0x00007fffef5eccdd in F636f6d6d616e642d65786563757465_command_execute_0 () at /home/pw921828/built/bin/../lib/emacs/31.0.50/native-lisp/31.0.50-e37778b5/preloaded/simple-fab5b0cf-9e866eaa.eln
#34 0x000055555575efd6 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7fffffffdaf0) at eval.c:3151
#35 0x00005555556e58b2 in command_loop_1 () at keyboard.c:1545
#36 0x000055555575d727 in internal_condition_case (bfun=bfun@entry=0x5555556e54d0 <command_loop_1>, handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x5555556d8ff0 <cmd_error>) at eval.c:1684
#37 0x00005555556d0f16 in command_loop_2 (handlers=handlers@entry=XIL(0x90)) at keyboard.c:1163
#38 0x000055555575d681 in internal_catch (tag=tag@entry=XIL(0x125d0), func=func@entry=0x5555556d0ef0 <command_loop_2>, arg=arg@entry=XIL(0x90)) at eval.c:1364
#39 0x00005555556d0eb1 in command_loop () at keyboard.c:1141
#40 0x00005555556d8ba3 in recursive_edit_1 () at keyboard.c:749
#41 0x00005555556d8f20 in Frecursive_edit () at keyboard.c:832
#42 0x00005555555ac03f in main (argc=2, argv=0x7fffffffdf98) at emacs.c:2582

Lisp Backtrace:
"mouse-select-font" (0xffffd748)
"menu-set-font" (0xffffd950)
"funcall-interactively" (0xffffd948)
"command-execute" (0xffffdaf8)
(gdb)