Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ill formed XML #237

Open
Matafou opened this issue Mar 2, 2018 · 6 comments
Open

ill formed XML #237

Matafou opened this issue Mar 2, 2018 · 6 comments
Labels
pg: async Related to (unmaintained) async PG with asynchronous Coq proofs

Comments

@Matafou
Copy link
Contributor

Matafou commented Mar 2, 2018

Hi,
When using pg/xml on a large file I get a "ill formed xml" message, see attached file. Sorry I did not manage to minimize the example yet. I will try.
P.

illformedXML.txt

@Matafou
Copy link
Contributor Author

Matafou commented Mar 3, 2018

@psteckler can you just see what part of the xml is wrong please?

@psteckler
Copy link
Collaborator

I could not find an error in the text. Emacs nXML mode does not report an error. Also, I used the XML validator at https://www.w3schools.com/xml/xml_validator.asp, and it reports no errors.

It is possible that the error message was caused by some other issue, which I'll have to investigate.

@erikmd erikmd added the pg: async Related to (unmaintained) async PG with asynchronous Coq proofs label Mar 3, 2018
@psteckler
Copy link
Collaborator

I ran the Elisp/libxml parser on that string and it successfully created an S-exp. In fact, I called the function I wrote that wraps the parser, which deletes the contents of the buffer if the parse is successful. After parsing, I verified that the buffer size is 0.

That message box is guarded by a check for a nonempty buffer. So I don't understand why that message box appears.

Is the problem reproducible?

@psteckler
Copy link
Collaborator

Maybe there's a race condition:

  • there's a successful parse
  • data fills the buffer before the next parse

@psteckler
Copy link
Collaborator

Working on a fix for that possibility.

@psteckler
Copy link
Collaborator

psteckler commented Mar 5, 2018

Actually, it's not clear to me why a race might happen, because

  • after the XML is parsed, the buffer is erased, which prevents the "ill-formed" message from appearing
  • the buffer is filled by code called from the filter function, which cannot be called until Emacs is waiting
  • so the code that parses the XML cannot be called again while it is pending

In any case, I created #341, which uses temp buffers for XML parsing, instead of a dedicated buffer, if in fact the buffer gets additional data, somehow. If the issue can be reproduced, we can see if this fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pg: async Related to (unmaintained) async PG with asynchronous Coq proofs
Projects
None yet
Development

No branches or pull requests

3 participants