From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language Date: Fri, 20 Aug 2021 10:48:04 +0000 Message-ID: References: <93sfzblie4.fsf@fencepost.gnu.org> <874kbrr4cq.fsf@gnus.org> <87sfz9fx0y.fsf@gnus.org> <87bl5vhng9.fsf@tcd.ie> <87sfz7fwlv.fsf@tcd.ie> <87k0kiguif.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Glenn Morris , Lars Ingebrigtsen , emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 20 12:49:38 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mH25h-0007Bq-W5 for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 12:49:37 +0200 Original-Received: from localhost ([::1]:37828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mH25g-0000O6-Jq for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Aug 2021 06:49:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mH24V-0006zo-3M for emacs-devel@gnu.org; Fri, 20 Aug 2021 06:48:23 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:52319 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1mH24T-0003lO-DB for emacs-devel@gnu.org; Fri, 20 Aug 2021 06:48:22 -0400 Original-Received: (qmail 27152 invoked by uid 3782); 20 Aug 2021 10:48:05 -0000 Original-Received: from acm.muc.de (p4fe156d5.dip0.t-ipconnect.de [79.225.86.213]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 20 Aug 2021 12:48:05 +0200 Original-Received: (qmail 5268 invoked by uid 1000); 20 Aug 2021 10:48:04 -0000 Content-Disposition: inline In-Reply-To: <87k0kiguif.fsf@tcd.ie> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272707 Archived-At: Hello, Basil. On Thu, Aug 19, 2021 at 01:15:04 +0100, Basil L. Contovounesios wrote: [ .... ] > Tonight, I tried the following approach instead (in an unedited source > tree): > 0. C-x p c make TEST_LOAD_EL=no test/electric-tests RET > 1. M-! pkill -SIGUSR2 -f ert-run-tests RET > I repeated this a few times, and the *emacs-compilation* buffer reliably > contained the same backtrace: > --8<---------------cut here---------------start------------->8--- > Test electric-layout-plainer-c-mode-use-c-style backtrace: > c-tnt-chng-cleanup(nil [(nil . t) # #f(compiled-function () #)() > c-point-syntax() > electric-layout-for-c-style-du-jour(123) > electric-layout-post-self-insert-function-1() > electric-layout-post-self-insert-function() > self-insert-command(1 123) > funcall-interactively(self-insert-command 1 123) > call-interactively(self-insert-command) > #f(compiled-function () #)() > ert--call-with-test-buffer(nil #f(compiled-function () # #f(compiled-function () #)() > ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test > ert-run-test(#s(ert-test :name electric-layout-plainer-c-mode-use-c- > ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m > ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil > ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp)))) > ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco > eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n > command-line-1(("-L" ":." "-L" "./../../elpa/packages/url-http-ntlm/ > command-line() > normal-top-level() > Test electric-layout-plainer-c-mode-use-c-style condition: > Buffer: *Test buffer (electric-layout-plainer-c-mode-use-c-style)* > (quit) > QUIT 5/478 electric-layout-plainer-c-mode-use-c-style (54.497779 sec) > --8<---------------cut here---------------end--------------->8--- > Sprinkling some prints in c-tnt-chng-cleanup revealed that the following > loop never terminates: > (let ((undo-in-progress t)) > (while (not (eq (setq buffer-undo-list > (primitive-undo 1 buffer-undo-list)) > saved-undo-list)))) > HTH, That helps a great deal, thanks! The problem is a bug in c-point-syntax. There, there is (i) an invocation of c-save-buffer-state, which binds buffer-undo-list to t, followed by (ii) an invocation of c-tentative-buffer-changes, which pushes nil onto buffer-undo-list (simulating an undo group) giving (nil t). (iii) A { is typed into the buffer, giving buffer-undo-list now as something like ((5128 . 5129) nil t). At this point garbage collection occurs. This strips the tail of buffer-undo-list, leaving ((5128 . 5129)). (iv) In c-tnt-chng-cleanup, primitive-undo is repeated infinitely, since buffer-undo-list will never become the expected value (nil t). The problem would appear to be the invalid value ((5128 . 5129) nil t) in buffer-undo-list. I'll see what I can do about this tonight. > -- > Basil -- Alan Mackenzie (Nuremberg, Germany).