unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Greg A. Woods" <woods@robohack.ca>
Cc: 53924@debbugs.gnu.org
Subject: bug#53924: 26.1; fontification sometimes fails for some characters despite available glyphs
Date: Sun, 13 Feb 2022 13:53:27 +0200	[thread overview]
Message-ID: <83k0dzq8y0.fsf@gnu.org> (raw)
In-Reply-To: <m1nJ81T-0039Xw0@more.local> (woods@robohack.ca)

> Date: Sat, 12 Feb 2022 22:06:09 -0800
> From: "Greg A. Woods" <woods@robohack.ca>
> 
> First the ancient typo/bug:
> 
> fontset.el contains an errant definition for xlfd-regexp-spacing-subnum
> (with the value '8').  git-blame suggests this typo has lurked for 20
> years!
> 
> It should of course be '9':
> 
>     (defconst xlfd-regexp-spacing-subnum 9) ; fix a 20-year-old typo!

Thanks, fixed for the upcoming Emacs 28.  Fortunately, this defconst
were not used anywhere (which might explain how the typo survived for
so long).

> 	(font-families (cl-remove-duplicates
> 			(sort (font-family-list)
> 			      (lambda(x y) (string> (upcase x) (upcase y))))
> 			:test 'cl-equalp)))

This is not recommended as a way to get useful fonts.  My suggestion
is to use the following instead:

  (delete-dups
   (x-list-fonts "-*-*-medium-r-normal-*-*-*-*-*-*-iso10646-1"
		 'default (selected-frame)))

Indeed, using x-list-fonts indiscriminately could very well include
fonts that Emacs cannot use or even those which will crash Emacs.

> Finally a crash (working on reproducing it with GDB in the source tree,
> but my gdb is having trouble with the emacs .gdbinit):
> 
> Reading symbols from /usr/pkg/bin/emacs-26.1...
> [New process 12954]
> [New process 1873]
> Core was generated by `emacs'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x00007cdaa53676aa in _lwp_kill () from /usr/lib/libc.so.12
> [Current thread is 1 (process 12954)]
> (gdb) bt
> #0  0x00007cdaa53676aa in _lwp_kill () from /usr/lib/libc.so.12
> #1  0x00000000004dc6ac in terminate_due_to_signal (sig=sig@entry=11,
>     backtrace_limit=backtrace_limit@entry=40) at emacs.c:394
> #2  0x00000000004f2d13 in handle_fatal_signal (sig=sig@entry=11) at sysdep.c:1769
> #3  0x00000000004f2f53 in deliver_thread_signal (sig=sig@entry=11,
>     handler=0x4f2d05 <handle_fatal_signal>) at sysdep.c:1743
> #4  0x00000000004f2fa6 in deliver_fatal_thread_signal (sig=11) at sysdep.c:1781
> #5  handle_sigsegv (sig=11, siginfo=<optimized out>, arg=<optimized out>)
>     at sysdep.c:1866
> #6  <signal handler called>
> #7  0x00000000005ad68d in fontset_find_font (fontset=fontset@entry=364, c=c@entry=180,
>     face=face@entry=0x7cdaad2db4c0, charset_id=charset_id@entry=-1,
>     fallback=fallback@entry=false) at fontset.c:550
> #8  0x00000000005adfd3 in fontset_font (fontset=fontset@entry=364, c=c@entry=180,
>     face=face@entry=0x7cdaad2db4c0, id=-1) at fontset.c:760
> #9  0x00000000005ae365 in face_for_char (f=0x7cdaafbf2c30,
>     face=face@entry=0x7cdaad2db4c0, c=180, pos=<optimized out>, object=<optimized out>)
>     at fontset.c:990
> #10 0x000000000043e186 in FACE_FOR_CHAR (object=<optimized out>, pos=<optimized out>,
>     character=<optimized out>, face=0x7cdaad2db4c0, f=<optimized out>)
>     at dispextern.h:1818
> #11 get_next_display_element (it=it@entry=0x7f7fffe82f90) at xdisp.c:7303
> #12 0x000000000044790b in display_line (it=it@entry=0x7f7fffe82f90,
>     cursor_vpos=cursor_vpos@entry=0) at xdisp.c:21409

Is this with the above Lisp program that tries all the fonts collected
by font-family-list, or is this with some other recipe to reproduce
the crash?  Also, was that in "emacs -Q"?





  reply	other threads:[~2022-02-13 11:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 19:02 bug#53924: 26.1; fontification sometimes fails for some characters despite available glyphs Greg A. Woods
2022-02-10 20:21 ` Eli Zaretskii
2022-02-10 23:34   ` Greg A. Woods
2022-02-11  7:15     ` Eli Zaretskii
2022-02-11 21:56       ` Greg A. Woods
2022-02-13  6:06       ` Greg A. Woods
2022-02-13 11:53         ` Eli Zaretskii [this message]
2022-02-15  2:01           ` Greg A. Woods
2022-02-15 14:21             ` Eli Zaretskii
2022-02-15 22:04               ` Greg A. Woods
2022-02-16  2:32               ` Greg A. Woods
2022-02-16  3:36                 ` Eli Zaretskii
2022-02-16 21:55                   ` Greg A. Woods
2022-02-16 22:14                 ` Lars Ingebrigtsen
     [not found] ` <handler.53924.B.164452023325832.ack@debbugs.gnu.org>
2022-02-10 22:42   ` Greg A. Woods

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=83k0dzq8y0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=53924@debbugs.gnu.org \
    --cc=woods@robohack.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 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).