Re: Possible bug in Zend (zend_function_entry)
| From: | Uwe Steinmann | Date: | Tue, 25 Jan 2000 17:32:18 +0000 |
| Subject: | Re: Possible bug in Zend (zend_function_entry) | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-14912@lists.php.net to get a copy of this message | ||
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.
Uwe
>
> Zeev
>
> On Tue, 25 Jan 2000, Uwe Steinmann wrote:
>
> > Hi,
> >
> > I resumed working on the dom xml extension and try to find a long
> > existing bug in the module.
> >
> > php died with the following backtrace if I call a method of a class
> > ($rootnode->getattr("language")):
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > zend_hash_find (ht=0x819a5a8, arKey=0x81aca18 "getattr", nKeyLength=8,
> > pData=0xbffff2c4) at zend_hash.c:839
> > 839 if ((p->h == h) && (p->nKeyLength == nKeyLength)) {
> > (gdb) bt
> > #0 zend_hash_find (ht=0x819a5a8, arKey=0x81aca18 "getattr", nKeyLength=8,
> > pData=0xbffff2c4) at zend_hash.c:839
> > #1 0x80eb16a in execute (op_array=0x819ec38) at ./zend_execute.c:1497
> > #2 0x80801bf in php_execute_script (primary_file=0xbffff3d8) at main.c:1244
> > #3 0x8061c8c in main (argc=3, argv=0xbffff444) at cgi_main.c:483
> > (gdb)
> >
> > Though, I don't have any idea of how zend works internally it looks like
> > the error has to do with an impropperly set up hashtable.
> >
> > In my code I fill up a zend_function_entry with the methods of the class:
> >
> > static zend_function_entry php_domxmlnode_class_functions[] = {
> > PHP_FALIAS(lastchild, domxml_lastchild, NULL)
> > PHP_FALIAS(children, domxml_children, NULL)
> > PHP_FALIAS(parent, domxml_parent, NULL)
> > PHP_FALIAS(getattr, domxml_getattr, NULL)
> > PHP_FALIAS(setattr, domxml_setattr, NULL)
> > PHP_FALIAS(attributes, domxml_attributes, NULL)
> > {NULL, NULL, NULL}
> > };
> >
> > Unfortunately the above seems to make problems. If I remove any of
> > the above functions from the entry then everything works. To be more precise:
> > any number up to 5 functions is OK. If I add a 6th function php dies with
> > the above error.
> >
> > I did some debugging and found the TableSize of the internal hash table has
> > a size of 5. Could this be related?
> >
> > Uwe
> >
> > PS: The complete code is in ext/domxml/domxml.c
> >
>
> --
> Zeev Suraski <zeev@zend.com>
> http://www.zend.com/
>
>
--
Uwe.Steinmann@fernuni-hagen.de
Tel: +2331 987 4528 Fax: +2331 987 375