From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#28329: 25.2; Eshell: 40M+ output: Stack overflow in regexp matcher Date: Sun, 30 Jun 2019 09:45:16 -0400 Message-ID: <87h8875gr7.fsf@gmail.com> References: <87d0ivipfc.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="71877"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) Cc: Stefan Kangas , 28329@debbugs.gnu.org, Pierre Neidhardt To: Pierre Neidhardt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 30 15:46:34 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hhaA5-000IZm-5s for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Jun 2019 15:46:33 +0200 Original-Received: from localhost ([::1]:44820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhaA3-0004C7-I9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Jun 2019 09:46:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48323) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hha9b-0004Bw-Ea for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 09:46:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hha9a-0007kE-CK for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 09:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hha9a-0007k3-57 for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 09:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hha9a-0003Kp-1X for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 09:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jun 2019 13:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28329 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: unreproducible moreinfo Original-Received: via spool by 28329-submit@debbugs.gnu.org id=B28329.156190232612770 (code B ref 28329); Sun, 30 Jun 2019 13:46:01 +0000 Original-Received: (at 28329) by debbugs.gnu.org; 30 Jun 2019 13:45:26 +0000 Original-Received: from localhost ([127.0.0.1]:45506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hha90-0003Ju-BJ for submit@debbugs.gnu.org; Sun, 30 Jun 2019 09:45:26 -0400 Original-Received: from mail-io1-f46.google.com ([209.85.166.46]:45474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hha8y-0003Jg-Do for 28329@debbugs.gnu.org; Sun, 30 Jun 2019 09:45:25 -0400 Original-Received: by mail-io1-f46.google.com with SMTP id e3so22643437ioc.12 for <28329@debbugs.gnu.org>; Sun, 30 Jun 2019 06:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=w+ZYCu7/dHdnNI8hUVCMrTn/KKw99DWqg976RetgEpY=; b=OJjsQB5PSG6U5HJrARlLH8vwkvsjHO65iYqRbeKHWoHaC+9O9YDu/uGvzaGIYzYgy3 1oQ+sQ8gTxQ2PEqFI9iLFSdkR2tcVeIIAYnJqTUOjyGyfQPtmJPkdVRUN9iKTsNJWCul y+rz1UiSXChybLIt12JJhAoh+iLNrqvNnfxY858hwpfw1bxzaOYE3Q2xYjwLWhFkR4NZ mvObMkJO7dsrns7QVX4tnnMqt5ZvjtTmjCqYu/Z1o2NY9NYoBsLMejirSdjRF9TuE1Nn xskJbWFYvfFUzMH0ASa8kHwFzu1muz7reOtPebtPJxq9Ra7By12z6fVVQSFKQcjISyUG x3Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=w+ZYCu7/dHdnNI8hUVCMrTn/KKw99DWqg976RetgEpY=; b=tfMeWIBVKzTxGQa5CmytM+Q5CqSSn5ALOmEApQ+UDAhrRUI2XwB4HshYu/6B4ukR2F BAfwFsTh2NOtNZmvGOiJj8bS/8hJPeyfTtbZWY7PDJjj8cKT5gUxDa5NeZNW3y78IJcR KDMMXGgmk41r22/835l8CgO0uxs8gVVU0IYsPelBdWS4XmN9xMxrkVw42BQtu9fHvyna ZbjViu4zviIIjVTB09Mif2OQGD8qX2KGCQoF1nWvcejo2k7/1hJHHwyIP5zCYAHzmHmc KM5nwccZJdbmyiA2285z0hLf6ZiZ0Uqgi6iw/PDCDfXm+V14KgQ5o7yoqZvnejekFJYt F9+Q== X-Gm-Message-State: APjAAAWG7EgqTO9UVaa1dFjKV8T5lmeTr16vsnvAt9nm6MWVz5FZoys6 4+jIkQPw+7m8f8Xom04F0i1TQlhp X-Google-Smtp-Source: APXvYqxukTuDwU28h7ZIBF85/LItg+/mma7E4c6TxQftMyWKxYjCDn52fk+Ugj31NWgS9I3DuxY/fA== X-Received: by 2002:a6b:ed01:: with SMTP id n1mr15691839iog.255.1561902318472; Sun, 30 Jun 2019 06:45:18 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id z26sm7261177ioi.85.2019.06.30.06.45.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Jun 2019 06:45:17 -0700 (PDT) In-Reply-To: <87d0ivipfc.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Sun, 30 Jun 2019 07:59:35 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161880 Archived-At: --=-=-= Content-Type: text/plain Pierre Neidhardt writes: > So I never got around reproducing the issue with Gentoo, and soon after > I dropped Gentoo and moved to Guix, with which I've never been able to > re-experience this issue, even on massive Eshell buffers (couple of 10M...). > > As far as I'm concerned, this could be closed, but maybe another Gentoo > user out there would be able to tell us more. Oh yeah, I still have a possible fix sitting in my local repo. Attaching here for posterity, but I wouldn't want to apply it unless we actually know that it would help (because it might break legitimate matches). --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Only-match-password-prompts-in-part-of-line-Bug-2832.patch Content-Transfer-Encoding: quoted-printable Content-Description: patch >From 7a3bdc88941f90c5506165ddf4b9d12f51ba9ea3 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 2 Sep 2017 08:17:48 -0400 Subject: [PATCH] [?] Only match password prompts in part of line (Bug#28329) * lisp/eshell/esh-mode.el (eshell-password-prompt-regexp): Add beginning of line anchor, and use {,80} instead of * to restrict matches in long lines. --- lisp/eshell/esh-mode.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 80844c3a64..9f80700c6a 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -179,7 +179,10 @@ eshell-preoutput-filter-functions :group 'eshell-mode) =20 (defcustom eshell-password-prompt-regexp - (format "\\(%s\\)[^:=EF=BC=9A=E1=9F=96]*[:=EF=BC=9A=E1=9F=96]\\s *\\'" (= regexp-opt password-word-equivalents)) + ;; Assume prompt will show up near the beginning of a line, this + ;; should prevent excessive regexp searches on long lines. + (format "^.\\{,80\\}%s[^:=EF=BC=9A=E1=9F=96]\\{,80\\}[:=EF=BC=9A=E1=9F= =96]\\s-*\\'" + (regexp-opt password-word-equivalents)) "Regexp matching prompts for passwords in the inferior process. This is used by `eshell-watch-for-password-prompt'." :type 'regexp --=20 2.11.0 --=-=-=--