all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: execvy@gmail.com, 72692@debbugs.gnu.org
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	[thread overview]
Message-ID: <87cym4cvyo.fsf@protonmail.com> (raw)
In-Reply-To: <86zfp8wlrv.fsf@gnu.org>

"Eli Zaretskii" <eliz@gnu.org> writes:

>> Date: Mon, 19 Aug 2024 15:03:13 +0000
>> From: Pip Cet <pipcet@protonmail.com>
>> Cc: execvy@gmail.com, 72692@debbugs.gnu.org
>>
>> I'll check whether setting f->face_change = true in the relevant places
>> 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=0x11d1cc8, face=0x11e22b0) at xfaces.c:4612
4612				  fprintf (stderr, "Freeing fontset %d that's still in use by %p (ASCII face %p==%p)!\n", face->fontset,
(gdb) p face->fontset
$1 = 83
(gdb) bt
#0  free_realized_face (f=0x11d1cc8, face=0x11e22b0) at xfaces.c:4612
#1  0x000000000055fe5d in realize_face (cache=0x12731e0, attrs=0x7fffffffb5f0, former_face_id=0) at xfaces.c:6117
#2  0x000000000055faf7 in realize_default_face (f=0x11d1cc8) at xfaces.c:6030
#3  0x000000000055f023 in realize_basic_faces (f=0x11d1cc8) at xfaces.c:5882
#4  0x000000000055084f in recompute_basic_faces (f=0x11d1cc8) at xfaces.c:737
#5  0x0000000000445160 in gui_set_alpha_background (f=0x11d1cc8, arg=XIL(0x7ffff33a80c7), oldval=XIL(0x7ffff33a80c7)) at frame.c:5237
#6  0x00000000005a511e in x_set_alpha_background (f=0x11d1cc8, arg=XIL(0x7ffff33a80c7), oldval=XIL(0x7ffff33a80c7)) at xfns.c:742
#7  0x0000000000442194 in gui_set_frame_parameters_1 (f=0x11d1cc8, alist=XIL(0), default_parameter=false) at frame.c:4400
#8  0x0000000000442d6f in gui_set_frame_parameters (f=0x11d1cc8, alist=XIL(0x7ffff33a3223)) at frame.c:4560
#9  0x000000000044042b in Fmodify_frame_parameters (frame=XIL(0), alist=XIL(0x7ffff33a3223)) at frame.c:3549
#10 0x00000000006c043c in funcall_subr (subr=0xe8d920 <Smodify_frame_parameters>, numargs=2, args=0x7fffe41ff2f8) at eval.c:3140
#11 0x000000000071b3ab in exec_byte_code (fun=XIL(0x7ffff249ab35), args_template=771, nargs=3, args=0x7fffffffc038) at bytecode.c:813
#12 0x00000000006c0a6c in funcall_lambda (fun=XIL(0x7ffff249ab35), nargs=3, arg_vector=0x7fffffffc020) at eval.c:3229
#13 0x00000000006c0903 in apply_lambda (fun=XIL(0x7ffff249ab35), args=XIL(0x7ffff336a2d3), count=...) at eval.c:3192
#14 0x00000000006bee34 in eval_sub (form=XIL(0x7ffff336a2c3)) at eval.c:2622
#15 0x00000000006b98f3 in Fprogn (body=XIL(0x7ffff336a353)) at eval.c:430
#16 0x00000000006b9923 in prog_ignore (body=XIL(0x7ffff336a2b3)) at eval.c:441
#17 0x00000000006bb4ee in Fwhile (args=XIL(0x7ffff336a1f3)) at eval.c:1121
#18 0x00000000006be8bb in eval_sub (form=XIL(0x7ffff336a1e3)) at eval.c:2526
#19 0x00000000006fff09 in readevalloop_eager_expand_eval (val=XIL(0x7ffff336a1e3), macroexpand=XIL(0xb370)) at lread.c:2355
#20 0x0000000000700773 in readevalloop
    (readcharfun=XIL(0x143d9a5), infile0=0x0, sourcename=XIL(0x127a2f4), printflag=false, unibyte=XIL(0), readfun=XIL(0), start=XIL(0), end=XIL(0))
    at lread.c:2537
#21 0x0000000000700ac2 in Feval_buffer (buffer=XIL(0x143d9a5), printflag=XIL(0), filename=XIL(0x127a2f4), unibyte=XIL(0), do_allow_print=XIL(0x30))
    at lread.c:2612
#22 0x00000000006c04f3 in funcall_subr (subr=0xe9f0e0 <Seval_buffer>, numargs=5, args=0x7fffe41ff290) at eval.c:3146
#23 0x000000000071b3ab in exec_byte_code (fun=XIL(0x7ffff25bab55), args_template=257, nargs=1, args=0x7fffe41ff298) at bytecode.c:813
#24 0x00000000006c0a6c in funcall_lambda (fun=XIL(0x7ffff280f18d), nargs=4, arg_vector=0x7fffffffcdb8) at eval.c:3229
#25 0x00000000006bfe66 in funcall_general (fun=XIL(0x7ffff280f18d), numargs=4, args=0x7fffffffcdb8) at eval.c:3021
#26 0x00000000006c0115 in Ffuncall (nargs=5, args=0x7fffffffcdb0) at eval.c:3070
#27 0x00000000006fe3fa in Fload (file=XIL(0x127a614), noerror=XIL(0), nomessage=XIL(0x30), nosuffix=XIL(0), must_suffix=XIL(0)) at lread.c:1615
#28 0x00000000006c04f3 in funcall_subr (subr=0xe9f060 <Sload>, numargs=3, args=0x7fffe41ff1b0) at eval.c:3146
#29 0x000000000071b3ab in exec_byte_code (fun=XIL(0x7ffff2a036c5), args_template=769, nargs=3, args=0x7fffe41ff4a0) at bytecode.c:813
#30 0x00000000006c0a6c in funcall_lambda (fun=XIL(0x7ffff2a529cd), nargs=0, arg_vector=0x7fffffffd590) at eval.c:3229
#31 0x00000000006c0903 in apply_lambda (fun=XIL(0x7ffff2a529cd), args=XIL(0), count=...) at eval.c:3192
#32 0x00000000006bee34 in eval_sub (form=XIL(0x7ffff2c113fb)) at eval.c:2622
#33 0x00000000006be367 in Feval (form=XIL(0x7ffff2c113fb), lexical=XIL(0x30)) at eval.c:2439
#34 0x00000000005e5392 in top_level_2 () at keyboard.c:1179
#35 0x00000000006bc3d6 in internal_condition_case (bfun=0x5e532b <top_level_2>, handlers=XIL(0x90), hfun=0x5e4c03 <cmd_error>) at eval.c:1598
#36 0x00000000005e53ed in top_level_1 (ignore=XIL(0)) at keyboard.c:1191
#37 0x00000000006bb89a in internal_catch (tag=XIL(0x12360), func=0x5e53ab <top_level_1>, arg=XIL(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=4, argv=0x7fffffffdb98) 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 = (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 = true;
     }
 }
 

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






  reply	other threads:[~2024-08-19 16:34 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-18  8:29 bug#72692: Emacs 31.05 (40eecd594ac) get SIGSEGV on Linux (Linux 6.6.45 Kde Wayland) Eval EXEC
2024-08-18  8:58 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18  9:08   ` Eval EXEC
2024-08-18  9:23     ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18  9:24       ` execvy
2024-08-18  9:34         ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18  9:36           ` execvy
2024-08-18 12:43             ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 12:53               ` execvy
2024-08-18 13:35               ` Eli Zaretskii
2024-08-18 13:44                 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 14:12                   ` Eli Zaretskii
2024-08-18 14:59                     ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 15:38                       ` Eli Zaretskii
2024-08-18 16:08                         ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 17:55                           ` Eli Zaretskii
2024-08-18 18:11                             ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 18:52                               ` Eli Zaretskii
2024-08-19  6:17                                 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 17:56                           ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 18:38                             ` Eli Zaretskii
2024-08-19  6:28                               ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-19 11:30                                 ` Eli Zaretskii
2024-08-19 13:32                                   ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-19 14:35                                     ` Eli Zaretskii
2024-08-19 15:03                                       ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-19 15:54                                         ` Eli Zaretskii
2024-08-19 16:34                                           ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-08-19 16:49                                             ` Eli Zaretskii
2024-08-24  9:09                                               ` Eli Zaretskii
2024-08-24 10:04                                                 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-24 10:13                                                   ` Eli Zaretskii
2024-08-25 17:58                                                     ` Juri Linkov
2024-08-25 18:49                                                       ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-27 16:31                                                         ` Juri Linkov
2024-08-28 11:50                                                           ` Eli Zaretskii
2024-08-28 16:21                                                             ` Juri Linkov
2024-08-28 17:53                                                               ` Eli Zaretskii
2024-08-28 18:35                                                                 ` Juri Linkov
2024-08-28 18:57                                                                   ` Eli Zaretskii
2024-08-28 19:02                                                                     ` Juri Linkov
2024-08-29  4:36                                                                       ` Eli Zaretskii
2024-08-29 10:06                                                                       ` Eli Zaretskii
2024-08-29 12:06                                                                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-29 12:26                                                                           ` Eli Zaretskii
2024-09-07  7:52                                                                             ` Eli Zaretskii
2024-09-08  0:42                                                                               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-28 17:56                                                               ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-25 18:57                                                       ` Eli Zaretskii
2024-08-26  5:52                                                         ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-26 12:39                                                           ` Eli Zaretskii
2024-08-26 19:04                                                             ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-26 19:20                                                               ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-27 11:47                                                                 ` Eli Zaretskii
2024-08-27 19:26                                                                   ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-28 11:48                                                                     ` Eli Zaretskii
2024-08-28 11:58                                                                       ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-27 11:44                                                               ` Eli Zaretskii
2024-08-27 19:23                                                                 ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-28 11:41                                                                   ` Eli Zaretskii
2024-08-28 12:07                                                                     ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-28 12:51                                                                       ` Eli Zaretskii
2024-08-18 19:24                       ` Eli Zaretskii
2024-08-19  6:07                         ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-19 14:17                           ` Eli Zaretskii
2024-08-19 14:44                             ` Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cym4cvyo.fsf@protonmail.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=72692@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=execvy@gmail.com \
    --cc=pipcet@protonmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.