From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Eric S. Raymond" Newsgroups: gmane.emacs.devel Subject: Insight into the mystery hangs Date: Sun, 11 Feb 2024 16:37:37 -0500 (EST) Message-ID: <20240211213737.3A38C18A1647@snark.thyrsus.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17442"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 11 22:38:39 2024 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 1rZHX4-0004Jo-0N for ged-emacs-devel@m.gmane-mx.org; Sun, 11 Feb 2024 22:38:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZHWA-0000UT-Sp; Sun, 11 Feb 2024 16:37:42 -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 1rZHW9-0000UI-T3 for emacs-devel@gnu.org; Sun, 11 Feb 2024 16:37:41 -0500 Original-Received: from thyrsus.com ([71.162.243.5] helo=snark.thyrsus.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZHW6-0001Tc-Jy for emacs-devel@gnu.org; Sun, 11 Feb 2024 16:37:40 -0500 Original-Received: by snark.thyrsus.com (Postfix, from userid 1000) id 3A38C18A1647; Sun, 11 Feb 2024 16:37:37 -0500 (EST) Received-SPF: pass client-ip=71.162.243.5; envelope-from=esr@thyrsus.com; helo=snark.thyrsus.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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." 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:316118 Archived-At: I finally beat Emacs into giving me a debug trace from one of the mode-initialization hangs I described in previous email. I know what's going on with at least a subset of them now. At the top of the stack trace was a call-process to "src status -a". Turns out it was VC-mode doing this, trying to get the version-control status of the file being visited. Both hangs I've seen were files I keep under SRC control. For those of you unfamiliar, SRC is a little version-control system I wrote for single-file, single-developer projects - things like config files that you want to track modifications on without mingling the history with thst of other files, even other files in the same directory. It's directly supported in VC because I wrote that support. When I saw that trace, I thought SRC was hanging and I had a serious bug to trace. Turns out not - turns out src status was incautiously recursing through every single file in my WWW directory looking for a match to the path I was visiting. This was due to some recent cghanges I made to make SRC behave more naturally in trees of directories containing SRC-controlled files. I made a two-line change to SRC to stop it from recursing into directories that don't contain a .src, RCS, or SCCS directory (SRC can work with all three of those - in particular, if you use it on an RCS directory it behaves like RCS with a non-horrible UI). With this change, src status on even very large directories is fast, and the hang goes away. However. Emacs is not entirely off the hook here. When I'm not under deadline pressure I will file a bug with a title something like "With debug-on-quit enabled, Emacs does not reliably raise a debug trace on interrupt of call-process" There's some kind of timing or window issue here. You have to get lucky to get a debug trace - I didn't, previously, in dozens of tries. -- Eric S. Raymond No matter how one approaches the figures, one is forced to the rather startling conclusion that the use of firearms in crime was very much less when there were no controls of any sort and when anyone, convicted criminal or lunatic, could buy any type of firearm without restriction. Half a century of strict controls on pistols has ended, perversely, with a far greater use of this weapon in crime than ever before. -- Colin Greenwood, in the study "Firearms Control", 1972