From: php at koteroff dot ru
Operating system: Windows XP
PHP version: 5.0.0RC3
PHP Bug Type: Reproducible crash
Bug description: Double arrow ($this->a->b), foreach and debug_backtrace() conflict
Description:
------------
I have spent about 3 hours (!) trying to localize this crash and write
simple script to reproduce it - but vainly. :-(
So, I write something that I have. The following code:
function reloadPlugins() {
#$s =& $this->smarty;
$this->smarty->plugins_dir1 = array(1,2,3);
foreach ($this->smarty->plugins_dir1 as $dir) {}
debug_backtrace();
return;
// ..
}
reproducibly crashes PHP (General Protection Fault).
* If I simply uncomment the first line (no more changes!), crash
dissapears, all works.
* When I use
$s = $this->smarty;
foreach ($s->plugins_dir1 ...)
it also works.
* When I substitute Smarty with my own stub class (empty), it also works.
* When I completely delete empty forech, all work fine.
* And, of course, if I delete debug_backtrace() call, it works.
* PHP5 RC2 also works.
I don't know what is it, and I don't know how to catch it. But it exists.
Sorry.
--
Edit bug report at http://bugs.php.net/?id=29040&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29040&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29040&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=29040&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29040&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29040&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29040&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29040&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29040&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29040&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29040&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29040&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29040&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29040&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29040&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29040&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29040&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29040&r=float