From: Eli Zaretskii Date: Sat, 24 Aug 2024 09:07:02 +0000 (+0300) Subject: Fix rare segfaults due to freed fontsets X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a893643d825ddbebe8613910b88463397debcbd4;p=emacs.git Fix rare segfaults due to freed fontsets * src/xfaces.c (recompute_basic_faces): Force complete recalculation of all the faces. (Bug#72692) (cherry picked from commit 4211d85eec0858583bd9d35f8de9cd6e358d6c72) --- diff --git a/src/xfaces.c b/src/xfaces.c index 684b6ccfac7..34897817ffd 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -736,6 +736,11 @@ recompute_basic_faces (struct frame *f) clear_face_cache (false); if (!realize_basic_faces (f)) emacs_abort (); + /* Force complete face recalculation next time we use the display + code, because realize_basic_faces could free the fontset used + by non-ASCII faces corresponding to ASCII faces of the basic + faces, and attempt to use that fontset might segfault. */ + f->face_change = true; } }