From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Adam Porter <adam@alphapapa.net>
Newsgroups: gmane.emacs.devel
Subject: Re: Strange hangs when visiting .el and .html files
Date: Fri, 9 Feb 2024 12:50:54 -0600
Message-ID: <1e5dc76b-5e82-4d9c-a1ac-a6104b6b1d03@alphapapa.net>
References: <ZcZqUUNP7p2VMOaD@thyrsus.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="6471"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla Thunderbird
Cc: emacs-devel@gnu.org, schwab@suse.de
To: esr@thyrsus.com
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 09 20:46:56 2024
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1rYWps-0001TE-0e
	for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Feb 2024 20:46:56 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces@gnu.org>)
	id 1rYWp5-0004d3-B5; Fri, 09 Feb 2024 14:46:07 -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 <adam@alphapapa.net>)
 id 1rYWp4-0004ct-62
 for emacs-devel@gnu.org; Fri, 09 Feb 2024 14:46:06 -0500
Original-Received: from cyan.elm.relay.mailchannels.net ([23.83.212.47])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <adam@alphapapa.net>)
 id 1rYWp0-0004fj-Io
 for emacs-devel@gnu.org; Fri, 09 Feb 2024 14:46:05 -0500
X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net
Original-Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 39AB0C4A97;
 Fri,  9 Feb 2024 18:50:57 +0000 (UTC)
Original-Received: from pdx1-sub0-mail-a213.dreamhost.com (unknown [127.0.0.6])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id CEECFC4A94;
 Fri,  9 Feb 2024 18:50:56 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1707504656; a=rsa-sha256;
 cv=none;
 b=AVRYlLtKa6/YuRu2KhVwtutibtyuhtkZUY0ZXeA46UdIkYxyJYqqozpRVyoh5+xoV0IHYU
 XIBE1AWfwXSgVBy+/6MLN4wlCsn4PhD/8TSdbi0MYH1+TQurNEXnkLYbTjBAOz4uhTtEYY
 APiK0mGNE746sDDs5qPX7+jOo0dBLvXManyXoD7iDke0TVYmQW2A164jF2o/p65e4Rer1W
 iopxm8oVZq7wsvoeeCyEM+mHpCfmG8bA8stwrikH7M+D5MRbav761K8A/+h30k42tTXm9A
 v1Fg7jBTmSf6+uORjXaMU16T/olcCV8F1hpva90QGLNtL8s5SAQubiAOud+VyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1707504656;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=7rUz6JQyQEjreLIu3BqssAt5WP3XMn+GWbULUT+MqsY=;
 b=YFC62Qkzx6pUeSi3I8DvUJP8FA0bMKTwKfHwfoycIrj3oT9VhG32Cbeg7TGEEMFZsazPqm
 RsFdFfZdMLR6mCDOOqG3Sr049FiLJ2OSAwv60wtOkmPoAhSjXD6ZotgRX+watZ6B/f0PNe
 gtxWGm8oQiMNCSiUKgpEgmoi3auGEt8l6dMwj0NdW+i2Jn9IdaZSrZX0GJe462/mdSsDCs
 y3O372G86dETqTIMVK5qhZZl17t8XsZbS+VlYyquBimUHT4mAs2OfYV6w+7cTsSPMk0cNZ
 3rI3q3stvA0hGRS77e2xe1MgNJ5kEWZwzhDxS0zu02kdhxuKw1lVmYNB8ssIMA==
ARC-Authentication-Results: i=1; rspamd-55b4bfd7cb-tjck5;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net
X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net
X-MailChannels-Auth-Id: dreamhost
X-Snatch-Squirrel: 6919026f31e97712_1707504657097_914081492
X-MC-Loop-Signature: 1707504657097:3538057197
X-MC-Ingress-Time: 1707504657097
Original-Received: from pdx1-sub0-mail-a213.dreamhost.com (pop.dreamhost.com
 [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384)
 by 100.113.222.71 (trex/6.9.2); Fri, 09 Feb 2024 18:50:57 +0000
Original-Received: from [10.43.1.110] (unknown [193.56.116.15])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 (Authenticated sender: adam@alphapapa.net)
 by pdx1-sub0-mail-a213.dreamhost.com (Postfix) with ESMTPSA id 4TWjbz5rzhzGx; 
 Fri,  9 Feb 2024 10:50:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net;
 s=dreamhost; t=1707504656;
 bh=7rUz6JQyQEjreLIu3BqssAt5WP3XMn+GWbULUT+MqsY=;
 h=Date:To:Cc:Subject:From:Content-Type:Content-Transfer-Encoding;
 b=bi7CojtLLCZaUoTl3wGLJ9fJsOkn67mQ0AkbPnDMa5N7rK8/TguFiAbBxydwnZBMt
 ol7A9kHTwGZG4yUG3RVZxgJ+kG+FhE/e4YkbBFreWkfVQLKif0jdh2UbTQGsxXugTe
 EcTUlqtUHBK7rwDifPTTVlVn0lx5AlhmKAKo06s5fE4X4C+SPA368my14PrFEZ7mBf
 DM4tZndDlArdvxo14eOec6CBy66a8ncWaoGVf7BrO8hjxqvFH0MlDKcz4Dd0g2dpJP
 UzhGuPdwzaCwqkC5aeOX5OQOK0BbYoNvFQV6nnTuouFmQwQqd8eodT2uOeSm3WTEzh
 1zsqmLbkpfIlw==
Content-Language: en-US
In-Reply-To: <ZcZqUUNP7p2VMOaD@thyrsus.com>
Received-SPF: neutral client-ip=23.83.212.47; envelope-from=adam@alphapapa.net;
 helo=cyan.elm.relay.mailchannels.net
X-Spam_score_int: -12
X-Spam_score: -1.3
X-Spam_bar: -
X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=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:316075
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/316075>

> Andreas Schwab <schwab@suse.de>:
>> On Feb 07 2024, Eric S. Raymond wrote:
>> 
>> > About a week ago I noticed that my Emacs was hanging when I attempted
>> > to visit my init.el file.  Then I saw the same hang when visiting an
>> > HTML file.  Other modes, such as text and C modes, are working normally.
>> 
>> Is it interruptable?  Then you can enable debug-on-quit to see where it
>> hangs.
> 
> I tried that first thing.
> 
> Ctl-G after the hang does interrupt it, but doesn't yield a trace.
> 
> It's a weird bug because it's so specific. Most Lisp modes are
> completely unaffected.

This sounds like a weird behavior that I've observed ever since Emacs 
28, but I've never been able to pin it down well enough to file a report 
about it.

Basically, what I observe is that:

1. Certain actions (like calling certain commands, perhaps including 
ones that activate a major mode) cause Emacs to spin with 100% CPU usage 
for some time, tens of seconds or even a couple of minutes sometimes.

2. It only happens when such an action happens for the first time in a 
session.

3. If I interrupt with C-g, everything appears normal; no errors, no 
partially initialized state, no weird behavior.  It's as if whatever I 
interrupted was "optional."

4. Over time (3 or 4 versions now), the actions that trigger this 
behavior have not been consistent.  I might even venture to say that, 
between different builds of the same version, the actions might not be 
consistent.

5. It seems to happen less now, on Emacs 29.1 (I still need to upgrade) 
than it did on builds of 28.0 and 28.1.

6. Without being able to verify it, I have the impression or intuition 
that it happens when Emacs loads a library for the first time in a 
session (I don't mean when it loads any library, just a certain one or 
ones, but I haven't been able to pin it down).

Over the past couple of years, I've heard a few other users mention 
observing similar behavior at times, but again, always being difficult 
to nail down.

If this seems like the same behavior you're seeing, maybe it's time we 
give this problem a name and an real bug report.