From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61436: Emacs Freezing With Java Files Date: Sun, 12 Feb 2023 08:00:04 +0200 Message-ID: <83k00niftn.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3329"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61436@debbugs.gnu.org To: Hank Greenburg Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 12 07:01:25 2023 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 1pR5QS-0000S4-H3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Feb 2023 07:01:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pR5QG-0006yZ-7G; Sun, 12 Feb 2023 01:01:12 -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 1pR5Q6-0006vQ-F7 for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 01:01:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pR5Q6-0002Hs-64 for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 01:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pR5Q6-0003P8-1N for bug-gnu-emacs@gnu.org; Sun, 12 Feb 2023 01:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Feb 2023 06:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61436 X-GNU-PR-Package: emacs Original-Received: via spool by 61436-submit@debbugs.gnu.org id=B61436.167618165613067 (code B ref 61436); Sun, 12 Feb 2023 06:01:02 +0000 Original-Received: (at 61436) by debbugs.gnu.org; 12 Feb 2023 06:00:56 +0000 Original-Received: from localhost ([127.0.0.1]:43856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR5Pz-0003Oh-UI for submit@debbugs.gnu.org; Sun, 12 Feb 2023 01:00:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pR5Pw-0003OT-KR for 61436@debbugs.gnu.org; Sun, 12 Feb 2023 01:00:54 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR5Pn-0002Am-G6; Sun, 12 Feb 2023 01:00:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Nnwm0ld/WBcAQh00hNFh2PrdnOsYD2Yz/We2B+jCklM=; b=E8LwxNeqjZ7k nrw9kmBztcigkgALuZB0i1cOSvAyTz4wD9QO+HLCKHt3gsW6Y0LNlfYRvzji98ObxfCMZbtFmmNDP 0cqp9j2+O0v//C4d9ux0Ihblf6B9zFRmHtyybLMFWmUO7Pyt40yu3uHz4IEssygX59xC9V33l2EZq 63wRY6ScUnK7yQWaV4ks9sCequnxmQftkxgZTiyT1lK1x1egbaE626cVTOM1noCH0Fk/HocMkG3G6 oAI9EWP6MT1QFXraYYCI1FfrMWlGXnt1pFT+6RMsG27mHvNS/1LKh/Fpo9sMhQmoJ3usBI369Gkzl uo8UYK9RYUhBovyEiNgeUw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pR5Pb-0003lv-UN; Sun, 12 Feb 2023 01:00:38 -0500 In-Reply-To: (bug-gnu-emacs@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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255374 Archived-At: > Date: Sat, 11 Feb 2023 18:16:41 +0000 > From: Hank Greenburg via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I have a few Java files that are about 500 lines of code and I can't move around in them much before Emacs > freezes. I first thought it was java-lsp but it still happened after disabling and uninstalling it. I also uninstalled > lsp-mode as well, but that didn't change anything. > > I started doing CPU profiles of it and found that which-function-mode was taking up 67% of my CPU usage. > While this is happening all I was doing was holding the down arrow until it froze about 350 lines in. Didn't > press any other buttons. > > So I disabled which-function-mode and moved around the buffer just fine! Though when trying to edit the file > (just hit enter), it froze again. This time it seems like electric-indent-mode was taking up close to 50% of my > CPU usage. > > I disabled that and tried again and then it froze again with c-indent-line-or-region eating up 63% of my CPU > when I use TAB. > > While using debug-on-quit I get the below output. Any idea what's happening here and how it can be > addressed? I do know though that if I launch emacs with the -Q argument, then there aren't any problems at > all. I tried large files of other types and it only seems to happen with Java files. I attached screenshots of the > CPU profiler outputs for each of the three scenarios. Attached is also the Java file as well as my init file. > > I am using emacs version 28.2 on EndeavorOS, but reproduced the results using both emacs 29 and the > master branch. I confirm that the issue doesn't happen with "emacs -Q" and the file you posted. So some of your customizations trigger the problem, and we must find out which one(s). Can you try selectively enabling only parts of your init files to find which customizations are the reason? If your customizations are not too many, starting "emacs -Q" and then evaluating the customizations one by one could be a good way of finding the culprit(s). Another possibility is bisecting: successively divide the init file in two halves and see which half causes the problem, then divide that half in tow, etc. etc., until you get to a small enough part you can post here (or figure out yourself). Thanks.