From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Will Bush Newsgroups: gmane.emacs.bugs Subject: bug#40733: 28.0.50; Emacs locks up on paste (yank) of unicode characters Date: Mon, 1 Jun 2020 06:19:02 -0500 Message-ID: References: <87mu756aen.fsf@tcd.ie> <83v9ln7jy4.fsf@gnu.org> <83d07qzdv7.fsf@gnu.org> <834kt2z7n1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000febb7405a703f644" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="51664"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Basil L. Contovounesios" , Robert Pluim , 40733@debbugs.gnu.org, James Cloos To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 01 13:20: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 1jfiUH-000DKJ-2H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 13:20:13 +0200 Original-Received: from localhost ([::1]:40122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfiUG-0001TR-4f for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jun 2020 07:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfiU7-0001TJ-0G for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 07:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfiU6-0002bE-Ms for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 07:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfiU6-0007c0-IX for bug-gnu-emacs@gnu.org; Mon, 01 Jun 2020 07:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Will Bush Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jun 2020 11:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40733 X-GNU-PR-Package: emacs Original-Received: via spool by 40733-submit@debbugs.gnu.org id=B40733.159101036229210 (code B ref 40733); Mon, 01 Jun 2020 11:20:02 +0000 Original-Received: (at 40733) by debbugs.gnu.org; 1 Jun 2020 11:19:22 +0000 Original-Received: from localhost ([127.0.0.1]:34684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfiTS-0007b3-0A for submit@debbugs.gnu.org; Mon, 01 Jun 2020 07:19:22 -0400 Original-Received: from mail-lj1-f181.google.com ([209.85.208.181]:44279) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfiTQ-0007aq-B2 for 40733@debbugs.gnu.org; Mon, 01 Jun 2020 07:19:20 -0400 Original-Received: by mail-lj1-f181.google.com with SMTP id c17so1875757lji.11 for <40733@debbugs.gnu.org>; Mon, 01 Jun 2020 04:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ozwswJIH6wVHPaVvaNmhGc9RZ6D8RGwGKApK7N8HP9U=; b=p2iH8RKp0ZRmE0hPCbhLxYkDWCjRizGQ062XvlnFH+sSlrxO4i8szfsEsAd0LUAR+0 yFkJQMAmuObUoFJXEfyIG25QADMLj7fDV2pERFE7N5a1Nqlzd4PO+e/8sI+4DAvsC4tK 8rDKlS09J09+xxcxe0MFLNXspZRbKTbFsxYUliYmwUwnAAmf99JYNpeln2cNxDyWqHYx 08jv+FIelADrrqYrjjvrKNTadyAWPfe2MaEo9IPigeCObLMWKDG3ekvu30NQKIB3g3mn +tu7KTsziyJfzIAwGBEwaoyORAeENgd6ZvpTQN68FQF1kNV8ficC9WJCBXjFZ1BW2Ir8 tGPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ozwswJIH6wVHPaVvaNmhGc9RZ6D8RGwGKApK7N8HP9U=; b=OBcRKzMFU66nvnfKHkdHB91rer0Cw7elmEqUgL1aKyuc9VcsNexTZ0bOnFDGmK4olE U8Zb7ossGpDkhlGMu2KxOs1XMLNbVd4paYI+HXjdFU+hxS5YvsdF8oiTPAmAlHns4ynA x/MQr0N+J8EoUe1ToKGKYWuQpJ7t1hj6LeZIkcd1CThOR1Zhk9TM+HdJOCm7lCevlB8y mubhw+VcoD2UEmlSgyduBfYjhXXuWdwf/RY3phQR8CIFqYYNeUW/Qeg1a53N5uRYJRDe 8GF0iAl4ei8g04JYoXMR5RKC4DjyPmjKT4yzwhLwi3irqUwyPwXERWSGpmaK0O23aFJx +3EA== X-Gm-Message-State: AOAM533bQAjMqobcEBuT/IySmHiWBuRRfYi8y2N3Z/yGJx14CK85DJi/ mKr6qeLAdjiSrFFDbexalgWDEi2BU9WOY2gK6NU= X-Google-Smtp-Source: ABdhPJzLm4ZTHVamrfK5iTrJoaNREYBBnBcqb6VritxSA/Z7Y7sAxklca2ERUz9bD/AVK8KV5GW6/p6t4jkLCTsKGbU= X-Received: by 2002:a2e:7011:: with SMTP id l17mr11009025ljc.424.1591010354173; Mon, 01 Jun 2020 04:19:14 -0700 (PDT) In-Reply-To: <834kt2z7n1.fsf@gnu.org> 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:181332 Archived-At: --000000000000febb7405a703f644 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I got distracted with yak shaving other things and circled back around to this issue. I was reinstalling NixOS on my laptop to try my hand at getting LUKS encryption working and decided to try to replicate the issue on there. I was able to, but that's not too surprising since the whole point of NixOS is reproducible environments. I decided to try reproduce it in Manjaro on my laptop from a "live CD" burned to a usb drive. Well that attempt got thwarted by attempting to install a rust based AUR helper which ate up all my RAM (on my old laptop) and started swapping to my usb drive. (I was trying to get an AUR helper to install google fonts) So I installed virt-manager (et al) (on my main computer) and Manjaro in a virtual machine. I built Emacs from source using `make` and `make install` from the latest in the master branch in git://git.savannah.gnu.org/emacs.gi= t. Then I installed google fonts from https://aur.archlinux.org/packages/ttf-google-fonts-git/ ... and... no issue dammit. So I got my local machine back to the state where the issues occurred. `fc-list | rg -i google > fonts.txt` and use the power of Emacs to turn the ~1800 fonts into a list of strings I can set to `face-ignored-fonts` variable. I was excited to see that ignoring all 1800+ fonts fixed the perf issue. So I binary searched through them commenting them out and narrowed it down to one.. damn font "Adobe Blank". And sure enough (on my local NixOS machine): =CE=BB ~/ time emacs -Q --eval '(message "=EF=B8=B5")' -kill emacs -Q --eval '(message "=EF=B8=B5")' -kill 82.35s user 0.03s system 99%= cpu 1:22.56 total =CE=BB ~/ time emacs -Q --eval "(progn (setq face-ignored-fonts '(\"Adobe Blank\")) (message \"=EF=B8=B5\"))" -kill emacs -Q --eval -kill 0.22s user 0.02s system 68% cpu 0.349 total AHHHH!!!! I open up Manjaro in the virtual machine and: git clone https://github.com/adobe-fonts/adobe-blank.git cd adobe-blank sudo cp AdobeBlank.ttf /usr/share/fonts/ fc-cache time emacs -Q --eval '(message "=EF=B8=B5")' -kill And it took 4 minutes in the virtual machine! Turns out that https://aur.archlinux.org/packages/ttf-google-fonts-git/ didn't have Adobe Blank font. Please try it and see if you can repro! Also, please note that the character I have been testing with is not the only one were this issue shows up. I have run into the issue when grep for things using deadgrep, but I didn't spend the time to narrow down to an exact character in those cases. On Wed, Apr 29, 2020 at 9:31 AM Eli Zaretskii wrote: > > From: Will Bush > > Date: Wed, 29 Apr 2020 07:42:20 -0500 > > Cc: Robert Pluim , "Basil L. Contovounesios" < > contovob@tcd.ie>, 40733@debbugs.gnu.org, > > James Cloos > > > > Did you see my other message that I forwarded where I forgot to CC > everyone? I > > was able to switch between a bunch of revisions of the master branch to > see > > where the performance issue started, and it appears to have started wit= h > commit > > (88efc736f5 Default cairo to enabled). I was hoping that would narrow i= t > down. > > I don't think it does. > > And the profile you show doesn't seem to be pointing at Emacs as the > culprit, since all the functions shown are unrelated to displaying > characters. So perhaps Robert is right, and some font-related > subsystem of your OS is what takes time here. > --000000000000febb7405a703f644 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I got distracted with yak shaving other things and cir= cled back around to this issue. I was reinstalling NixOS on my laptop to tr= y my hand at getting LUKS encryption working and decided to try to replicat= e the issue on there. I was able to, but that's not too surprising sinc= e the whole point of NixOS is reproducible environments.

I decided t= o try reproduce it in Manjaro on my laptop from a "live CD" burne= d to a usb drive. Well that attempt got thwarted by attempting to install a= rust based AUR helper which ate up all my RAM (on my old laptop) and start= ed swapping to my usb drive. (I was trying to get an AUR helper to install = google fonts)

So I installed virt-manager (et al) (on my main comput= er) and Manjaro in a virtual machine. I built Emacs from source using `make= ` and `make install` from the latest in the master branch in git://git.savannah.gnu.org/emacs.git. Then I installed google fonts from https://aur.archlinux.org/packages/ttf-goo= gle-fonts-git/

... and... no issue dammit.

So I got my lo= cal machine back to the state where the issues occurred. `fc-list | rg -i g= oogle > fonts.txt` and use the power of Emacs to turn the ~1800 fonts in= to a list of strings I can set to `face-ignored-fonts` variable.

I w= as excited to see that ignoring all 1800+ fonts fixed the perf issue. So I = binary searched through them commenting them out and narrowed it down to on= e.. damn font "Adobe Blank".

And sure enough (on my local = NixOS machine):

=CE=BB ~/ time= emacs -Q --eval '(message "=EF=B8=B5")' -kill
emacs -= Q --eval '(message "=EF=B8=B5")' -kill=C2=A0 82.35s user = 0.03s system 99% cpu 1:22.56 total

=CE=BB ~/ time emacs -Q --eval &q= uot;(progn (setq face-ignored-fonts '(\"Adobe Blank\")) (mess= age \"=EF=B8=B5\"))" -kill
emacs -Q --eval=C2=A0 -kill=C2= =A0 0.22s user 0.02s system 68% cpu 0.349 total



AHHHH!!!!=


I open up Manjaro in the virtual machine and:

git clone https://github.com/adobe-fonts/adobe-blank.gitcd adobe-blank
sudo cp AdobeBlank.ttf /usr/share/fonts/
fc-cache
= time emacs -Q --eval '(message "=EF=B8=B5")' -kill
=

And it took 4 minutes in the virtual machine!

Turns out that= https= ://aur.archlinux.org/packages/ttf-google-fonts-git/ didn't have Ado= be Blank font.

Please try it and see if you can repro!

Also, please note that the character I have been testing w= ith is not the only one were this issue shows up. I have run into the issue= when grep for things using deadgrep, but I didn't spend the time to na= rrow down to an exact character in those cases.


On Wed, Apr 29= , 2020 at 9:31 AM Eli Zaretskii <eliz@gn= u.org> wrote:
> From: Will Bush <will.g.bush@gmail.com>
> Date: Wed, 29 Apr 2020 07:42:20 -0500
> Cc: Robert Pluim <rpluim@gmail.com>, "Basil L. Contovounesios" <contovob@tcd.ie>, <= a href=3D"mailto:40733@debbugs.gnu.org" target=3D"_blank">40733@debbugs.gnu= .org,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0James Cloos <cloos@jhcloos.com>
>
> Did you see my other message that I forwarded where I forgot to CC eve= ryone? I
> was able to switch between a bunch of revisions of the master branch t= o see
> where the performance issue started, and it appears to have started wi= th commit
> (88efc736f5 Default cairo to enabled). I was hoping that would narrow = it down.

I don't think it does.

And the profile you show doesn't seem to be pointing at Emacs as the culprit, since all the functions shown are unrelated to displaying
characters.=C2=A0 So perhaps Robert is right, and some font-related
subsystem of your OS is what takes time here.
--000000000000febb7405a703f644--