From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Chris Hecker" Newsgroups: gmane.emacs.bugs Subject: bug#59038: Re[2]: bug#59038: loading this base64 file makes emacs -Q 28.2 peg a core infinitely Date: Sun, 06 Nov 2022 19:46:01 +0000 Message-ID: References: <83h6zd51h0.fsf@gnu.org> <62a776a86318abee7349@heytings.org> <62a776a8636ebc0aad56@heytings.org> <83a7ad518e21593e8888@heytings.org> <83iljs197i.fsf@gnu.org> Reply-To: Chris Hecker Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1269"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: eM_Client/8.2.1721.0 Cc: psainty@orcon.net.nz, gerd.moellmann@gmail.com, Gregory Heytings , 59038@debbugs.gnu.org To: "Alan Mackenzie" , "Eli Zaretskii" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 06 20:47:39 2022 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 1orlcI-00006E-Hk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 06 Nov 2022 20:47:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orlbk-0008BJ-Ky; Sun, 06 Nov 2022 14:47: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 1orlbi-0008Am-LF for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2022 14:47:02 -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 1orlbi-0004ZC-DO for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2022 14:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1orlbi-00088m-9q for bug-gnu-emacs@gnu.org; Sun, 06 Nov 2022 14:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Chris Hecker" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Nov 2022 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59038 X-GNU-PR-Package: emacs Original-Received: via spool by 59038-submit@debbugs.gnu.org id=B59038.166776397431216 (code B ref 59038); Sun, 06 Nov 2022 19:47:02 +0000 Original-Received: (at 59038) by debbugs.gnu.org; 6 Nov 2022 19:46:14 +0000 Original-Received: from localhost ([127.0.0.1]:60711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orlav-00087P-O9 for submit@debbugs.gnu.org; Sun, 06 Nov 2022 14:46:14 -0500 Original-Received: from mail-pj1-f47.google.com ([209.85.216.47]:52174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1orlar-00086s-3c for 59038@debbugs.gnu.org; Sun, 06 Nov 2022 14:46:13 -0500 Original-Received: by mail-pj1-f47.google.com with SMTP id o7so8758270pjj.1 for <59038@debbugs.gnu.org>; Sun, 06 Nov 2022 11:46:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=d6-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:reply-to :references:in-reply-to:message-id:date:cc:subject:to:from:from:to :cc:subject:date:message-id:reply-to; bh=yo/yk/O3mKTUmKVidS8pdOg9Nr3CMACQnwoOjiFXzog=; b=inFL7wQRZXviUN1UiUAQKig8r4S8ZIY13fO8JltSt2h2m80EhrtnuXw8A4MniTxEQs oy2xAVWQnt6zg7fjMooylXHuPAcX1Cjto3Fh0cA0II4jnYDg0mFuuGQh9+gCOb/c/WEm 3Jnc7ZMgAuYBtjqiS+OjRD92Ofl/HErjV195/ZpEKEj2mWFHIK7v70RdPtKKTNGBsthB 6fZq0solThaxPt62LCxZuP/jbbx3YIhY2xrHvh5F/y/NJV0e2p7z/vsTAQIY4++z+Prw AgWFIXecHaLGfe3TIviSgPgweyQtahokrsuZK1KawE0ebVIB4D0jWtRPhz9Sa4uMV0pC 53Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:reply-to :references:in-reply-to:message-id:date:cc:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yo/yk/O3mKTUmKVidS8pdOg9Nr3CMACQnwoOjiFXzog=; b=Kr/3Zcit5Cy+YMx3jETAjQTLjG2lUixvejIcKtUpC7tuSW0vg7Ev4W5fOb1bIiM+Vp f3zZR4EmCjWFMSLySfCFBl70L8S6mHt9MM8sITKkWdoml/MAHPUA6Zzt1HKNwwTAqtHS l0PmZPg9JYzQML9T3EP3yN+txIr90CZLWc/QB6ppzQ/R0ae1aeTJsbfsbSIc6sRbm4Q2 +rIndBojmpW9YdX9v9z3v3F9Ykzcfk37b0i4gdOzOoC4XcBKSX+diYe/y+b18sblc4hn 2Tx7aAjmfH31CfYOmfz6jDZRVy+DteRVWwwbv4OW9DC0Fx+rn11LpGAZ0wY0RJYqdSR3 RQLw== X-Gm-Message-State: ACrzQf1ZzhofJ1vst2NWD92zB7odPuSIurXp5YIv0E4lkygNOdSk0M7y //OTm3NUDsAxAqYBKdJtzw/O7Q== X-Google-Smtp-Source: AMsMyM7AEQc69DHA3m+qnXr1CcTU4EScoXlGAv/7nxWDyiO7Kf+WUQD3Q/KWsoaDMIO9SOO9Zp/wtw== X-Received: by 2002:a17:903:40d1:b0:17f:5778:888b with SMTP id t17-20020a17090340d100b0017f5778888bmr695497pld.119.1667763963009; Sun, 06 Nov 2022 11:46:03 -0800 (PST) Original-Received: from [192.168.1.153] (157-131-207-86.fiber.dynamic.sonic.net. [157.131.207.86]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001714c36a6e7sm3425653plf.284.2022.11.06.11.46.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Nov 2022 11:46:02 -0800 (PST) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247238 Archived-At: Yay! Go team! Thanks, Chris ------ Original Message ------ From: "Alan Mackenzie" To: "Eli Zaretskii" Cc: "Gregory Heytings" ; psainty@orcon.net.nz;=20 gerd.moellmann@gmail.com; 59038@debbugs.gnu.org; checker@d6.com Sent: 2022-11-06 08:34:57 Subject: Re: bug#59038: loading this base64 file makes emacs -Q 28.2 peg=20 a core infinitely >Hello, Eli. > >On Sun, Nov 06, 2022 at 15:52:33 +0200, Eli Zaretskii wrote: >> > Date: Sun, 06 Nov 2022 09:18:23 +0000 >> > From: Gregory Heytings >> > cc: Eli Zaretskii , >> > Gerd M=C3=B6llmann , >> > 59038@debbugs.gnu.org, checker@d6.com, acm@muc.de > > >> > >> That file opens just fine in other modes > >> > > It also opens fine in c-mode, with global-font-lock-mode disabled. > > >> > Indeed, obviously it's a c-mode font-locking related bug. > >> > >> Note that this bug has nothing to do with long lines. > >> > > I imagine that the font-lock issue is related to the line being in >> > > excess of 21,000 chars (but general redisplay obviously doesn't hav= e >> > > problems with lines this 'small'). > >> > > Reduced to 10,208 chars that file opens instantly under emacs -Q in >> > > c-mode with font-lock enabled; but at 10,209 chars it hangs Emacs (= I >> > > killed it after waiting 4 minutes). > > >> > Interesting, thanks for the bisection! > >> It's an infloop in c-brace-stack-at. > >> What happens is that c-brace-stack-at calls c-update-brace-stack with >> arguments: (nil 1) 8160 13160. c-update-brace-stack then calls >> c-syntactic-re-search-forward, which finds nothing interesting and >> returns with point at 13160, but then c-update-brace-stack calls >> c-beginning-of-current-token, which returns point back to 8160. And >> it goes on and on and on... > >Thanks for the debugging. > >> Alan, what can be done with this? > >This: > > >diff -r 53717eda724c cc-engine.el >--- a/cc-engine.el Sat Oct 29 09:42:47 2022 +0000 >+++ b/cc-engine.el Sun Nov 06 16:26:09 2022 +0000 >@@ -6177,9 +6177,10 @@ > (setq s (cdr s)))) > ((c-keyword-member kwd-sym 'c-flat-decl-block-kwds) > (push 0 s)))) >- ;; The failing `c-syntactic-re-search-forward' may have left us in= the >- ;; middle of a token, which might be a significant token. Fix this= ! >- (c-beginning-of-current-token) >+ (when (> prev-match-pos 1) ; Has the search matched at least o= nce? >+ ;; The failing `c-syntactic-re-search-forward' may have left us in the >+ ;; middle of a token, which might be a significant token. Fix this! >+ (c-beginning-of-current-token)) > (cons (point) > (cons bound-<> s))))) > > >-- >Alan Mackenzie (Nuremberg, Germany).