Re: Possible bug in Zend (zend_function_entry)
| From: | Uwe Steinmann | Date: | Wed, 02 Feb 2000 12:46:15 +0000 |
| Subject: | Re: Possible bug in Zend (zend_function_entry) | ||
| References: | 1 2 3 4 5 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-15143@lists.php.net to get a copy of this message | ||
On Tue, Jan 25, 2000 at 11:07:59PM +0200, Zeev Suraski wrote:
> At 19:32 25/01/2000 , Uwe Steinmann wrote:
> >On Tue, Jan 25, 2000 at 06:07:22PM +0200, Zeev Suraski wrote:
> > > Are you using the latest CVS? There were plenty of changes in the last
> > > few days, and some of them broke the tree fairly badly. Make sure you're
> > > using the latest CVS.
> >Yes, it is the latest CVS and the error appears for at least two month now.
> >I never had the time to look for it until today, but than I got stuck again.
>
> What's the easiest way for me to reproduce it?
Zeev,
I have done some more testing and came to the conclusion that the problem
has to be in zend.
Any zend_function_entry containing more than 5 methods of a class make
php4 die if any of the methods is called. This happens in the domxml
extension but also with the directory functions if you put some dummy functions
into the class to exceed the magic number of 5.
Here ist a small example to reproduce it. Take the following small script
and execute it:
<?php
$d = dir("/");
while($dir= $d->read())
echo $dir."\n";
?>
It should work without any problems.
Now, add 3 more functions to php_dir_class_functions[] in ext/standart/dir.c
static zend_function_entry php_dir_class_functions[] = {
PHP_FALIAS(close, closedir, NULL)
PHP_FALIAS(rewind, rewinddir, NULL)
PHP_FALIAS(read, readdir, NULL)
PHP_FALIAS(xread, readdir, NULL)
PHP_FALIAS(yread, readdir, NULL)
PHP_FALIAS(zread, readdir, NULL)
{NULL, NULL, NULL}
};
Recompile php4 and run the script again.
Now I get
Fatal System Error: Raise at top of Exception Stack
Abort
If you take out any of the functions it works again.
If you change the script to
<?php
$d = opendir("/");
while($dir= readdir($d))
echo $dir."\n";
?>
it also works.
Maybe the problem is in INIT_CLASS_ENTRY()?
Could you or somebody with more knowledge of zend have a look at it, since
I'd like to keep working on the domxml extension.
Thanks.
Uwe
--
Uwe.Steinmann@fernuni-hagen.de
Tel: +2331 987 4528 Fax: +2331 987 375