emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: server.el test failures (was: Re: bug#9800: Incomplete truncated fil


From: Eli Zaretskii
Subject: Re: server.el test failures (was: Re: bug#9800: Incomplete truncated file buffers from the /proc filesystem)
Date: Fri, 24 Feb 2023 20:37:25 +0200

> Date: Fri, 24 Feb 2023 09:48:02 -0800
> Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> 
> On 2/23/2023 11:52 PM, Eli Zaretskii wrote:
> >> Date: Thu, 23 Feb 2023 18:20:39 -0800
> >> From: Jim Porter <jporterbugs@gmail.com>
> >> Cc: emacs-devel@gnu.org
> >>
> >> The segfault is in FACE_FROM_ID_OR_NULL, called from
> >> Finternal_merge_in_global_face. It happens because the face_cache is
> >> null during these tests (since Emacs is noninteractive).
> >>
> >> The attached patch fixes the issue for me, though I'm not totally sure
> >> it's the *right* fix. Any thoughts? (I'm also not 100% sure this is the
> >> same issue you're seeing...)
> > 
> > Please show the C backtrace from the crash, and include the Lisp
> > backtrace (the "xbacktrace" command in src/.gdbinit).
> 
> Ok, I ran Emacs (master branch) under GDB with the following arguments:
> 
>    -Q -L ":../test" -l ert -l lisp/server-tests.el --batch --eval 
> '(ert-run-tests-batch-and-exit (quote (not (or (tag :unstable) (tag 
> :nativecomp)))))'
> 
> Attached is the backtrace from 'xbacktrace'.
> 
> I think this only occurs when starting the Emacs server in a batch-mode 
> Emacs process and then starting a client via "emacsclient -c". I see the 
> segfault when running any of the tests in test/lisp/server-tests.el that 
> create a frame (e.g. 'server-tests/server-start/stop-prompt-with-client').
> 
> This also only seems to occur if the first face that 
> 'face-set-after-frame-default' passes to 'internal-merge-in-global-face' 
> is the default face.

Thanks.  Does the patch below give good results?

diff --git a/src/xfaces.c b/src/xfaces.c
index 62d7823..37b7039 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4186,7 +4186,9 @@ DEFUN ("internal-merge-in-global-face", 
Finternal_merge_in_global_face,
   if (EQ (face, Qdefault))
     {
       struct face_cache *c = FRAME_FACE_CACHE (f);
-      struct face *newface, *oldface = FACE_FROM_ID_OR_NULL (f, 
DEFAULT_FACE_ID);
+      struct face *newface;
+      struct face *oldface =
+       c ? FACE_FROM_ID_OR_NULL (f, DEFAULT_FACE_ID) : NULL;
       Lisp_Object attrs[LFACE_VECTOR_SIZE];
 
       /* This can be NULL (e.g., in batch mode).  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]