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

Some XML tests fail with latest libxml2 #812

Closed
jirutka opened this issue Oct 31, 2024 · 2 comments
Closed

Some XML tests fail with latest libxml2 #812

jirutka opened this issue Oct 31, 2024 · 2 comments
Assignees
Labels

Comments

@jirutka
Copy link
Contributor

jirutka commented Oct 31, 2024

Describe the bug

Two XML tests in njs_unit_test.c fail:

njs("const xml = require('xml');let data = `<note><to b="bar" a= "foo" >Tove</to><from>Jani</from></note>`;let doc = xml.parse(data);var doc2 = xml.parse(`<n0:pdu xmlns:n0="http://a"></n0:pdu>`);doc.note.$tags = [doc.note.to, doc2];(new TextDecoder).decode(xml.c14n(doc))")
expected: "<note xmlns:n0="http://a"><to a="foo" b="bar">Tove</to><n0:pdu></n0:pdu></note>"
     got: "<note></note>"
njs("const xml = require('xml');let data = `<note><to b="bar" a= "foo" >Tove</to><from>Jani</from></note>`;let doc = xml.parse(data);var doc2 = xml.parse(`<n0:pdu xmlns:n0="http://a"></n0:pdu>`);doc.note.$tags = [doc2, doc.note.to];(new TextDecoder).decode(xml.c14n(doc))")
expected: "<note xmlns:n0="http://a"><n0:pdu></n0:pdu><to a="foo" b="bar">Tove</to></note>"
     got: "<note></note>"
xml tests: FAILED [44/46]

It’s failing even on njs 0.8.4, so it’s most likely related to the latest libxml2 version (2.13.4).

To reproduce

apk add build-base libedit-dev libxml2-dev openssl-dev pcre-dev expect
./configure
make njs
make test

Expected behavior

All tests should pass.

Your environment

  • Version of njs: 0.8.7
  • libxml2 2.13.4
  • OS: Alpine Linux Edge (x86_64)
@jirutka jirutka added the bug label Oct 31, 2024
@thresheek
Copy link
Member

Can this be related to nginx/nginx#251 ?

@jirutka
Copy link
Contributor Author

jirutka commented Oct 31, 2024

I don’t think so, we have already applied the upstream patch https://gitlab.gnome.org/GNOME/libxml2/-/commit/efb57ddba3571928395644568444990e8ea831ea.

@xeioex xeioex self-assigned this Nov 1, 2024
xeioex added a commit to xeioex/njs that referenced this issue Nov 7, 2024
xeioex added a commit to xeioex/njs that referenced this issue Nov 7, 2024
@xeioex xeioex closed this as completed in 597b1fd Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants