|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31076 schemaValidate crashing on empty xs:token
Submitted: 2004-12-14 01:46 UTC Modified: 2004-12-21 07:41 UTC
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: c dot d at earthlink dot net Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.0.2 OS: Mac OS X 10.3.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: c dot d at earthlink dot net
New email:
PHP Version: OS:


 [2004-12-14 01:46 UTC] c dot d at earthlink dot net
When an XML file has an empty element defined as xs:token in XSD, and it is loaded into a DOMDocument and then schemaValidate is called, the server CPU begins to race and content is never returned to browser.

The W3C definition of xs:token does not prohibit empty xs:token elements.  

Reproduce code:
$aDOM = new DOMDocument("1.0");

XML File:

<?xml version="1.0"?>

XSD File:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="">

<xs:element name="people">
             <xs:element name="person" type="persontype" minOccurs="0" maxOccurs="unbounded"/>

<xs:complexType name="persontype">
         <xs:element name="fname" type="xs:token"/>
         <xs:element name="mfname" type="xs:token"/>
         <xs:element name="lfname" type="xs:token"/>


Expected result:
schemaValidate should return true.

Actual result:
CPU races, server does not return content to browser.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-14 10:24 UTC]
Works for me, except that it doesn't validate...

Which libxml2 version are you using?

The XML Schema parser in libxml2 isn't complete yet, but it is recommended to use one of the latest libxml2 releases, as the XML Schema implementation got some big improvements lately 
 [2004-12-14 10:34 UTC] c dot d at earthlink dot net
Further Information:

My libxml version: 2.6.7
My DOM/XML API version :20031129
 [2004-12-14 10:35 UTC]
Please use a newer libxml2 library and see if it still hangs.
 [2004-12-21 07:41 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

 [2005-09-28 16:11 UTC] jean-pierre dot huart at brussels dot msf dot org
This is not solved in Version 5.0.5 with libxml2 version 2.6.11 on apache http server 2.0.54 on windows 2000.

The bugs happens also when declaring an xs:boolean type in XSD, but not with xs:string, xs:long, xs:date.

Actual result:
Application error
"the instruction at "0x0070dcc3" referenced memory at 0x00000000. The memory could not be "read".

I hope that this bug will be re-opened.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 28 06:01:26 2024 UTC