From:             troelskn at gmail dot com
Operating system: FreeBSD 7.0-RELEASE-p5
PHP version:      5.2.6
PHP Bug Type:     SPL related
Bug description:  Possible memory-leak. autoload not always called

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    
[EMAIL PROTECTED]:/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 bug report at http://bugs.php.net/?id=46344&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46344&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46344&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46344&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46344&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46344&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46344&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46344&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46344&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46344&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46344&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46344&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46344&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46344&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46344&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46344&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46344&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46344&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46344&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46344&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46344&r=mysqlcfg

Reply via email to