#31076 [Com]: schemaValidate crashing on empty xs:token

From: Date: Wed, 28 Sep 2005 14:11:41 +0000
Subject: #31076 [Com]: schemaValidate crashing on empty xs:token
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85719@lists.php.net to get a copy of this message
ID: 31076 Comment by: jean-pierre dot huart at brussels dot msf dot org Reported By: c dot d at earthlink dot net Status: No Feedback Bug Type: DOM XML related Operating System: Mac OS X 10.3.6 PHP Version: 5.0.2 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2004-12-21 07:41:23] sniper@php.net 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. ------------------------------------------------------------------------ [2004-12-14 10:35:43] chregu@php.net Please use a newer libxml2 library and see if it still hangs. ------------------------------------------------------------------------ [2004-12-14 10:34:01] 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:24:05] chregu@php.net 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 01:46:41] c dot d at earthlink dot net Description: ------------ 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"); $aDOM->load("file.xml"); $aDOM->schemaValidate("file.xsd"); XML File: <?xml version="1.0"?> <people> <person> <fname>John</fname> <mname/> <lname>Doe</lname> </person> </people> XSD File: <?xml version="1.0" encoding="ISO-8859-1"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="people"> <xs:complexType> <xs:sequence> <xs:element name="person" type="persontype" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="persontype"> <xs:sequence> <xs:element name="fname" type="xs:token"/> <xs:element name="mfname" type="xs:token"/> <xs:element name="lfname" type="xs:token"/> </xs:sequence> </xs:complexType> </xs:schema> Expected result: ---------------- schemaValidate should return true. Actual result: -------------- CPU races, server does not return content to browser. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31076&edit=1

« previous php.bugs (#85719) next »