php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61912 Memory corruption in ext/dom with APC 3.1.10
Submitted: 2012-05-02 21:09 UTC Modified: 2012-06-11 04:02 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: mail at thomasbachem dot com Assigned: rasmus (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.4.1 OS: Mac OS X 10.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mail at thomasbachem dot com
New email:
PHP Version: OS:

 

 [2012-05-02 21:09 UTC] mail at thomasbachem dot com
Description:
------------
Using a DOMNameSpaceNode in PHP 5.4 with APC 3.1.10 enabled leads to the described 
result. Disabling APC resolves the issue.

Test script:
---------------
<?php

$doc = new DOMDocument();
$doc->loadXML('<?xml version="1.0" encoding="UTF-8"?><root/>');

$xpath = new DOMXPath($doc);
$namespaces = $xpath->query('namespace::*');

var_dump($namespaces->item(0));
print $namespaces->item(0)->localName;

?>

Expected result:
----------------
object(DOMNameSpaceNode)[3]
xml

Actual result:
--------------
object(DOMNameSpaceNodex_^TŒ-Ÿë)[3]
PHP Notice: Undefined property: DOMNameSpaceNodex_^T\x8c-\x9f\xeb\x14::$localName

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-09 15:49 UTC] cschneid at cschneid dot com
Probably the same error:
  $node = new DOMDocument;
  $node->loadHTML('<?foo>');
  echo $node->firstChild->nextSibling->nodeType;
results in
  E_WARNING: Couldn't fetch DOMProcessingInstruction��{. Node no longer exists
instead of the value 7 which is output if I set apc.enabled=0
 [2012-06-01 07:52 UTC] cschneid at cschneid dot com
Try the patch at https://bugs.php.net/bug.php?id=62190 and see if it helps
 [2012-06-01 12:38 UTC] mail at thomasbachem dot com
The patch seems to work well!
 [2012-06-11 04:02 UTC] rasmus@php.net
This is fixed in SVN.
 [2012-06-11 04:02 UTC] rasmus@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: rasmus
 [2012-11-24 17:44 UTC] sfedder at hotmail dot com
I still have this problem occuring during make test on install of current version 
APC 3.1.13 under php 5.4.8 - below patch appears to be in place in this version 
which is after 3.1.10 which supposedly solved the problem, but the bug still 
appears to fail in the tests.  FAIL APC: Bug #61912 Memory corruption in ext/dom 
(php 5.4) [tests/apc54_008.phpt]
 [2013-04-04 01:05 UTC] mi+php at aldan dot algebra dot com
I also see the test-failure on RHEL-5.7, building APC-3.1.13 against php-5.4.13 (php-5.3.21 is clean):

FAILED TEST SUMMARY
---------------------------------------------------------------------
APC: Bug #62190 Couldn't fetch DOMProcessingInstruction with APC and native obj (php 5.4 nts) [tests/apc54_003.phpt]
APC: Bug #62456 Incorrect description of notice variation 1 (php 5.4 nts) [tests/apc54_004.phpt]
APC: Bug #61912 Memory corruption in ext/dom (php 5.4) [tests/apc54_008.phpt]
APC: Bug #61824 apc produces strange notice (php 5.4) [tests/apc54_009.phpt]
APC: Bug #59938 APCIterator fails with large user cache [tests/apc54_018.phpt]
Trying to exclude trait method multiple times (origin Zend/tests/traits/error_010.phpt) [tests/apc54_error_010.phpt]
Exclude trait method [tests/apc54_error_010_2.phpt]
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 08:01:30 2024 UTC