|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62190 Couldn't fetch DOMProcessingInstruction�� with APC and native obj (DOMDocume
Submitted: 2012-05-30 12:09 UTC Modified: 2012-07-20 21:31 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: cschneid at cschneid dot com Assigned: rasmus (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.4.4RC1 OS: *
Private report: No CVE-ID: None
 [2012-05-30 12:09 UTC] cschneid at cschneid dot com
Problem with APC (tested 3.1.10 and trunk) with native object, in this case DOMDocument.

I suspect this is related to the bugs
but I'm not sure how to check this and those bugs have not been assigned to anyone yet.

Any hint on how to help debugging this is welcome, I'm stuck here.

Test script:
$node = new DOMDocument;
echo $node->firstChild->nextSibling->nodeType;

Expected result:

Actual result:
Warning: Couldn't fetch DOMProcessingInstruction��{. Node no longer exists in /www/ on line 5


patch-apc-interned_string.patch (last revision 2012-05-31 17:29 UTC by cschneid at cschneid dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-31 13:43 UTC] cschneid at cschneid dot com
Some progress: I tracked down the problem into apc_interned_strings_init, if I disabled the overloading of the zend interned_strings_* functions then the problem does not show up.

If anyone knows more about interned strings feel free to contact me :-)
 [2012-05-31 14:44 UTC] cschneid at cschneid dot com
Hmm, the apc_interned_strings_init relation could be a side-effect of some memory trashing as I couldn't find a problem with it yet and even though the little test script runs with disabled apc_interned_strings_init the server will crash on bigger scripts because of the missing initialization
 [2012-05-31 17:31 UTC] cschneid at cschneid dot com
The problem is that APC does not null-terminate the internalized strings while Zend seems to ensure null-termination.
The DOM extension (wrongly?) relies on the null-termination with class names (strcmp etc.) and thus triggers the problem.
I added a patch which makes sure internalized strings are again null-terminated.
 [2012-06-11 04:02 UTC]
The null-string patch has been applied, so this can be closed now.
 [2012-06-11 04:02 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: rasmus
 [2012-06-29 17:14 UTC]
-Status: Closed +Status: Re-Opened
 [2012-06-29 17:14 UTC]
I think we are still missing a case where interned strings are not being null-
terminated. See bug #62442
 [2012-07-20 18:54 UTC]
Automatic comment from SVN on behalf of ab
Log: added test for bug #62190
 [2012-07-20 21:31 UTC]
-Status: Re-Opened +Status: Closed
 [2012-07-20 21:31 UTC]
A test for this issue was supplied, this should be fixed with APC 3.1.11 now.
 [2013-04-04 01:02 UTC] mi+php at aldan dot algebra dot com
This test is among the few, that fail, when building against php-5.4.13 (RHEL-5.7, 64-bit):

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: Mon Apr 22 14:01:31 2024 UTC