#46344 [Opn->Fbk]: Possible memory-leak. autoload not always called
ID: 46344
Updated by: colder@php.net
Reported By: troelskn at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: SPL related
Operating System: FreeBSD 7.0-RELEASE-p5
PHP Version: 5.2.6
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Could you please reduce the reproduce script as short as possible ?
Also, try without suhosin and see if you can still reproduce it.
Previous Comments:
------------------------------------------------------------------------
[2008-10-20 11:40:47] troelskn at gmail dot com
Description:
------------
After upgrading to a new server, we started seeing very inexplicable
bugs in the system. I *think* I traced it down to the autoload
functionality. In some situations, the autoloader doesn't seem to be
triggered. Reproducing the bug is extremely hard; If I alter the code of
the classloader, the error goes away. Also, I can't reproduce it on
other systems.
I am not sure if this is a problem with SPL, with PHP or perhaps with
PDO, but my guess is that spl_autoload_register somehow allocates memory
for the callback wrongly, allowing other code to overwrite it.
Full system details follows:
$ php --version
PHP 5.2.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 29 2008
10:03:19)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
$ uname -a
FreeBSD xxx.xxx.dk 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #0: Wed Oct 1
07:51:58 UTC 2008
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
Reproduce code:
---------------
http://pastebin.com/f4625a564
In addition, you need a file datadictionary.php, containing:
class DataDictionary {}
Expected result:
----------------
OK .. class has loaded
Actual result:
--------------
PHP Fatal error: Class 'DataDictionary' not found in
/usr/home/tkn/test.php on line 89
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46344&edit=1
Thread (4 messages)