Possible bug in Zend (zend_function_entry)

From: Date: Tue, 25 Jan 2000 13:49:09 +0000
Subject: Possible bug in Zend (zend_function_entry)
Groups: php.dev 
Request: Send a blank email to php-dev+get-14907@lists.php.net to get a copy of this message
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

« previous php.dev (#14907) next »