PHP Version: 4.0.6

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 special arguments.  Also, I am compiling the 
extension by hand as illustrated in the Zend API docs (simple makefile).

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.

If I take out the code for the resource it runs perfectly fine.... HOWEVER if 
I leave the resource code in and comment out the call to the function it runs 
perfectly fine as well... So it only happens when both resources and the call 
are made...

The most interesting thing is that I never actually use the resources (in 
this code), meaning I never call a zend_list_delete or a return_resource, it 
is just enough that the minit and destructor are there.

The backtrace usually looks like this:

Program received signal SIGSEGV, Segmentation fault.
0x40229aa7 in ?? ()
(gdb) bt
#0  0x40229aa7 in ?? ()
#1  0x4022cfa8 in ?? ()
#2  0x4022d14c in ?? ()
#3  0x40228ab1 in ?? ()
#4  0x4023adf0 in ?? ()
#5  0x4023855c in ?? ()
#6  0x08051461 in run_cleanups () at eval.c:41
#7  0x0804fad5 in ap_clear_pool () at eval.c:41
#8  0x0804fb57 in ap_destroy_pool () at eval.c:41
#9  0x080603c3 in child_main () at eval.c:41
#10 0x08060521 in make_child () at eval.c:41
#11 0x0806069c in startup_children () at eval.c:41
#12 0x08060d0c in standalone_main () at eval.c:41
#13 0x0806153c in main () at eval.c:41
#14 0x40095177 in __libc_start_main (main=0x80611a4 <main>, argc=2,
    ubp_av=0xbffff97c, init=0x804e9ac <_init>, fini=0x8096e70 <_fini>,
    rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff96c)
    at ../sysdeps/generic/libc-start.c:129

I have very basic and stripped down code for both libraries and the 
module and can zip them up and send them if need be.

Thanks,
Eric Terstegen

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to