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#61514: 30.0.50; sadistically long xml line hangs emacs Date: Tue, 21 Feb 2023 14:05:40 +0200 Message-ID: <83r0ujte97.fsf@gnu.org> References: <87lel0c65v.fsf@everybody.org> <838rgvymcd.fsf@gnu.org> <831qmkwmux.fsf@gnu.org> <83cz64v3v7.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5046"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mah@everybody.org, 61514@debbugs.gnu.org, monnier@iro.umontreal.ca To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 21 13:06:19 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 1pURPW-00018R-T5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Feb 2023 13:06:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pURPI-0004GT-EG; Tue, 21 Feb 2023 07:06:04 -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 1pURPG-0004GJ-Uk for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 07:06: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 1pURPG-0005sO-IH for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 07:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pURPG-0007Bk-Db for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 07:06: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: Tue, 21 Feb 2023 12:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61514 X-GNU-PR-Package: emacs Original-Received: via spool by 61514-submit@debbugs.gnu.org id=B61514.167698113827600 (code B ref 61514); Tue, 21 Feb 2023 12:06:02 +0000 Original-Received: (at 61514) by debbugs.gnu.org; 21 Feb 2023 12:05:38 +0000 Original-Received: from localhost ([127.0.0.1]:54793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUROs-0007B5-E9 for submit@debbugs.gnu.org; Tue, 21 Feb 2023 07:05:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUROq-0007AN-Ki for 61514@debbugs.gnu.org; Tue, 21 Feb 2023 07:05:37 -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 1pUROl-0005dn-0O; Tue, 21 Feb 2023 07:05:31 -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=l2BZXnCexAwTpyAgOMPlExPwZHjerxVeCyK6zIvTBJg=; b=M6tVkzpNAB0k XZfQemCzvQMVx0GTAhbuV+spikLalpOkvRcuL8/AbTwJTwAtPbiB0k3eYzqZEf9zV56vCEDsI6SVf 0m/2Sr4sh/n9kaUAMfgX1Fe1JIVkzWqeYVpJc6nqwGf66pUL9+K4hFnnmWvOC3TbQWZ11SkH/1miO CF/w8pv/XbfecP+lWWVmmXl8+UPenm/L51vCyVrVZQ75kzwz2aHmhUiTGvxY7EhgzdGBCykW76/K6 diMjKpAtOqIXEKe8gS1AVEfpzblsqYHgMDeXgVhoPmD95RY+kneFe30iskqqVycHbUndEdg1n+9ri hGQvikavUwUim52oBZrwPw==; 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 1pUROj-0000PG-NI; Tue, 21 Feb 2023 07:05:30 -0500 In-Reply-To: (message from Gregory Heytings on Mon, 20 Feb 2023 20:13:38 +0000) 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:256251 Archived-At: > Date: Mon, 20 Feb 2023 20:13:38 +0000 > From: Gregory Heytings > cc: Eli Zaretskii , 61514@debbugs.gnu.org, mah@everybody.org > > > Maybe we should reduce the scope of the search for the fallback case > > (the case where we add the "[^...]+\\<" prefix) since AFAICT its only > > purpose is to try and guess a helpful error messages when the XML is > > ill-formed. > > > > That's an idea, yes. With the following patch even your "n_n_..." example > opens almost instantanously: > > diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el > index c36d225c7c9..61783ea4dec 100644 > --- a/lisp/nxml/xmltok.el > +++ b/lisp/nxml/xmltok.el > @@ -734,7 +734,7 @@ xmltok-scan-attributes > (atts-needing-normalization nil)) > (while (cond ((or (looking-at (xmltok-attribute regexp)) > ;; use non-greedy group > - (when (looking-at (concat "[^<>\n]+?" > + (when (looking-at (concat "[^<>\n]\\{1,1000\\}?\\<" > (xmltok-attribute regexp))) SGTM, but isn't 1000 a somewhat low value? What if we use half of the value of long-line-optimizations-region-size instead?