Bug 692671 - xsltproc doesn't report document errors through exit status
Summary: xsltproc doesn't report document errors through exit status
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: libxslt
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-31 19:45 UTC by Eric Blake
Modified: 2012-08-16 16:35 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-16 16:35:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
buggy xml document (used </vcpu> instead of the intended </code> on line 356) (86.17 KB, text/plain)
2011-03-31 19:47 UTC, Eric Blake
no flags Details
additional file used in reproduction example (660 bytes, text/plain)
2011-03-31 19:49 UTC, Eric Blake
no flags Details

Description Eric Blake 2011-03-31 19:45:54 UTC
Description of problem:
According to 'man xsltproc', the program should exit with status 6 if the input document had errors.  Yet I ran into a case where xsltproc complained to stderr about a problem in the document but still exited with status 0.

Version-Release number of selected component (if applicable):
libxslt-1.1.26-3.fc14.x86_64

How reproducible:
100%

Steps to Reproduce:
1. On the attached file (from libvirt.git commit v0.8.8-320-g6c9e89b):

$ /usr/bin/xsltproc --stringparam pagename $name --nonet --html     ../docs/site.xsl formatdomain.html.in > /dev/null

2. echo $?
  
Actual results:
formatdomain.html.in:356: HTML parser error : Unexpected end tag : vcpu
        required attributes, the attribute <code>vcpu</vcpu> specifies vcpu id,
0

Expected results:
If anything is printed to stderr, that represents a bug in the input document, and should be reflected as non-zero exit status (and according to the man page, I think status 6 is most appropriate for this particular error).

Additional info:

Comment 1 Eric Blake 2011-03-31 19:47:43 UTC
Created attachment 489210 [details]
buggy xml document (used </vcpu> instead of the intended </code> on line 356)

Comment 2 Eric Blake 2011-03-31 19:48:55 UTC
In the above example, I had done 'export name=formatdomain.html'; I'm also attaching the site.xml used to reproduce the problem.

Comment 3 Eric Blake 2011-03-31 19:49:52 UTC
Created attachment 489211 [details]
additional file used in reproduction example

Comment 4 Daniel Veillard 2011-04-01 02:53:49 UTC
paphio:~/libvirt/docs -> xsltproc --stringparam pagename page --html ../docs/site.xsl formatdomain.html.in > /dev/null
paphio:~/libvirt/docs -> echo $?
0
paphio:~/libvirt/docs -> xsltproc --stringparam pagename page ../docs/site.xsl formatdomain.html.in > /dev/null
[.... a bunch of errors to stderr ]
formatdomain.html.in:2337: parser error : Premature end of data in tag html line 1

^
unable to parse formatdomain.html.in
paphio:~/libvirt/docs -> echo $?
6
paphio:~/libvirt/docs -> 

  The "problem" is --html, it asks xsltproc to use the libxml2 HTML parser to
generate the input tree (instead of using the XML parser, XSLT is actually
not defined for HTML input, it's a libxslt/xsltproc extension).
  The libxml2 HTML parser has to be tolerant, there is no way around as
nearly no real deployed HTML is "well formed", and well the behaviour of
HTML parser in browsers are tolerant to the extreme hiding the fact.

  I'm not sure it's really a bug per see, we should augment the man page to
express the fact that when asking for HTML input parsing that those checks are
disabled, currently we just say:

       --html
           The input document is an HTML file.

Daniel

Comment 5 Fedora End Of Life 2012-08-16 16:35:19 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.