php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31829 Schema Validation Infinite Loop
Submitted: 2005-02-03 16:02 UTC Modified: 2005-02-21 19:56 UTC
From: lphuberdeau at phpquebec dot org Assigned:
Status: No Feedback Package: *XML functions
PHP Version: 5.0.3 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
46 - 33 = ?
Subscribe to this entry?

 
 [2005-02-03 16:02 UTC] lphuberdeau at phpquebec dot org
Description:
------------
When validating an XML document using a schema with references to other schemas, the validation falls in a loop until the script dies due to insufficient memory. Seems like there is no check to verify if the file has already been included. This bug might actually be located in libxml2.

I was able to avoid the problem by only placing includes in the primary XSD.

Reproduce code:
---------------
Validate a DOM tree with a schema (schema1.xsd) with the following structure:

schema1.xsd:
include schema2.xsd
include schema3.xsd

schema2.xsd:
include schema3.xsd

schema3.xsd:
include schema2.xsd

Expected result:
----------------
The file to validate, ignoring any already included files, or at least throw an exception.

Actual result:
--------------
Using PHP-CLI, the system goes in an infinite loop and uses all available system memory. I would suspect the script to crash in a web environment with a memory limit.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-03 19:12 UTC] chregu@php.net
Most certainly a libxml2 bug. PHP has nothing to do with the actual parsing and validation.

Can you check with xmllint, if that has the same problem? And update to the latest libxml2 libraries, they were quite some fixes lately regarding XSDs.



 [2005-02-21 19:56 UTC] 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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC