From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS: face-cache Date: Sun, 28 Apr 2024 09:09:17 +0300 Message-ID: <86a5leuigi.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24214"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 28 08:10:17 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s0xjs-00064h-O5 for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Apr 2024 08:10:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0xjC-0003kU-Fs; Sun, 28 Apr 2024 02:09:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0xj0-0003je-NZ for emacs-devel@gnu.org; Sun, 28 Apr 2024 02:09:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0xj0-0004oy-Ev; Sun, 28 Apr 2024 02:09:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ODEkLaKsPOyzRUgcmG5iPCaR4oqpu6MXBYc76BMqQ9o=; b=sWhJS8//0sMQVM+ssbDp yIral9nLqvWQhxLDBk+zkq97vrj4vhEc5wwMhgInldTDeAsjuKFLe62kFJO34eBcj+YGPJknuPv5U KjN9Vh6zGf16Pj/KQkwedtHRysVhzHuo/ZwS/Y9f6ove73VuQobiHpSBwAl1rz6pU4djOieXBvUqj /kqq01Cu9jTrx3y+esmH4HPF4X2KvCmyJOwIDGIwLMINOK9YayAhOJuquz5FtTgd9YjV6Bd3hQois xYT/+bWRmvOp6kFJPxYNHpTcycqpKvtcPZXCWCPw2QPjW+0Uk4mUg/IefQLcEYHZGW0s4b6uCJQv7 coWkdnMxpDti9g==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Sun, 28 Apr 2024 07:06:45 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:318229 Archived-At: > From: Gerd Möllmann > Cc: Helmut Eller , emacs-devel missing value > > Date: Sun, 28 Apr 2024 07:06:45 +0200 > > Did that now, but it's still crashing. My impression, which might of > course be completely wrong, is that we are losing faces somehow, i.e. > something is wrong with the cache. Could be. But there's also FRAME_FONTSET, e.g. for w32: #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset) Are we handling it correctly vis-a-vis GC? fix_frame doesn't do anything with it, AFAICT. Should it? When Emacs is looking for a font, it consults the fontset. In one case, I got a crash with Helmut's recipe, like this: Thread 1 received signal SIGSEGV, Segmentation fault. parse_str_as_multibyte ( str=0xc045000 , str@entry=0xaa1a880 "", len=len@entry=211856320, nchars=nchars@entry=0x6df89cc, nbytes=nbytes@entry=0x6df89c8) at character.c:555 555 int n = multibyte_length (str, NULL, false, false); (gdb) bt #0 parse_str_as_multibyte ( str=0xc045000 , str@entry=0xaa1a880 "", len=len@entry=211856320, nchars=nchars@entry=0x6df89cc, nbytes=nbytes@entry=0x6df89c8) at character.c:555 #1 0x003141a1 in font_intern_prop (str=0xaa1a880 "", len=211856320, force_symbol=force_symbol@entry=true) at font.c:326 #2 0x0031d387 in font_find_for_lface (f=f@entry=0xaa1c478, attrs=attrs@entry=0x1dc263b0, spec=0xcb8ebed, c=c@entry=21457) at lisp.h:751 #3 0x003e7c01 in fontset_find_font (fontset=0xb41812d, c=c@entry=21457, face=face@entry=0x1dc263b0, charset_id=charset_id@entry=42, fallback=fallback@entry=false) at lisp.h:751 #4 0x003e8475 in fontset_font (fontset=fontset@entry=0xb3fc765, c=c@entry=21457, face=face@entry=0x1dc263b0, id=42) at lisp.h:751 #5 0x003e9232 in face_for_char (f=0xaa1c478, face=face@entry=0x1dc263b0, c=21457, pos=pos@entry=788, object=0x0) at fontset.c:1031 #6 0x001a79d4 in FACE_FOR_CHAR (object=, pos=788, character=, face=0x1dc263b0, f=) at dispextern.h:1959 #7 get_next_display_element (it=it@entry=0x6dfa6b0) at xdisp.c:8499 #8 0x001b0d96 in display_line (it=it@entry=0x6dfa6b0, cursor_vpos=cursor_vpos@entry=1) at xdisp.c:25298 #9 0x001b7611 in try_window (window=, window@entry=0xc8007b5, pos=..., flags=, flags@entry=1) at xdisp.c:21139 #10 0x001d9947 in redisplay_window (window=window@entry=0xc8007b5, just_this_one_p=just_this_one_p@entry=false) at xdisp.c:20533 #11 0x001dcb44 in redisplay_window_0 (window=0xc8007b5) at xdisp.c:18018 #12 0x002f29db in internal_condition_case_1 ( bfun=bfun@entry=0x1dcb0f , arg=arg@entry=0xc8007b5, handlers=0x1a3a10c3, hfun=hfun@entry=0x186297 ) at eval.c:1568 #13 0x00181eed in redisplay_windows (window=0xc8007b5) at xdisp.c:17987 #14 0x001c0f5f in redisplay_internal () at xdisp.c:17387 #15 0x001c24b3 in redisplay () at xdisp.c:16565 #16 0x002661c8 in read_char (commandflag=, commandflag@entry=1, map=, map@entry=0xa820f7b, prev_event=, used_mouse_menu=, used_mouse_menu@entry=0x6dff7fb, end_time=, end_time@entry=0x0) at keyboard.c:2678 #17 0x002697fd in read_key_sequence (keybuf=keybuf@entry=0x6dff8d8, prompt=prompt@entry=0x0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=, can_return_switch_frame@entry=true, fix_current_buffer=, fix_current_buffer@entry=true, prevent_redisplay=, prevent_redisplay@entry=false, disable_text_conversion_p=false) at keyboard.c:10727 #18 0x0026b38b in command_loop_1 () at lisp.h:1179 #19 0x002f293d in internal_condition_case ( bfun=bfun@entry=0x26b1d0 , handlers=handlers@entry=0x48, hfun=hfun@entry=0x25e516 ) at eval.c:1544 #20 0x0025482b in command_loop_2 (handlers=0x48) at keyboard.c:1168 #21 0x002f2857 in internal_catch (tag=tag@entry=0x87a8, func=func@entry=0x25480b , arg=arg@entry=0x48) at eval.c:1224 #22 0x002547cb in command_loop () at lisp.h:1179 #23 0x0025e0d1 in recursive_edit_1 () at keyboard.c:754 #24 0x0025e3c1 in Frecursive_edit () at keyboard.c:837 #25 0x00497d5f in main (argc=, argv=) at emacs.c:2626 Note that the string length in parse_str_as_multibyte is completely bogus, which led me look into what we do with fontsets, because frame #4 calls fontset_font. The default fontset, Vdefault_fontset, is staticpro'd, but that's all I found.