Subject: bug#37231: 27.0.50; concurrent XML validation yields an invalid file

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 20 Sep 2019 20:53:05 +0200

Vincent Lefevre <[email-masked]> writes:

> Consider a big, valid XML file a.xml, e.g. using a vacuous schema, and
> copy it to b.xml (thus a.xml and b.xml are the same file, though they
> don't need to be identical for the test).
>
> Open the files at the same time with: emacs -Q a.xml b.xml
>
> Then one of them is regarded as invalid.

I can confirm that this bugs out.

I know nothing about the nxml code, but I did notice that about half of
the rng variables are defined thusly:

(defvar rng-validate-up-to-date-end nil
  "Last position where validation is known to be up to date.")
(make-variable-buffer-local 'rng-validate-up-to-date-end)

But the ones that it reports as failing here depends on variables like
`rng-pending-contents', which are not buffer-local.  So to test blindly,
I made that also buffer-local...  and then the entire process failed
with a backtrace, so that's not the solution.  :-)

But I do think it's really suspicious that some of those variables are
buffer-local while others aren't.  Perhaps somebody who knows how that
machinery works could have a peek at it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no