After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 321068 - libxml2 rng validation incorrectly handles 'start' overrides in 'include'
libxml2 rng validation incorrectly handles 'start' overrides in 'include'
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: relaxng
2.6.22
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-09 15:14 UTC by Karl Eichwalder
Modified: 2021-07-05 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (rng) (934 bytes, application/x-compressed-tar)
2005-11-09 15:16 UTC, Karl Eichwalder
Details

Description Karl Eichwalder 2005-11-09 15:14:41 UTC
I received the following report by Martin Vidner <mvidner-at-suse de> as
https://bugzilla.novell.com/show_bug.cgi?id=132722 and I'm able to reproduce it
with libxml2-2.6.22.  Here I repeat Martin's text literally:

The attached set of Relax NG schemas fails to compile in xmllint. Another
validator, jing, has no such problem. (I test on a null document for
simplicity).

mvidner@valkyrie:bad2$ xmllint --noout --relaxng suse-primary.rng /dev/null
suse-primary.rng:3: element include: Relax-NG parser error : xmlRelaxNG:
include primary.rng has a start but not the included grammar
suse-primary.rng:5: element ref: Relax-NG parser error : Some <start> element
miss the combine attribute
primary.rng:6: element ref: Relax-NG parser error : Found forbidden pattern
start//interleave
Relax-NG schema suse-primary.rng failed to compile
/dev/null:1: parser error : Document is empty

^
/dev/null:1: parser error : Start tag expected, '<' not found

^
mvidner@valkyrie:bad2$ jing suse-primary.rng /dev/null
/dev/null:1: fatal: Document root element is missing.

Here are 3 rnc files and 3 rng equivalents generated by "trang suse-primary.rnc
suse-primary.rng".
Note that in the inclusion chain (suse-primary .. primary .. rpm-ns) the start
element is overriden each time. If the override is commented out in
suse-primary, libxml2 accepts the schema.
(The override is actually useless here but not in the original files that were
simplified for this testcase)

From the error messages I infer that libxml2 wrongly applies the "combine"
method, instead of replacing the definitions entirely as required when doing an
include. (See 9.4 Replacing definitions in the RNC Tutorial,
http://relaxng.org/compact-tutorial-20030326.html#id2815849)
Comment 1 Karl Eichwalder 2005-11-09 15:16:04 UTC
Created attachment 54537 [details]
test case (rng)
Comment 2 Karl Eichwalder 2006-01-12 09:03:44 UTC
Still the same with 2.6.23 (this version string is missing in the "Version:" list).
Comment 3 Pavol Rusnak 2007-01-25 16:12:07 UTC
Still the same with 2.6.27
Comment 4 Pavol Rusnak 2007-12-11 16:08:56 UTC
Still the same with 2.6.30
Comment 5 Nick Wellnhofer 2019-01-30 11:00:32 UTC
Probably fixed by one of Nikolai Weibull's commits in 2.9.9:

https://gitlab.gnome.org/GNOME/libxml2/commit/4338c310eb5e9402d0d4bf1cdf6d60430ac8a9a8

Now I get:

$ xmllint --noout --relaxng suse-primary.rng /dev/null
/dev/null:1: parser error : Document is empty

^
Comment 6 GNOME Infrastructure Team 2021-07-05 13:21:08 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.