dump of attributes, methods of class
| From: | Uwe Steinmann | Date: | Mon, 29 Nov 1999 12:45:00 +0000 |
| Subject: | dump of attributes, methods of class | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-7037@lists.php.net to get a copy of this message | ||
Hi,
I have been having problems implementing an extension in php4 containing
functions which create a object. The object has several attributes and
methods. Accessing the attributes works, but calling one of the methods
fails with:
Program received signal SIGSEGV, Segmentation fault.
0x808efe3 in zend_hash_find (ht=0x819c100, arKey=0x81ac750 "getattr",
nKeyLength=8, pData=0xbfffdde8) at zend_hash.c:923
923 if ((p->h == h) && (p->nKeyLength == nKeyLength)) {
(gdb) bt
#0 0x808efe3 in zend_hash_find (ht=0x819c100, arKey=0x81ac750 "getattr",
nKeyLength=8, pData=0xbfffdde8) at zend_hash.c:923
#1 0x80ec53d in execute (op_array=0x819f230) at zend_execute.c:1445
#2 0x807b27e in php_execute_script (primary_file=0xbffff478) at main.c:1232
#3 0x806131c in main (argc=3, argv=0xbffff4e4) at cgi_main.c:471
(gdb)
The script is the following
$dom = dom($xmlstr);
echo $dom->version."\n";
$rootnode = $dom->root();
var_dump($rootnode);
$dtd = $dom->intdtd();
echo $rootnode->name."\n";
echo domxml_getattr($rootnode->node, "language")."\n";
echo $rootnode->getattr("language", "en")."\n";
getattr() is an alias for domxml_getattr(). domxml_getattr() works while getattr()
cause the above segm fault.
I wonder if this is a problem of zend or my implementation in ext/domxml.
What I find strange is the fact that the $dom->root() works though the implentation
of the class in $dom (domxml_doc_class) is very similar to the class in $rootnode
(domxml_node_class).
How could I possible debug this? Maybe somebody with a better understanding
of this could have a look at ext/domxml/domxml.c.
Uwe
--
Uwe.Steinmann@fernuni-hagen.de
Tel: +2331 987 4528 Fax: +2331 987 375