From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#42943: 28.0.50; Emacsclient crashes in ftcrfont_glyph_extents Date: Sat, 24 Oct 2020 15:35:43 +0200 Message-ID: References: <877dtuta6z.fsf@tcd.ie> <87y2m82ix4.fsf@gnus.org> <87zh4emnzm.fsf@gnus.org> <87lffxlxm5.fsf@tcd.ie> <83lffvhmne.fsf@gnu.org> <83imazhirc.fsf@gnu.org> 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="1937"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie, larsi@gnus.org, 42943@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 24 15:36:13 2020 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 1kWJiO-0000Na-FX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Oct 2020 15:36:12 +0200 Original-Received: from localhost ([::1]:36390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWJiN-00087T-Hf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Oct 2020 09:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWJiE-00087G-55 for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 09:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWJiD-00070T-S1 for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 09:36:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWJiD-0007Y1-LN for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2020 09:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Oct 2020 13:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42943 X-GNU-PR-Package: emacs Original-Received: via spool by 42943-submit@debbugs.gnu.org id=B42943.160354655428999 (code B ref 42943); Sat, 24 Oct 2020 13:36:01 +0000 Original-Received: (at 42943) by debbugs.gnu.org; 24 Oct 2020 13:35:54 +0000 Original-Received: from localhost ([127.0.0.1]:32966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWJi6-0007Xf-Gs for submit@debbugs.gnu.org; Sat, 24 Oct 2020 09:35:54 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:33568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWJi3-0007XL-JY for 42943@debbugs.gnu.org; Sat, 24 Oct 2020 09:35:52 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id b8so5983251wrn.0 for <42943@debbugs.gnu.org>; Sat, 24 Oct 2020 06:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=XV0s+HprOM+DQhAkBEA07g6g2j2LnDAaV3jGjPx8pCg=; b=njSORD33Zg03YTaFpS3i2GdXtAsX09esF58dH3b33ey4o3AOuGAoubgjy17u4nPPTh 4TtdG1fjQ9Ii2/b9yT2b/jYyO5eCraSfGOcs60JWaZh4FHLLlgNhPChGwZ13DPoW5Z+C iSdOECLSI16j0A61+mv0g5ATW9rAEw/YFo80YSrmHEkuute5fbdj9+RLJJfinT4e58IG 5RKHpRfzvQv5M+Dq+dlnDLM5oodrfONRdh9zBG1C0QwtlxSEOf5N0mBWZdXp9WoWYMJV 0wsOzIGljQtM0xeAp4kbAa8lzndJ3ZxCFuoMgFwCxuwP+8UzPaTsiNSWXYxA2pqTS66I JzuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=XV0s+HprOM+DQhAkBEA07g6g2j2LnDAaV3jGjPx8pCg=; b=mU/6LvwJdFbTbuDGjsKNse6Xz4uzvFMLtBZI9QXcJP0O1F14BCdw+rjspIXD2gS9R2 lL7dlBEoicAy6NafWsvgCfFO/wLTbm7kr0B945sTC/ZHB+Z3TFQ3meEmopCmA1HnOm8N 0ZHFnDIWAK4KOfdqK0eAzrbH/EvxoAqQ8ve2y5NSehzH/1RJk8OJTP1CAdvurh+iqyYH DH9aiDl2vJIxrOJde0KUtWogAj7qy7z6z1ecTxTnc2ryUxBo2BkxAX/6llw5aAXzzELF WUtW8RBNO7g5s/KEeWAx6WO/8K4ADLXHgPcSUCcLp6u6F6D53x0lBw09s5DXQ/09y1Q2 +oQA== X-Gm-Message-State: AOAM531SERrBxo1XJh/8nwSP1dAatk2LhyFgfXFBNjDeIgcXIw+3Er3m ADSQUn0MiGA29DxyzEdOVdQJ2fqpPJc= X-Google-Smtp-Source: ABdhPJww2hR7ANN6b/dlMfEV6g1/3OpYps0Ih++T1B7YySKy232MntFQzyM+et58cprBNA4GH0EC/A== X-Received: by 2002:adf:fa0e:: with SMTP id m14mr7315349wrr.134.1603546545414; Sat, 24 Oct 2020 06:35:45 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:8d6e:d31:eb45:4a86]) by smtp.gmail.com with ESMTPSA id u15sm10986375wrm.77.2020.10.24.06.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Oct 2020 06:35:44 -0700 (PDT) In-Reply-To: <83imazhirc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 24 Oct 2020 16:10:31 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:191424 Archived-At: >>>>> On Sat, 24 Oct 2020 16:10:31 +0300, Eli Zaretskii said: >> From: Robert Pluim >> Cc: contovob@tcd.ie, larsi@gnus.org, 42943@debbugs.gnu.org >> Date: Sat, 24 Oct 2020 14:14:53 +0200 >>=20 Eli> I'm guessing that we close the font, but there's still a face that Eli> references that font, and we try using that face for display. Can= you Eli> see if that is the case? The 'face' member of 'struct glyph_strin= g' Eli> should point to the face, and face->font should point to the font. >>=20 >> Yes, we=CA=BCre using the face that=CA=BCs cached in the glyph_strin= g: Eli> But glyph_strings are not kept between redisplay cycles, AFAIR, th= ey Eli> are recreated anew each time we need to redisplay something. This Eli> happens in the write_glyphs method that is called from update_wind= ow Eli> and update_frame, which eventually calls gui_write_glyphs, which c= alls Eli> draw_glyphs, which creates the glyph_strings in BUILD_GLYPH_STRING= S. Eli> So it's unclear to me how can a face be cached in a glyph_string. You=CA=BCre right, it=CA=BCs not cached in the glyph_string, it=CA=BCs cach= ed in the composition_gstring that=CA=BCs used to create the glyph_string (see my other message). Eli> And how do you see from the above that it's a pointer to the same Eli> 'struct font' that was used by the now-deleted first client frame? that=CA=BCs what the valgrind trace earlier said. Eli> We call font_clear_cache when a frame is deleted, so it's unclear = to Eli> me how come the font is still remembered somewhere. >>=20 >> font_clear_cache closes all the fonts and sets the frame's font cache >> to Qnil, I don=CA=BCt see it doing anything with faces. Eli> Faces are cached in the frame's face cache, see xfaces.c. When a Eli> frame is deleted, its face cache is freed, so its faces should als= o go Eli> away. A new frame starts with an empty face cache, and then faces= are Eli> added to that cache as they are "realized", starting from the "bas= ic Eli> faces" that are always needed, see realize_basic_faces. For a Eli> non-ASCII character, we produce a new face based on the default fa= ce, Eli> the first time we need to display a character that needs a font we Eli> don't already have; then that face is also added to the frame's fa= ce Eli> cache. Eli> And I lack some background here: what is/are the character(s) we t= ry Eli> displaying here, and how that display is triggered by creating a n= ew Eli> frame due to the second emacsclient invocation? >>=20 >> It=CA=BCs just emacsclient redisplaying *scratch*, I think. Eli> And *scratch* has an Arabic character? How did that happen? I tho= ught Eli> the recipe was only to turn on the Arabic input method. Is the Eli> offending character the IM indicator on the mode-line, per chance? Yes, I suspect so, since there are no Arabic characters in *scratch* Robert --=20