Re: Possible bug in Zend (zend_function_entry)

From: Date: Wed, 02 Feb 2000 22:34:04 +0000
Subject: Re: Possible bug in Zend (zend_function_entry)
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-15155@lists.php.net to get a copy of this message
This bug should be gone now. Can you please verify this? Zeev At 15:49 25/01/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 -- Uwe.Steinmann@fernuni-hagen.de
  Tel: +2331 987 4528    Fax: +2331 987 375
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#15155) next »