From: Alan Mackenzie <acm@muc.de>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: Glenn Morris <rgm@gnu.org>, Lars Ingebrigtsen <larsi@gnus.org>,
emacs-devel@gnu.org
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 [thread overview]
Message-ID: <YR+IZEivSHghSb4n@ACM> (raw)
In-Reply-To: <87k0kiguif.fsf@tcd.ie>
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) #<buffer *Test buffer (electric-la
> #f(compiled-function () #<bytecode 0x1ce6cae08acf>)()
> 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 () #<bytecode -0x8b013aec04deab5>)()
> ert--call-with-test-buffer(nil #f(compiled-function () #<bytecode -0
> #f(compiled-function () #<bytecode -0x10479e86da51cfc>)()
> 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).
next prev parent reply other threads:[~2021-08-20 10:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210812190845.13266.82536@vcs0.savannah.gnu.org>
[not found] ` <20210812190847.E372A20997@vcs0.savannah.gnu.org>
2021-08-13 14:20 ` master c4d34d2: CC Mode: Enhance C++ Mode raw strings to multi-line strings for any language Lars Ingebrigtsen
2021-08-13 19:52 ` Alan Mackenzie
2021-08-14 11:53 ` Lars Ingebrigtsen
2021-08-14 14:53 ` Alan Mackenzie
2021-08-14 19:30 ` Lars Ingebrigtsen
2021-08-14 23:24 ` Glenn Morris
2021-08-14 23:31 ` Lars Ingebrigtsen
2021-08-15 6:12 ` Eli Zaretskii
2021-08-15 15:23 ` Alan Mackenzie
2021-08-16 11:29 ` Lars Ingebrigtsen
2021-08-17 19:37 ` Basil L. Contovounesios
2021-08-18 0:02 ` Basil L. Contovounesios
2021-08-18 14:48 ` Lars Ingebrigtsen
2021-08-18 17:07 ` Basil L. Contovounesios
2021-08-18 17:37 ` Alan Mackenzie
2021-08-18 19:20 ` Alan Mackenzie
2021-08-18 20:47 ` Alan Mackenzie
2021-08-19 0:15 ` Basil L. Contovounesios
2021-08-20 10:48 ` Alan Mackenzie [this message]
2021-08-20 21:20 ` Alan Mackenzie
2021-08-20 22:43 ` Basil L. Contovounesios
2021-08-21 9:55 ` Alan Mackenzie
2021-08-21 7:15 ` Eli Zaretskii
2021-08-21 10:00 ` Alan Mackenzie
2021-08-21 10:04 ` Eli Zaretskii
2021-08-19 0:13 ` Basil L. Contovounesios
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YR+IZEivSHghSb4n@ACM \
--to=acm@muc.de \
--cc=contovob@tcd.ie \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).