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 302302 - XMLReader API with XInclude crash
XMLReader API with XInclude crash
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.19
Other All
: High critical
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-28 15:03 UTC by Ken Bass
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ken Bass 2005-04-28 15:03:38 UTC
Steps to reproduce:
1. Create three xml files as below:

2. 1st file (toplvl.xml) is

<?xml version="1.0"?>
<outer>
  <elem1 xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="valid_inc.xml" />
  </elem1>
  <elem2 xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="invalid_inc.xml" />
  </elem2>
  <elem3 xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include href="valid_inc.xml" />
  </elem3>
</outer>

3. Second file (valid_inc.xml) is simply:

  <a>
    <b>
      <c>1</c>
    </b>
  </a>

4) The third file (invalid_inc.xml) is simply:
 <k>
    <lll>             
      hello
     </oops>
  </k>

5) Run xmllint --stream --xinclude toplvl.xml

6) On my system, I get a core file.

Stack trace:

Thread 1075222080 (LWP 16432)

  • #0 xmlGetNsProp
    at tree.c line 6163
  • #1 xmlXIncludeGetProp
    at xinclude.c line 172
  • #2 xmlXIncludeLoadNode
    at xinclude.c line 1940
  • #3 xmlXIncludeDoProcess
    at xinclude.c line 2310
  • #4 xmlXIncludeProcessNode
    at xinclude.c line 2463
  • #5 xmlTextReaderRead
    at xmlreader.c line 1452
  • #6 streamFile
    at xmllint.c line 976
  • #7 main
    at xmllint.c line 2405
  • #8 __libc_start_main
    from /lib/tls/libc.so.6


Other information:
Comment 1 Ken Bass 2005-04-28 16:42:26 UTC
Additional problem with this test case:

Prior to the seg fault, the following is reported:

toplvl.xml:3: element elem1: XInclude error : failed build URL

Even if I modify invalid_inc.xml to be valid, the first line 'XInclude error :
failed build URL' error remains. These are local files, relative to the current
directory. 
Comment 2 Daniel Veillard 2005-08-10 13:40:26 UTC
Okay I understood the problem, the fix is rather simple actually, and
commited in CVS,

  thanks a lot for the report !

Daniel
Comment 3 Daniel Veillard 2005-09-05 09:01:44 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel