From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: jan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#41155: 26.3; regexp 99% locks up emacs Date: Wed, 13 May 2020 10:11:57 +0100 Message-ID: References: Reply-To: jan Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="103446"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41155@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 13 11:13:09 2020 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 1jYnRt-000QnM-9p for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 May 2020 11:13:09 +0200 Original-Received: from localhost ([::1]:35580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYnRs-0001SG-Bj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 May 2020 05:13:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYnRm-0001Rs-He for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 05:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYnRm-0003EW-96 for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 05:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYnRm-0004Oc-4C for bug-gnu-emacs@gnu.org; Wed, 13 May 2020 05:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: jan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 May 2020 09:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41155 X-GNU-PR-Package: emacs Original-Received: via spool by 41155-submit@debbugs.gnu.org id=B41155.158936112616831 (code B ref 41155); Wed, 13 May 2020 09:13:02 +0000 Original-Received: (at 41155) by debbugs.gnu.org; 13 May 2020 09:12:06 +0000 Original-Received: from localhost ([127.0.0.1]:57347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYnQr-0004NP-Mp for submit@debbugs.gnu.org; Wed, 13 May 2020 05:12:05 -0400 Original-Received: from mail-pl1-f172.google.com ([209.85.214.172]:41014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYnQq-0004Mu-ED for 41155@debbugs.gnu.org; Wed, 13 May 2020 05:12:05 -0400 Original-Received: by mail-pl1-f172.google.com with SMTP id u10so6585420pls.8 for <41155@debbugs.gnu.org>; Wed, 13 May 2020 02:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fbTBtu1NHJlNy6DU9WiDPDIXkQNx5R/XP8NpEw1ktAg=; b=AxCWm4pn2wxO2YScsoRD2BEz/MglKHxG00mKFDj35AFSJFQH28eHy1vzlzWOsn62E3 o0KdlS/3vuSld5z7gvRiunpRqJyEWXiUVtEAKNNJwNihN0s0qQ2ksiUecY6IKJEfdHH2 I9Eulb/peHWyF+ezf4Vxm5BDxTx34DrJSRe8nhXJl+77THRQ+Zt5tvNFtPRvVNuf4hz8 KUhuEK9zql4T9ztdhA8SsBtE8aiucFuaycdNbCA3wtA6VtJToVKe0gix3nYh92TqwmPn H9dRZHN2VWvldpKIFimHJzI2plrnlpXSPF7drMu69RXHYb9I7H7wdWBIygpGAAe/FyIC ARSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fbTBtu1NHJlNy6DU9WiDPDIXkQNx5R/XP8NpEw1ktAg=; b=iVIRIhbrcJkGNm1YE/SUAtWKjDikegyLWKUcIk9lkcInZUf/Ibvw43CtTz2JTrTcc+ yY2cDTIpyIyf+hvlRyqXOeg8exLAdEXq3cYZIQrsTNKZgJBsS5klCJEcmeb2O5Z/L9G9 bah8ugsigGPikri6kBlJa34mD9kiVgBrhDG/wtzacTqMhwufNTkvyLmVqyUMFsXubgB9 oqWfJpB3rYMMcW2NTJ97fRH2dvXWnxwTWimtog32MbSDSaoqBQDkpmoNGJ4PVphfMEO+ 6Nw2sXfLLFkTQScRWaDmSyFvq0O0L7081mqrrqJFh+BwBTAJx3MiV6WcQTQtoLM1zxpP 7r7A== X-Gm-Message-State: AGi0PuZY57XF4zfwBK2KFUuCueXSBf4EBo04xa+34v4GfsvVh1ORcXCF euU46mU/xZ9ouJppUAOOhgIO3kCiObJppDQVSe4= X-Google-Smtp-Source: APiQypKkyijamfDq2w7kNPZcAttPSr0ZCxOCRGoUdAXmgV3RvGE3xo/p5s6A/TZ/M/IU9VX4y2r6j59iMCmHrTejvbA= X-Received: by 2002:a17:90a:2c08:: with SMTP id m8mr32682620pjd.102.1589361118560; Wed, 13 May 2020 02:11:58 -0700 (PDT) Original-Received: by 2002:a17:90b:30c5:0:0:0:0 with HTTP; Wed, 13 May 2020 02:11:57 -0700 (PDT) In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:180147 Archived-At: I've had more of a play, I see what you're saying and it makes sense. It locks up because it's a pathological, but C-g *will* interrupt it. My mistake was thinking it would cancel the highlight-regexp, but of course it doesn't, emacs handles a few keyboard events then goes right back to its inefficient scanning. So I get a self-inflicted denial of service. That may be a problem but it isn't the one I originally reported. I'm not sure the regexp is in fact working correctly but I'll leave it for now. Would someone consider this closing this issue please? thanks jan On 12/05/2020, jan wrote: > I'm not sure that's the whole issue though > > 1. C-g does not break out. If emacs simply hands off to a > C-language-based regex engine and waits for it to return then that > *may* be inevitable but I don't know. > > 2. I've done a bit of experimenting just now and something doesn't add > up, I'll try to reproduce that tomorrow, draw some conclusions and > post here. > > Thanks for the feedback. And the equation solver weirdness, which I'll > read in detail later! > > thanks > > jan > > On 12/05/2020, Paul Eggert wrote: >>> I originally put it down to the regexp being clearly pathalogical >> >> Yes, that's pretty much it. Emacs uses a backtracking matcher and its >> worst >> case >> performance is exponential. You can even use the matcher to solve >> Diophantine >> integer equations ... verrrryy slowly; see: >> >> http://blog.stevenlevithan.com/archives/algebra-with-regexes >> >> So, don't do that. (Or if you *do* want to do that, fix the matcher - but >> good >> luck with that....) >> >