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 753997 - "Detected an entity reference loop" with DITA 1.3 DTDs
"Detected an entity reference loop" with DITA 1.3 DTDs
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
git master
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on: 784159
Blocks:
 
 
Reported: 2015-08-23 21:41 UTC by Eero Helenius
Modified: 2021-07-05 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
An unremarkable DITA XML file (226 bytes, text/html)
2015-08-23 21:41 UTC, Eero Helenius
Details

Description Eero Helenius 2015-08-23 21:41:52 UTC
Created attachment 309896 [details]
An unremarkable DITA XML file

Validating the attached XML document against the DITA 1.3 DTDs[1] with xmllint causes the "Detected an entity reference loop" error to be thrown:

-----

$ xmllint --dtdvalid dita-v1.3-csprd01-part3-all-inclusive-grammars/dtd/technicalContent/dtd/topic.dtd topic1.dita
/etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:36: parser error : Detected an entity reference loop
                                    #IMPLIED"
                                             ^
/etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:39: parser warning : PEReference: %svg-container.attributes; not found
<!ATTLIST  svg-container %svg-container.attributes;>
                                                   ^
/etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:61: parser warning : PEReference: %svgref.content; not found
<!ELEMENT  svgref %svgref.content;>
                                  ^
/etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:61: parser error : xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected
<!ELEMENT  svgref %svgref.content;>
                                  ^
/etc/xml/common/schemas/dita/dita-1.3/dtd/technicalContent/dtd/svgDomain.mod:61: parser error : Content error in the external subset
<!ELEMENT  svgref %svgref.content;>

-----

Removing some unknown amount of insignificant whitespace (for example, removing all indentation) from dita-v1.3-csprd01-part3-all-inclusive-grammars/dtd/base/dtd/commonElements.mod "fixes" the "error".
 
[1] http://docs.oasis-open.org/dita/dita/v1.3/csprd01/part3-all-inclusive/dita-v1.3-csprd01-part3-all-inclusive-grammars.zip
Comment 1 Eero Helenius 2015-08-23 22:07:24 UTC
This seems to be a regression in 2.9.2 — it works on 2.9.1.
Comment 2 James Bostock 2017-12-02 23:55:29 UTC
Having recently run into this same problem, I used "git bisect" to find the commit that introduced the change in behavior: be2a7edaf289c5da74a4f9ed3a0b6c733e775230 (Fix for CVE-2014-3660).

DITA, by its nature, relies more heavily on entity expansion that other XML vocabularies and so triggers libxml2's protection against exponential entity expansion. Maybe the parameters of this check can be tweaked to allow DITA 1.3 documents to be validated? In the meantime, passing the --huge option to xmllint disables the check (and works for me).
Comment 3 GNOME Infrastructure Team 2021-07-05 13:23:50 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.