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 409707 - xmllint doesn't report line numbers higher than 65535
xmllint doesn't report line numbers higher than 65535
Status: RESOLVED WONTFIX
Product: libxml2
Classification: Platform
Component: general
2.6.26
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-19 18:57 UTC by Joel Aufrecht
Modified: 2009-08-21 16:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Joel Aufrecht 2007-02-19 18:57:16 UTC
Please describe the problem:
When running xmllint to validate large xml files, all errors on lines after 65535 report back as errors on line 65535.

Steps to reproduce:
1. create an xsd which includes data validity and consistency requirements
2. Create an xml file > 65535 lines, which contains violates the xsd in lines after 65535
3. Validate the XML with the XSD:
  xmllint  --noout --schema XSDFILE XMLFILE


Actual results:
xmllint runs successfully and reports all errors in in the file, but all error messages after line 65535 report line 65535.

Expected results:
All error line numbers are accurately reported.

Does this happen every time?
Yes

Other information:
Looking at this bug: http://bugzilla.gnome.org/show_bug.cgi?id=143739

I see "lines got restricted to a short integer ... It wasn't clear that reporting the line number for very very large file would be useful anyway since editing such files manually is hazardous and they are usually generated and it's simpler to fix the problem in the generator than try to post process the instances."

I think this assumption is invalid.  In addition to using xmllint to prove that large XML files are valid according to their own schemas, line numbers are necessary to debug some possible errors.  If the error is caused by invalid data, then the data itself does show up in the error output, but the data string may or may not useful for searching in the source.  If the error is caused by missing data, then an error message that says that an X entity was missing a Y, without a line number, is not useful for debugging.

It's not clear to me from if the workarounds described in 143739 can be applied to xmllint or if this a permament loss of functionality - if so it's unfortunate, because it constrains the usefulness of xmllint.
Comment 1 Luke Plant 2007-07-12 12:34:40 UTC
This bug in xmlstarlet also seems to depend on the bug in libxml2:
http://sourceforge.net/tracker/index.php?func=detail&aid=1219072&group_id=66612&atid=515106

To add to the above comments, this bug is actually a real killer for me at the moment, especially as I cannot find an alternative XML validator that uses XSD.  I have an XML file that is generated via conversion from another XML file, but with validation errors in the output.  In order to fix my converter, I need to know exactly what the error is.  But I can't find out, because all I know is that it is on line > 65535, and the element that is causing it.  My output file has thousands of instances of that element, but most of them don't cause the error, so just searching for the element doesn't help me at all.

This bug: http://bugzilla.gnome.org/show_bug.cgi?id=143739 claims is closed, supposedly fixed as of 2.6.12, bug I'm using 2.6.27 and still seeing this. (Library packaged by Ubuntu, 2.6.27.dfsg-1ubuntu3)
Comment 2 Christian Schmidt 2007-09-02 10:22:33 UTC
Looks like a duplicate of bug 387550 (that was WONTFIXed).
Comment 3 Daniel Veillard 2007-10-12 09:14:52 UTC
See

http://mail.gnome.org/archives/xml/2007-October/msg00006.html
Comment 4 Starlight 2007-11-25 02:34:49 UTC
It's also a dup of bug 325533.  A simple user supplied
patch is included that fixes the problem nicely.