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 11:47:38 -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 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21421"; 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 17:48: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 1pU9L0-0005K9-Kx for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Feb 2023 17:48:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU9Kh-0003ff-Mq; Mon, 20 Feb 2023 11:48:07 -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 1pU9Kf-0003ez-8Z for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 11:48:05 -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 1pU9Kc-0007Oj-UI for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 11:48:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pU9Kc-0004vZ-Hj for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 11:48: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 16:48: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.167691167518887 (code B ref 61514); Mon, 20 Feb 2023 16:48:02 +0000 Original-Received: (at 61514) by debbugs.gnu.org; 20 Feb 2023 16:47:55 +0000 Original-Received: from localhost ([127.0.0.1]:53344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU9KU-0004uY-Kz for submit@debbugs.gnu.org; Mon, 20 Feb 2023 11:47:55 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:1626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU9KR-0004tg-LJ for 61514@debbugs.gnu.org; Mon, 20 Feb 2023 11:47:52 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 414C210011A; Mon, 20 Feb 2023 11:47:46 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6C5741000E6; Mon, 20 Feb 2023 11:47:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1676911664; bh=qG7i3/3VcwNxUsoexOrRt3oiSMT3JmCEkI67KCO9Wxo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hw7jURvHX8sLHEXXFM0Ag7sTz2Wbm0qENCGtdKrFA3RLQrfw/AG1x2UVRkCp0didF RWNgmHzpPfG/CvyOtxGEfMjvV6T3xR6L/myKcAPflWb8rMojz91G+Cb5AvRaIc6IBk mAO+dw+/HHbhiIWrF8VrX7qZeFrXvoJwvCQ3DJUkWgAXA2gP5xKJTPPm9wCAzl+z5Z cykUYmrQUhYiwE3THebi52Kt6qPzlLqVrOB/aJ2QVYGmnkGtfAQwcfdnQHhhyV+Y3z 3W0djBAbiCwxUcx6UZantn0cQNpHIqZByLmRddCjUyr+KZ//6UeGXqjRrYy66Fyb53 QKjCzKluqzong== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 40B231231E5; Mon, 20 Feb 2023 11:47:44 -0500 (EST) In-Reply-To: (Gregory Heytings's message of "Mon, 20 Feb 2023 15:56:30 +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:256200 Archived-At: > I don't know... but I observe that this alone: > > (with-current-buffer (get-buffer-create "*bug*") > (insert " (insert (make-string 250000 ?n)) > (goto-char 5) > (looking-at > "[^<>\n]+?\\(\\(?:\\(xmlns\\)\\|[_[:alpha:]][-._[:alnum:]]*\\)\\(:[_[:alpha:]][-._[:alnum:]]*\\)?\\)[ \r\t\n]*=\\(?:[ \r\t\n]*\\('[^<'&\r\n\t]*\\([&\r\n\t][^<']*\\)?'\\|\"[^<\"&\r\n\t]*\\([&\r\n\t][^<\"]*\\)?\"\\)\\(?:\\([ \r\t\n]*>\\)\\|\\(?:\\([ \r\t\n]*/\\)\\(>\\)?\\)\\|\\([ \r\t\n]+\\)\\)\\)?")) > > doesn't fail, so I don't think it's this regexp which causes the overflow. Indeed, there' still something unclear about how the overflow occurs, but at least it seems my analysis doesn't match emacs-regex.c's because I can get a stack overflow using the first part of the regexp: (with-current-buffer (get-buffer-create "*bug*") (erase-buffer) (insert "