Bug #14045: PHP Segfaults -- custom extension using resources
| From: | eterstegen at kingscredit dot com | Date: | Tue, 13 Nov 2001 22:48:29 +0000 |
| Subject: | Bug #14045: PHP Segfaults -- custom extension using resources | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-70385@lists.php.net to get a copy of this message | ||
From: eterstegen@kingscredit.com
Operating system: RedHat Linux 7.1
PHP version: 4.0.6
PHP Bug Type: Reproducible crash
Bug description: PHP Segfaults -- custom extension using resources
I am working on a PHP extension which will basically be a
wrapper for a library dealing with DECnet..
PHP is compiled as a module for Apache 1.3.20 with apxs
and no real special arguments. Also I am compiling the
extension by hand as illustrated in the Zend API docs.
I have debugged the problem down to a point where it seems
to be a complex reaction between 2 libraries and resources
which causes PHP to segfault.
The php extension links to 2 shared libraries (both are
C++). The main library contains a function (called from
the extension) which creates a new instance of a class,
and then returns this newly created class to the PHP
extension as a (typdef void *), since the extension is
straight C. The class used in the main library is defined
in the second library.
After adding some code to implement resources (a basic
MINIT, destructor, and handle) the extension segfaults
every time.
Unfotunately I am having a hard time pasting the backtrace
here but the first 5 lines are ?? and the 6th line has
0x08051461 in run_cleanups () at eval.c:41
I have very stripped down code for both libraries and the
module, but cannot paste them here.. I can zip them up and
send them if need be.
--
Edit bug report at: http://bugs.php.net/?id=14045&edit=1