zend_internal_class, inheritence and apache2 .. on my nerves
| From: | Bankó Ádám | Date: | Mon, 26 Feb 2007 21:52:01 +0000 |
| Subject: | zend_internal_class, inheritence and apache2 .. on my nerves | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-4603@lists.php.net to get a copy of this message | ||
Hi!
I'd like to ask for a little help from the more experienced. I've been
trying to find the source of this bug, but with not much success.
The current version of the source is here:
http://dbobj.sourceforge.net/bzr/dbobj/
The problem manifests as a SEGFAULT when i try to use my module with the
apache2 SAPI. (It makes multiple MINIT - RINIT - RSHUTDOWN - MSHUTDOWN
cycles.)
The problem AFAIK is in some of my zend_internal_class
registerint/handling code.
I have found a consequence in dbobj_helper.c:681. The function is used
to build configuration data structures for a particular class.
If a class extends another it also should inherit the parent's
configuration. The for loop in lines 686-694 implement this.
All works nice in the first run ... my class's parents (from dbobj.php)
match dbobj_class_entry_ptr. But on the second run (same apache thread,
next request, next MINIT-RINIT-RSHUTDOWN-MSHUTDOWN cycle) the
dbobj_class_entry_ptr gets a new value (the class gets re-registered)
and so forth everything work nice. But now comes what I can't
understand. The class from dbobj.php (that extends dbobj) has the
->parent pointer pointing to the OLD dbobj_class_entry_ptr .. that was
freed during a previous MSHUTDOWN ... too bad :(
Please .. please help me!
Adam Banko (Cassus)