GNOME Bugzilla – Bug 554177
libxml2 tools hang on validation against certain RelaxNG schemas
Last modified: 2021-07-05 13:21:24 UTC
Please describe the problem: When I attempt to validate a TEI XML file against its schema, tools that use libxml2 will hang on the validation. This includes xmllint, and it includes the Perl XML::LibXML API. The file can be validated against the schema using other libraries, such as jing or rnv. The files in the example below are: tei_bare.rng: Bare-bones TEI schema from http://www.tei-c.org/ tei_bare_crit.rng: Bare-bones TEI schema + TEI textcrit module, generated from http://www.tei_c.org/Roma/ tei_bare_mod.rng: Same as tei_bare_crit.rng with the "rdgGrp" group removed; see diff below. Steps to reproduce: See commands below. Note where I terminated the process for the middle validation, against tei_crit.rng. Actual results: tla@minuscule:~/excerpt> for i in bare bare_crit bare_mod; do echo Using tei_$i.rng schema for validation; date; xmllint --noout --relaxng tools/tei_$i.rng baresample.xml; done; date Using tei_bare.rng schema for validation Sun Sep 28 14:28:50 BST 2008 baresample.xml validates Using tei_bare_crit.rng schema for validation Sun Sep 28 14:28:50 BST 2008 Terminated Using tei_bare_mod.rng schema for validation Sun Sep 28 14:29:22 BST 2008 baresample.xml validates Sun Sep 28 14:29:22 BST 2008 tla@minuscule:~/excerpt> xmllint --version xmllint: using libxml version 20631 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib Expected results: Correct validation for all three files. Does this happen every time? yes Other information: --- tools/tei_bare_crit.rng 2008-09-28 13:22:58.000000000 +0100 +++ tools/tei_bare_mod.rng 2008-09-28 14:28:11.000000000 +0100 @@ -1365,18 +1365,6 @@ </zeroOrMore> </optional> </group> - <group> - <ref name="rdgGrp"/> - <zeroOrMore> - <ref name="model.global"/> - </zeroOrMore> - <optional> - <ref name="wit"/> - <zeroOrMore> - <ref name="model.global"/> - </zeroOrMore> - </optional> - </group> </choice> </zeroOrMore> </group>
Created attachment 119529 [details] test case files Just realized I can attach files to the bug after all. This tarball contains the files necessary to run the command in my example.
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.