From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.bugs Subject: bug#61436: Emacs Freezing With Java Files Date: Wed, 11 Oct 2023 21:07:10 +0100 Message-ID: References: <87r0m1t0el.fsf@sappc2.fritz.box> Mime-Version: 1.0 (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="1127"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Robert Weiner , Hank Greenburg , Mats Lidell , Alan Mackenzie , Eli Zaretskii , 61436@debbugs.gnu.org To: Jens Schmidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 11 22:08:07 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 1qqfV1-000Ac8-GZ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Oct 2023 22:08:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqfUc-000623-Dv; Wed, 11 Oct 2023 16:07:42 -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 1qqfUa-00061p-2u for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2023 16:07:40 -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 1qqfUZ-0005FJ-Nm for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2023 16:07:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qqfUv-0004F6-K1 for bug-gnu-emacs@gnu.org; Wed, 11 Oct 2023 16:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Oct 2023 20:08:01 +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.169705487316281 (code B ref 61436); Wed, 11 Oct 2023 20:08:01 +0000 Original-Received: (at 61436) by debbugs.gnu.org; 11 Oct 2023 20:07:53 +0000 Original-Received: from localhost ([127.0.0.1]:40115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqfUm-0004EU-Pt for submit@debbugs.gnu.org; Wed, 11 Oct 2023 16:07:53 -0400 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:41041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqfUk-0004EB-6O for 61436@debbugs.gnu.org; Wed, 11 Oct 2023 16:07:51 -0400 Original-Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-405e48d8e72so687355e9.0 for <61436@debbugs.gnu.org>; Wed, 11 Oct 2023 13:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697054842; x=1697659642; darn=debbugs.gnu.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=7CGny5FV3Xsu8s5zgwfchKMVLBmRJVxPmgPPrDs6GBg=; b=XveuuGGVGP2o08XV4q5ghEYiUTgGcHEKqANnXY53Fgss7wMKfP+hoakYYnA+FAWXp2 thzRjaLrXMIYS5NatTDKEZSLsa4WKbw1Zd5eqST5mPpZke62+FJGUs6K+2qk7dO2c21D 4dUKjyTvByOmLooyZRTbDtbV+Lze1sMElNNhYJpYIz1v9kkVTJjDll3Acu7E7j3eCwtL 6rSiEKggI8pGmTioDS+dRReXd43ZcNk65oIe+tVpc+geF7DXgz9c/YJrHifvstGpDSKB IPO+YUAbVZCFEW6EDzzythtVicL1C2MMFoaG4+naUXMG0Rf9MvXfKaDnS4KgdBwL5eLw vM3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697054842; x=1697659642; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7CGny5FV3Xsu8s5zgwfchKMVLBmRJVxPmgPPrDs6GBg=; b=TDvfr+HArLQ3K6sFunB7Z8eySZc11DPX+9vRwE2nawGwgYRScUbWDjQp0cIsszEV3x CimX5ajgJGUe29yjH13RTR2ZM4kcIAcPNBihBrBgn21Wm6VN2xV/uNGpxiWpGnYgeu5o d+Qdww8U8iJ/xuL+/45npXekalp7kNabhrxLZ3rlazpOAkj9heI3XQck6WdqnY+sg7gt gy94VDlpWMbnyBLHXUJ1zh4lYTNC+H6D60+uzPtR2OKFCAiiAqafSaCDrcmMdWyGXhzH JL4hEqU+sjl94YOMszErHTOtT5utS0Fv9ktmtQYInHt08o56FByw7tQOYXR6yzniMwt6 0sYQ== X-Gm-Message-State: AOJu0YyktfiFUbrEaJ6HxJjTx6hFIzBI510P8TXyeflDehsDqwOU5hIX Mdz7V/yDVCl6RAnCLee+UOXngF45Z6A2Vg== X-Google-Smtp-Source: AGHT+IGhy5oWXFVj2cBc4jAziZcS9ewM3d4AD89+0nsb6le/Bm1z1n3OfV7tnIXQUm7+nqKi8SrJ+w== X-Received: by 2002:a05:600c:1d18:b0:404:72f9:d59a with SMTP id l24-20020a05600c1d1800b0040472f9d59amr19899634wms.0.1697054841977; Wed, 11 Oct 2023 13:07:21 -0700 (PDT) Original-Received: from smtpclient.apple ([94.4.55.6]) by smtp.gmail.com with ESMTPSA id m6-20020adfa3c6000000b0032d8034724esm4034220wrb.94.2023.10.11.13.07.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Oct 2023 13:07:21 -0700 (PDT) In-Reply-To: <87r0m1t0el.fsf@sappc2.fritz.box> X-Mailer: iPhone Mail (20H19) 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:272269 Archived-At: Those are some pretty old regexps in Hyperbole that we have not updated in m= any years. Maybe we just need to cross-check them against what is currently= in Emacs to resolve this. I will have a look. Thanks for tracing through t= his. -- rsw > On Oct 11, 2023, at 8:38 PM, Jens Schmidt w= rote: >=20 > =EF=BB=BFHi Alan, >=20 > could you please have a look as well? This seems to be related to > cc-mode/java-mode. New, complete reproducer at the very bottom of this > mail. >=20 > Thanks! >=20 > Hi Robert & Mats, >=20 > Robert Weiner writes: >=20 >> Jens wrote: >>=20 >>> That always freezes Emacs (29 and master) even before it has a chance to= >>> display P1.java. The freeze happens in function >>> `c-get-fallback-scan-pos', where the while loop inf-loops, BUT: >>>=20 >>> If you uncomment the line setting `hkey-init' to nil in init.el and >>> repeat: No freeze. >>=20 >> As you note above, the infinite loop is coming from a Lisp function in >> Emacs core, not from Hyperbole. A Hyperbole setting may help you to >> see a state reached in that function that you otherwise would not, but >> it is not a Hyperbole bug; it is an unhandled state outside of >> Hyperbole. >=20 > Well, yes and no. The next closest culprit seems to be this hook > addition from function `hui-select-initialize': >=20 > ;; These hooks let you select C++ and Java methods and classes by > ;; double-clicking on the first character of a definition or on its > ;; opening or closing brace. This is all necessary since some > ;; programmers don't put their function braces in the first column. > (var:add-and-run-hook > 'java-mode-hook > (lambda () > (setq defun-prompt-regexp > "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|s= ynchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)= \\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)= \\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-= zA-Z][^][ \t:;.,{}()=7F=3D]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^= );{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0= -9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*"))) >=20 > I (very generally) think that Emacs does not have to grok every regexp > in every context, but I leave that concrete case for Alan and/or others > to decide. >=20 >> On Wed, Oct 11, 2023 at 3:29=E2=80=AFAM Mats Lidell wrote: >>=20 >> Thanks for the report. >=20 > Actually, not mine. I'm just the messenger who did some root-cause > analysis. >=20 >> Note: I don't know what P1.java means here. I have picked a java file >> at random that I had on my machine that is large. Is P1.java a >> specific file that has been shared earlier? >=20 > The OP has provided that, see below. >=20 >> Hyperbole has its own tracker. >>=20 >> https://debbugs.gnu.org/cgi/pkgreport.cgi?package=3Dhyperbole >=20 > Ok, thanks. As soon as we know whose bug this is we could forward or > not. >=20 >=20 > Now for the next reproducer (Hyperbole no longer required, but still > present through its regexp :-): >=20 > - Save the following to ~/tmp/init.el: >=20 > ------------------------- snip ------------------------- > (add-hook > 'java-mode-hook > (lambda () > (setq defun-prompt-regexp > "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|syn= chronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\= s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\= s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA= -Z][^][ \t:;.,{}()=7F=3D]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);= {}]*)\\)?\\([] \t]*\\)\\(\\s-*\\\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9= ]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*"))) > ------------------------- snip ------------------------- >=20 > - Save attachment P1.java from the initial message >=20 > https://yhetil.org/emacs-bugs/ZPOcahP9yPJ-kLcgipM3-l0jatXJSQWKPfObrlOkIB3= dagud85x2DGXGhPpQn1QNqNksVmPIRc1intyW_Cx1Z9ou2vBZ5QLDpLTi_VFVYyg=3D@protonma= il.com/ >=20 > to ~/tmp/P1.java. >=20 > - Start Emacs as >=20 > ./src/emacs -Q -l ~/tmp/init.el +181 ~/tmp/P1.java >=20 > That always freezes Emacs (29 and master) even before it has a chance to > display P1.java. The freeze happens in function > `c-get-fallback-scan-pos', where the while loop inf-loops.