From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61514: 30.0.50; sadistically long xml line hangs emacs Date: Mon, 20 Feb 2023 14:37:51 -0500 Message-ID: References: <87lel0c65v.fsf@everybody.org> <838rgvymcd.fsf@gnu.org> <831qmkwmux.fsf@gnu.org> <83cz64v3v7.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13327"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 61514@debbugs.gnu.org, mah@everybody.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 20 20:39:27 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 1pUC0S-00036z-Ve for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Feb 2023 20:39:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUC09-0006IK-3F; Mon, 20 Feb 2023 14:39:05 -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 1pUC07-0006HH-2t for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 14:39: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 1pUC06-00079j-FV for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 14:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUC06-0003gX-8k for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 14:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Feb 2023 19:39: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.167692188414090 (code B ref 61514); Mon, 20 Feb 2023 19:39:02 +0000 Original-Received: (at 61514) by debbugs.gnu.org; 20 Feb 2023 19:38:04 +0000 Original-Received: from localhost ([127.0.0.1]:53697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUBzA-0003fB-H9 for submit@debbugs.gnu.org; Mon, 20 Feb 2023 14:38:04 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUBz6-0003ed-Mk for 61514@debbugs.gnu.org; Mon, 20 Feb 2023 14:38:03 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 357994417F1; Mon, 20 Feb 2023 14:37:55 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B48484417F3; Mon, 20 Feb 2023 14:37:53 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1676921873; bh=wkjJNLDSe8GHc7cJGkvvzIHV0g5ylIzsatH+xXGk4a8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VkvwnF9jrDc0o6kgtTuOhV36s03Lz+8SttoTrP/U9092mukhSIlfBX97bacVaXXLh e197bQp9EafUSx9oMMbNMGvHKJsikun7B+R957QCHm2mhUDsaBz8hQhWYVuC3FTTtM xxXVVmKY6d8iUDZPnk+HETUY8RS1ry15O2leDPy+wdDkeSnFyWGd4SKZSq9J11MPUL +/kFVS6H4jbuPFeIwJcwSmm5GgO/JH5JJmGuGKm5+O4ueMnTdrC3Q5YViOKni7pZ1D CTOM/++6bXmcbYJ1205ETa/s/bT/HgQRHEVEks7vG3/xDp/EA/JeCgRUCq3hcZE14L SI6WLJODpVN5A== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 79778123210; Mon, 20 Feb 2023 14:37:53 -0500 (EST) In-Reply-To: (Gregory Heytings's message of "Mon, 20 Feb 2023 19:11:31 +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:256216 Archived-At: >> The patch below fixes the stack overflow. > Together with the "\\<" in xmltok.el, this fixes this bug indeed in all > cases (truncated and non-truncated ones). Congrats! We probably still have an O(N=B2) behavior which can bite with a line like My patch should significantly improve the constant factor, but with a long enough "N_N_N_N_N..." I suspect it can still end up painful. 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. >> I don't think we want that for `emacs-29`, but unless there's some >> objection I'll push this to `master`, > I'd say it fixes an important bug in the regexp engine, but I cannot judge > whether it's important enough for emacs-29. It's a missing optimization that's been with us for many many years, so I don't see any urgency to fix it. Stefan