From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#73752: 29.4; Ligatures are randomly rendered with extra spaces Date: Tue, 29 Oct 2024 16:29:48 +0530 Message-ID: <87o73318ql.fsf@gmail.com> References: <86zfn9ycis.fsf@gnu.org> <86o735als7.fsf@gnu.org> <87o73534dn.fsf@gmail.com> <86h68x8nuz.fsf@gnu.org> <86ed418niu.fsf@gnu.org> <87jzds3lay.fsf@gmail.com> <86iktc6zp5.fsf@gnu.org> <87wmhs19rh.fsf@gmail.com> <86frog6thm.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="8216"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, 73752@debbugs.gnu.org, xuan@xlk.me To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 29 12:01:23 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 1t5jyU-0001pG-2w for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Oct 2024 12:01:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5jyG-0002l5-PN; Tue, 29 Oct 2024 07:01:08 -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 1t5jyA-0002hw-FZ for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 07:01:05 -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 1t5jyA-0007l8-4K for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 07:01:02 -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:Date:References:In-Reply-To:From:To:Subject; bh=h3RRFasZSr5tFaE3OOfkrFk9tKUJ5hUeLXN7HHVsHoc=; b=QuDLhx9Org//cI1MBZ6gktNY3/+ipscA+6F5lSSoF4Am+J1kRCIXqATckrDX3nXHEjsI1Mo6ilaPoc0DPy2m1RmIN69vHXQkib8WjjWgeXUNMQLygqF+g17W/2OYz5trlcV+l+suXFAkEM8jWBDFHZQX30D4uc5XVIgMdndvvETQgky9tC3cWHn3Y2qKViuKLaBDMqXyqEoZOdbtRaWlrwhqtlauj1AkV4kOihR+jtoMzHav2xyNeaBkvYRxG9U40LujGxWJgtjojVTqpZ917lzsSPoi3wgPcSce6IIDNp4Kf7Fv71BsGechPylXoKncL+cXk5orLa22LA32pkB+yg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5jy9-0000Iy-Ql for bug-gnu-emacs@gnu.org; Tue, 29 Oct 2024 07:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Oct 2024 11:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73752 X-GNU-PR-Package: emacs Original-Received: via spool by 73752-submit@debbugs.gnu.org id=B73752.17301996591159 (code B ref 73752); Tue, 29 Oct 2024 11:01:01 +0000 Original-Received: (at 73752) by debbugs.gnu.org; 29 Oct 2024 11:00:59 +0000 Original-Received: from localhost ([127.0.0.1]:56196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5jy6-0000Id-RR for submit@debbugs.gnu.org; Tue, 29 Oct 2024 07:00:59 -0400 Original-Received: from mail-pf1-f195.google.com ([209.85.210.195]:43496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5jy4-0000IV-4D for 73752@debbugs.gnu.org; Tue, 29 Oct 2024 07:00:56 -0400 Original-Received: by mail-pf1-f195.google.com with SMTP id d2e1a72fcca58-718e9c8bd83so4487487b3a.1 for <73752@debbugs.gnu.org>; Tue, 29 Oct 2024 04:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730199595; x=1730804395; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:date:references :message-id:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h3RRFasZSr5tFaE3OOfkrFk9tKUJ5hUeLXN7HHVsHoc=; b=GtcxJKbpc9BGC1g2hDHWjXtLX8wl1UruyO+pu4pQ1MpzKynWOKhcD8cthy/Wnnu9hL CD7zh8S11T7ySx05jTNyRyBWUoJ8Y38iY2Rvt2U5MpjWMn3fRjXPDs6UJsOxGXiQ7tEi Op/k9hBOKE+KtRgMKO0cgRRr6MziAGkBvLvEYFrtlioLndxwYTUi0HWEhuOvHhRKXHD+ v3J4CkUOxOBHLyObj94mwurb9a5SE1GFm9/NaeZz3TXbrQXhyZ9LRjiHrN/fn5qRqAAS +D9izgemOlZr6n9NJfeFjR9cGblWkfw4vrgTGuX/jCkRpiatgPcaaZqQwt1JJsUpWxUo s4lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730199595; x=1730804395; h=content-transfer-encoding:mime-version:user-agent:date:references :message-id:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=h3RRFasZSr5tFaE3OOfkrFk9tKUJ5hUeLXN7HHVsHoc=; b=nxnLvKw38Vz110ztv0oqPnAI2eLbJnOk5B3YLw3+/eiPLAhK0JTAmqrHOovcQVIzR7 Z95ElcTtIabgAMaFlWNFFLDf3vfaQ7sgoiOSsCIlSzokM3UOEULdwMn/s0W9Xzj7qnJi lMb5XqzQwB+X+k80aOxNIKoFKsgIrUHjTFGSNTHx8/Vii590fxc8/zkTpRqyhAkg5IJX rsAVzsmUCZazUmfcsZsqIXI50US2f97ujuXDot+EDyWm5MaPI9/SdV08Sx7vbF4Gmj4u hDdXI8oqnpqxlBGDL6x5vbMZf9P84vY6i2cuskGUr24oEgBtAIJkOdlOCHJjWcrXcc2t rTSA== X-Forwarded-Encrypted: i=1; AJvYcCUAK0v6mvNp4V8XzJbfXgF97DrHwWmPYHVikVu6CjrT/bYjtm9v9EunWVY9ihIjNI3+qzoMrQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwPv9AfclYItbgNp31MvIKMZv4/8KCo8qhctKhrSaZQDZSG2lON DnYwJM6ODfaWHjuS9OQWD0Fe5kKthIZq/GJEbhj6aQeo/RUeJD5C X-Google-Smtp-Source: AGHT+IHVcN160e9L8Agm8a6UHf/KInsrAzbgdfz4kyQGrw0FoOwmQIm6YyW+EBbSW6w0NZu1U4pj2g== X-Received: by 2002:a05:6a21:1690:b0:1d9:761:8ad8 with SMTP id adf61e73a8af0-1d9e1fc3346mr2943773637.21.1730199595120; Tue, 29 Oct 2024 03:59:55 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72057a1ef95sm7318985b3a.157.2024.10.29.03.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 03:59:54 -0700 (PDT) In-Reply-To: <86frog6thm.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 28 Oct 2024 19:13:25 +0200") 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:294479 Archived-At: [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=85= =E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 28, 2024] E= li Zaretskii wrote: >> From: Visuwesh >> Cc: luangruo@yahoo.com, 73752@debbugs.gnu.org, xuan@xlk.me >> Date: Mon, 28 Oct 2024 21:48:26 +0530 >>=20 >> > You need to catch this situation in some reproducible recipe. Because >> > up front I don't understand how is this possible: we cache each >> > composition with its font object, which includes the font size (and >> > also slant, weight, etc.), so a different variant of the same font >> > ought to match only cache entries that use the exact same font. Or >> > maybe I don't understand well enough what >> > composition_gstring_put_cache does to compute the hash of a >> > glyph-string header (which is the hash key for a composition)? >>=20 >> Is this hash dependent on the font driver? > > No. Only the font used for the composed characters is recorded, not > the font backend which opened it. But fonts are managed by the font > backend, so maybe there's some leakage by that way. OK, thanks. I wonder if we could compare the value returned by font-info if something has gone wrong with the font object used to compute the hash for the glyph?=20=20 >> Also, do we clear the composition cache when all the GUI frames of an >> Emacs daemon are deleted? > > No, we don't, not directly. But we clear the face cache, and that > removes the data of the fonts referred by the face cache from the > composition cache. So it's quite possible the composition cache is > left empty when all the frames are deleted. Thanks that would explain it but then... >> The misalignment goes away when I close all >> the GUI frames of the daemon, and open a fresh new GUI frame. > > Next time this happens, try one of these two: > > M-: (clear-face-cache t) RET > M-: (clear-composition-cache) RET > > and see if any of them corrects the problematic display. neither of them helped in the past. I tried to if they help again but failed to reproduce the problem today. > Btw, how frequently do you use different frames,=20 Quite often, I would say. I usually have two frames but it can go upwards of 5 to 6 if I have a mouse attached to my laptop. > and how likely are you to have different definitions for the same > faces on different frames in the same Emacs session at the same time? I don't quite understand this question. Are you asking if I have any "frame-specific" face attributes i.e., non-nil FRAME argument in set-face-attribute? If so, no. >> > But how can this happen? Without a reproducible recipe, which can be >> > reproduced without waiting for too long, it is very hard to >> > investigate this. >>=20 >> I have no idea. This is not easy to reproduce and seems to be heavily >> dependent on the configuration. Although I use a Cairo build (with >> Lucid toolkit), the misalignment is not as severe as OP says and it >> takes a lot more time to reproduce as well. I could never come up with >> a reproducer that takes less time. > > The only way I see to investigate this is to wait for this to happen, > then attach GDB to Emacs and look at the problematic compositions in > the cache, comparing them to the corresponding compositions in a fresh > Emacs session. I can tell what to look for with GDB, if that helps. That would help. But given how hard it is to reproduce this issue on my end, I don't know when I can get back... > If we see that two compositions that should be identical differ by > their font objects, say, we'd at least have a lead and a starting > point for further debugging.