php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37435 dom->schemaValidate crashes when xml contains tags with multiple CDATA sections
Submitted: 2006-05-14 12:24 UTC Modified: 2006-05-15 07:39 UTC
From: spamhere at chello dot nl Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.1.4 OS: win xp/2000/2003
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: spamhere at chello dot nl
New email:
PHP Version: OS:

 

 [2006-05-14 12:24 UTC] spamhere at chello dot nl
Description:
------------
Validating an xml file containing tags with multiple CDATA sections 'crashes' Apache. (see Actual Result)
schemaValidateSource causes the same unexpected result.

Workaround is available, but consequences have not been thouroughly investigated:
use $dom->load($xmlfile, LIBXML_NOCDATA);
instead of $dom->load($xmlfile);

System configuration: (but reproducible on all kinds of Windows configurations: 2000 / 2003)
Windows XP Version 2002 SP2
PHP 5.1.4 (and PHP 5.1.3 and 5.1.0)
Apache 2.0.55 (but also on 2.0.54 and 2.0.53 with or without SSL)
With or without php_oci.dll enabled


Reproduce code:
---------------
php script:
<?php
 $dom = new DomDocument();
 if ($dom->load($xmlfile))
 {
   if ($dom->schemaValidate($schemafile))
   {
   	echo 'valid';
   } else {
   	echo 'invalid';
   }
 }
?>

xml:
<?xml version="1.0" encoding="windows-1252"?>
<x:checklist xmlns:x="urn:checklists">
  <bevinding><![CDATA[cdata section 1]]>hello<![CDATA[cdata section 2]]></bevinding>
</x:checklist>

xsd (schema):
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:v="urn:checklists" targetNamespace="urn:checklists">
  <element name="checklist" type="v:CheckListData">
  </element>
  <complexType name="CheckListData">
  	<all>
    	<element name="bevinding" type="string" minOccurs="1" maxOccurs="1"/>
  	</all>
  </complexType>
</schema>


Expected result:
----------------
schemaValidate boolean result
or
schemaValidateSource boolean result

Actual result:
--------------
Apache crashing:
[Sun May 14 14:02:34 2006] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Sun May 14 14:02:34 2006] [notice] Apache/2.0.55 (Win32) PHP/5.1.4 configured -- resuming normal operations
[Sun May 14 14:02:34 2006] [notice] Server built: Oct  9 2005 19:16:56
[Sun May 14 14:02:34 2006] [notice] Parent: Created child process 3512
[Sun May 14 14:02:34 2006] [notice] Child 3512: Child process is running
[Sun May 14 14:02:34 2006] [notice] Child 3512: Acquired the start mutex.
[Sun May 14 14:02:34 2006] [notice] Child 3512: Starting 25 worker threads.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-14 12:53 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Not reproducible here.
 [2006-05-14 20:25 UTC] spamhere at chello dot nl
With php 5.2 dev and Apache 2.2 the error still occurs.
Bug shows itself on seven different Windows/PHP/Apache configurations: (XP/5.1.4/2.0.54) (XP-SP2/5.1.0/2.0.54) (XP-SP2/5.1.3/2.0.54) (XP-SP2/5.2dev/2.2) (2000-SP4/5.1.3/2.0.53) (2003/5.1.0/2.0.53) (2003/5.1.3/2.0.53)
It's clearly a bug in the libxml module, but I have no access to MSVC therefore I am unable to produce a backtrace.
 [2006-05-15 07:39 UTC] chregu@php.net
Not a PHP bug, please try the latest libxml2 release and if the problem persists, report it there.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 10:01:31 2024 UTC