From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72692: Emacs 31.05 (40eecd594ac) get SIGSEGV on Linux (Linux 6.6.45 Kde Wayland) Date: Mon, 19 Aug 2024 16:34:59 +0000 Message-ID: <87cym4cvyo.fsf@protonmail.com> References: <8b1c8e1f-e0b9-4049-888c-3f723e0008a9@gmail.com> <87plq5g1fo.fsf@protonmail.com> <86v7zxy8ur.fsf@gnu.org> <87ttfhdo1e.fsf@protonmail.com> <86jzgcycla.fsf@gnu.org> <87frr0eiyy.fsf@protonmail.com> <868qwsy40c.fsf@gnu.org> <87y14sd07m.fsf@protonmail.com> <86zfp8wlrv.fsf@gnu.org> Reply-To: Pip Cet Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14951"; mail-complaints-to="usenet@ciao.gmane.io" Cc: execvy@gmail.com, 72692@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 19 18:35:41 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sg5M3-0003ft-Mz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Aug 2024 18:35:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sg5Lm-00064Z-24; Mon, 19 Aug 2024 12:35:22 -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 1sg5Lk-00064L-8f for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 12:35:20 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sg5Lj-0001nw-UE for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 12:35:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=gcEJ4Ez7h/pT1UoqVzuswmu6K3GTEGGSVcVDTjHE/oY=; b=T7Pt2Jl8/b0OcCNBGAjb4MpWbemEpp6pZbqRulPSQ2MrN+78SMG+kYT/uqW84JWDK+IeyYSjOOLiaWrZ50fJ3msiHSMaUn3rDZH63ehtWRbPoGKMm66k8gxrelXw401ePXvj2tGHp4R/Uzh2Ss0gE4mTuqOaqyYuxb2YG0Ik+L1A26dbbBbo5jM+Y/7RONFs9var3D4gxIbapvjx5Qu2NJ1kW8JTWibQ2u5Hfk00Hx46PWo+jdfBlnVhagHh3KRD4XWVQZ0JbPuKBjQgOkf1JcErQaSbCeFoeX+z4u/4o43VOdFyMJjqLbgiwnjKo7Q7KSkpN3rx3txP0PRR7UH7Sw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sg5MP-0001Rn-O3 for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 12:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Aug 2024 16:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72692 X-GNU-PR-Package: emacs Original-Received: via spool by 72692-submit@debbugs.gnu.org id=B72692.17240853535547 (code B ref 72692); Mon, 19 Aug 2024 16:36:01 +0000 Original-Received: (at 72692) by debbugs.gnu.org; 19 Aug 2024 16:35:53 +0000 Original-Received: from localhost ([127.0.0.1]:59001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg5MG-0001RP-Lr for submit@debbugs.gnu.org; Mon, 19 Aug 2024 12:35:53 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]:26915) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg5MF-0001RC-1t for 72692@debbugs.gnu.org; Mon, 19 Aug 2024 12:35:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1724085303; x=1724344503; bh=gcEJ4Ez7h/pT1UoqVzuswmu6K3GTEGGSVcVDTjHE/oY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=VuVkUv3mh2rk1BevfBJZ1z8ij4N5maLWHmngiB+L891PqPF10iIQ4L+XYQ7hiXjnc vZdZKzMXtnp/NGViXaxUJoTzpRfesEzjcHfczVzUMLGoHLyz97+SI/uIfAIgcYk+lB DuGe9gHewP2OQBodL/alNz0+QLOxRkMeVD6ttmXOQpHhpcSph7SqQhkIApCzbMLD8H GiX2ChlY20qnopmZFprZMvy/3ajC3X2WnBdg8HIi7uOmQL0y/bTXi7wD1zfzW7LeWH GLyG8wMZeCA+GMDKvQTutTo9H7lOzHpWX0H8QY7Y2yefbScNcOsfK/OmGxGGap1ufM eij9HCzTNLBJw== In-Reply-To: <86zfp8wlrv.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: baa7d74f02b0165f9b48b1043676fdab40843d73 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290403 Archived-At: "Eli Zaretskii" writes: >> Date: Mon, 19 Aug 2024 15:03:13 +0000 >> From: Pip Cet >> Cc: execvy@gmail.com, 72692@debbugs.gnu.org >> >> I'll check whether setting f->face_change =3D true in the relevant place= s >> is enough to avoid the bug... > > Thanks, but I'd also like to see the callers which call > free_realized_face in a way that causes the latter to call > free_face_fontset. That's why I asked for backtraces from those > calls, but I don't think you sent such backtraces. What you sent was Just for the record, you asked: > So can you show a backtrace from the call to free_realized_faces > (supposedly called by realize_basic_faces?) which causes these > printfs: > > fontset 103 used for face 0x117cca0 > > fontset 103 used for face 0x2a7a3c0 > > fontset 103 used for face 0x117cca0 > > fontset 103 used for face 0x2a62860 ... which I misunderstood. Sorry. Is this what you want? Thread 1 "emacs" hit Breakpoint 3, free_realized_face (f=3D0x11d1cc8, face= =3D0x11e22b0) at xfaces.c:4612 4612=09=09=09=09 fprintf (stderr, "Freeing fontset %d that's still in use = by %p (ASCII face %p=3D=3D%p)!\n", face->fontset, (gdb) p face->fontset $1 =3D 83 (gdb) bt #0 free_realized_face (f=3D0x11d1cc8, face=3D0x11e22b0) at xfaces.c:4612 #1 0x000000000055fe5d in realize_face (cache=3D0x12731e0, attrs=3D0x7fffff= ffb5f0, former_face_id=3D0) at xfaces.c:6117 #2 0x000000000055faf7 in realize_default_face (f=3D0x11d1cc8) at xfaces.c:= 6030 #3 0x000000000055f023 in realize_basic_faces (f=3D0x11d1cc8) at xfaces.c:5= 882 #4 0x000000000055084f in recompute_basic_faces (f=3D0x11d1cc8) at xfaces.c= :737 #5 0x0000000000445160 in gui_set_alpha_background (f=3D0x11d1cc8, arg=3DXI= L(0x7ffff33a80c7), oldval=3DXIL(0x7ffff33a80c7)) at frame.c:5237 #6 0x00000000005a511e in x_set_alpha_background (f=3D0x11d1cc8, arg=3DXIL(= 0x7ffff33a80c7), oldval=3DXIL(0x7ffff33a80c7)) at xfns.c:742 #7 0x0000000000442194 in gui_set_frame_parameters_1 (f=3D0x11d1cc8, alist= =3DXIL(0), default_parameter=3Dfalse) at frame.c:4400 #8 0x0000000000442d6f in gui_set_frame_parameters (f=3D0x11d1cc8, alist=3D= XIL(0x7ffff33a3223)) at frame.c:4560 #9 0x000000000044042b in Fmodify_frame_parameters (frame=3DXIL(0), alist= =3DXIL(0x7ffff33a3223)) at frame.c:3549 #10 0x00000000006c043c in funcall_subr (subr=3D0xe8d920 , numargs=3D2, args=3D0x7fffe41ff2f8) at eval.c:3140 #11 0x000000000071b3ab in exec_byte_code (fun=3DXIL(0x7ffff249ab35), args_t= emplate=3D771, nargs=3D3, args=3D0x7fffffffc038) at bytecode.c:813 #12 0x00000000006c0a6c in funcall_lambda (fun=3DXIL(0x7ffff249ab35), nargs= =3D3, arg_vector=3D0x7fffffffc020) at eval.c:3229 #13 0x00000000006c0903 in apply_lambda (fun=3DXIL(0x7ffff249ab35), args=3DX= IL(0x7ffff336a2d3), count=3D...) at eval.c:3192 #14 0x00000000006bee34 in eval_sub (form=3DXIL(0x7ffff336a2c3)) at eval.c:2= 622 #15 0x00000000006b98f3 in Fprogn (body=3DXIL(0x7ffff336a353)) at eval.c:430 #16 0x00000000006b9923 in prog_ignore (body=3DXIL(0x7ffff336a2b3)) at eval.= c:441 #17 0x00000000006bb4ee in Fwhile (args=3DXIL(0x7ffff336a1f3)) at eval.c:112= 1 #18 0x00000000006be8bb in eval_sub (form=3DXIL(0x7ffff336a1e3)) at eval.c:2= 526 #19 0x00000000006fff09 in readevalloop_eager_expand_eval (val=3DXIL(0x7ffff= 336a1e3), macroexpand=3DXIL(0xb370)) at lread.c:2355 #20 0x0000000000700773 in readevalloop (readcharfun=3DXIL(0x143d9a5), infile0=3D0x0, sourcename=3DXIL(0x127a2f= 4), printflag=3Dfalse, unibyte=3DXIL(0), readfun=3DXIL(0), start=3DXIL(0), = end=3DXIL(0)) at lread.c:2537 #21 0x0000000000700ac2 in Feval_buffer (buffer=3DXIL(0x143d9a5), printflag= =3DXIL(0), filename=3DXIL(0x127a2f4), unibyte=3DXIL(0), do_allow_print=3DXI= L(0x30)) at lread.c:2612 #22 0x00000000006c04f3 in funcall_subr (subr=3D0xe9f0e0 , num= args=3D5, args=3D0x7fffe41ff290) at eval.c:3146 #23 0x000000000071b3ab in exec_byte_code (fun=3DXIL(0x7ffff25bab55), args_t= emplate=3D257, nargs=3D1, args=3D0x7fffe41ff298) at bytecode.c:813 #24 0x00000000006c0a6c in funcall_lambda (fun=3DXIL(0x7ffff280f18d), nargs= =3D4, arg_vector=3D0x7fffffffcdb8) at eval.c:3229 #25 0x00000000006bfe66 in funcall_general (fun=3DXIL(0x7ffff280f18d), numar= gs=3D4, args=3D0x7fffffffcdb8) at eval.c:3021 #26 0x00000000006c0115 in Ffuncall (nargs=3D5, args=3D0x7fffffffcdb0) at ev= al.c:3070 #27 0x00000000006fe3fa in Fload (file=3DXIL(0x127a614), noerror=3DXIL(0), n= omessage=3DXIL(0x30), nosuffix=3DXIL(0), must_suffix=3DXIL(0)) at lread.c:1= 615 #28 0x00000000006c04f3 in funcall_subr (subr=3D0xe9f060 , numargs=3D= 3, args=3D0x7fffe41ff1b0) at eval.c:3146 #29 0x000000000071b3ab in exec_byte_code (fun=3DXIL(0x7ffff2a036c5), args_t= emplate=3D769, nargs=3D3, args=3D0x7fffe41ff4a0) at bytecode.c:813 #30 0x00000000006c0a6c in funcall_lambda (fun=3DXIL(0x7ffff2a529cd), nargs= =3D0, arg_vector=3D0x7fffffffd590) at eval.c:3229 #31 0x00000000006c0903 in apply_lambda (fun=3DXIL(0x7ffff2a529cd), args=3DX= IL(0), count=3D...) at eval.c:3192 #32 0x00000000006bee34 in eval_sub (form=3DXIL(0x7ffff2c113fb)) at eval.c:2= 622 #33 0x00000000006be367 in Feval (form=3DXIL(0x7ffff2c113fb), lexical=3DXIL(= 0x30)) at eval.c:2439 #34 0x00000000005e5392 in top_level_2 () at keyboard.c:1179 #35 0x00000000006bc3d6 in internal_condition_case (bfun=3D0x5e532b , handlers=3DXIL(0x90), hfun=3D0x5e4c03 ) at eval.c:1598 #36 0x00000000005e53ed in top_level_1 (ignore=3DXIL(0)) at keyboard.c:1191 #37 0x00000000006bb89a in internal_catch (tag=3DXIL(0x12360), func=3D0x5e53= ab , arg=3DXIL(0)) at eval.c:1277 #38 0x00000000005e5275 in command_loop () at keyboard.c:1140 #39 0x00000000005e46dc in recursive_edit_1 () at keyboard.c:749 #40 0x00000000005e48ef in Frecursive_edit () at keyboard.c:832 #41 0x00000000005e05cf in main (argc=3D4, argv=3D0x7fffffffdb98) at emacs.c= :2624 Lisp Backtrace: "modify-frame-parameters" (0xe41ff2f8) "set-frame-parameter" (0xffffc020) "while" (0xffffc300) "eval-buffer" (0xe41ff290) "load-with-code-conversion" (0xffffcdb8) "load" (0xe41ff1b0) "command-line-1" (0xe41ff0b8) "command-line" (0xe41ff040) "normal-top-level" (0xffffd590) (gdb) p face->ascii_face $2 =3D (struct face *) 0x11e22b0 > a backtrace from realize_gui_face and another one from the abort. The > former is too early, the latter too late. I'd like to see the code > which causes the fontset to be freed in a way that avoids re-realizing > all of the faces that use the fontset. That's where the problem is, > at least at my current level of understanding this issue. Indeed, I can report that the bug doesn't seem to occur after this simple change: diff --git a/src/xfaces.c b/src/xfaces.c index 684b6ccfac7..a4ac9c0787a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -736,6 +736,7 @@ recompute_basic_faces (struct frame *f) clear_face_cache (false); if (!realize_basic_faces (f)) emacs_abort (); + f->face_change =3D true; } } =20 So something like that (though moving the call down into realize_basic_faces or even further would be good) would probably work for the OP, and emacs-30? Pip