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: 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 Message-ID: <83mt52nc4a.fsf@gnu.org> References: <877h40vb8h.fsf@mail.jurta.org> <4EA4D31B.4050604@cs.ucla.edu> <4EA5E08D.8070903@cs.ucla.edu> <861qmvcglp.fsf@aarsen.me> <98e880a0-d076-cfd9-b39d-50c84fa8975a@gmail.com> <811d85e0-4032-68df-bc0c-1073ff5d1b96@cs.ucla.edu> <5a38c18d-263c-223b-7335-8395a10eb494@gmail.com> <83wn47o5zm.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19306"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 24 19:38:07 2023 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 1pVcxJ-0004lt-UK for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Feb 2023 19:38:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVcwj-0002pn-7N; Fri, 24 Feb 2023 13:37:29 -0500 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 1pVcwh-0002pf-SS for emacs-devel@gnu.org; Fri, 24 Feb 2023 13:37:28 -0500 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 1pVcwg-0002Ow-KH; Fri, 24 Feb 2023 13:37:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=oAJ9WvNh5k7It1/t1xwOgxdu39yBKr8NQN8BMQE/WWM=; b=R0Y3wHB6ADo5 fuJQ+z/S4ucU2CK+nx94kVBCS6CqWAMDgnclISjiFnyuGYGHs16Gyrpxy1i0tbvxGQVxvlIkUebRQ Ya640qfrLQIfkubxQMzjv7jJxJBplpTqlyAQfjkHh0bdXyZuBVUXmXAxHPFG/B1HYxFuSxooDg2Zb Knx2fyYqy2WwBgk7WHHIDFYHPY8+9zh15rMfuGlI+hdhGv3uHiCTlWPgSPzt37WtJqKIuHefZKVue R0egP675CT1tfDAylnBVLYZ2mAzSgCMR30MGZdMd+gusQrdKwy4DB2453xCSbmYiA2ke3dvNTRfP3 dN4xu/fk8m/jjCKYsDZ/NA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVcwg-0002PC-21; Fri, 24 Feb 2023 13:37:26 -0500 In-Reply-To: (message from Jim Porter on Fri, 24 Feb 2023 09:48:02 -0800) 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:303753 Archived-At: > Date: Fri, 24 Feb 2023 09:48:02 -0800 > Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org > From: Jim Porter > > On 2/23/2023 11:52 PM, Eli Zaretskii wrote: > >> Date: Thu, 23 Feb 2023 18:20:39 -0800 > >> From: Jim Porter > >> 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). */