called via do_register_internal_class

I have a working C++ extension, based on the class-factory model I'm exploring, 
but which is throwing a bizarre segmentation fault.

What makes it bizarre is that it is centred on the inclusion of an include file 
(myexternalinclude.h) that is part of an external shared module that has proved 
reliable in all other scenarios.

Further one .cpp module (each cpp being defined in config.m4, and so
comprising its own module) uses this external class successfully, without
the error/side effect.

Two further modules however both generate similar errors (backtrace
listed below), despite being based on the same factory base class, and
generate the error simply be inclusion of the myexternalinclude.h file.

Without the include, the extension works fine, as anticipated.

Thus each component - the external shared module, the extension
(without include), the extension (with include and class active in one 
particular module), and the two suspect modules (without include) all
work fine and generate a viable extension, yet the final step of including
the particular external extension in a particular module is sufficient to 
generate the error listed.

Two features come to mind, in the matter: 
a) the suspect modules already use another class defined in the same
external module - possible overlap?
b) a couple of functions have been declared in the header, but not 
implemented in the external module. Not ideal perhaps, but has had
no impact till now. Could this be the 'NULL function referred to below?

If anyone has come across a similar phenomenon, or can shed light
on the matter, I'd be most grateful.

Cheers,

Andrew Mather.







----- backtrace from gdb -----

PHP Warning:  PhpClassFactory::SelfRegister(...) in Unknown on line 0

Program received signal SIGSEGV, Segmentation fault.
0x403578db in strlen () from /lib/tls/libc.so.6
(gdb) bt
#0  0x403578db in strlen () from /lib/tls/libc.so.6
#1  0x081d9367 in vspprintf (pbuf=0x1, max_len=1024, format=0x82e3718 "Method 
%s%s%s() cannot be a NULL function", ap=0xbfffe888 "[EMAIL PROTECTED]")
    at /src/php-5.1.1/main/spprintf.c:518
#2  0x081d699b in php_error_cb (type=32, error_filename=0x82b40c2 "Unknown", 
error_lineno=0,
    format=0x82e3718 "Method %s%s%s() cannot be a NULL function", 
args=0xbfffe888 "[EMAIL PROTECTED]") at /src/php-5.1.1/main/main.c:648
#3  0x08214ed5 in zend_error (type=32, format=0x82e3718 "Method %s%s%s() cannot 
be a NULL function") at /src/php-5.1.1/Zend/zend.c:939
#4  0x0821a2d6 in zend_register_functions (scope=0x8403990, 
functions=0x40457540, function_table=0x84039ac, type=1, tsrm_ls=0x835e018)
    at /src/php-5.1.1/Zend/zend_API.c:1566
#5  0x0821ab21 in do_register_internal_class (orig_class_entry=0xbfffec2c, 
ce_flags=0, tsrm_ls=0x835e018) at /src/php-5.1.1/Zend/zend_API.c:1826
#6  0x404519ce in PhpClassFactory::_register () from 
/usr/local/lib/php/extensions/Aurora.so
#7  0x40451885 in PhpClassFactory::SelfRegister () from 
/usr/local/lib/php/extensions/Aurora.so
#8  0x404522d7 in MaxiFactory::Register () from 
/usr/local/lib/php/extensions/Aurora.so
#9  0x40451198 in zm_startup_Aurora () from 
/usr/local/lib/php/extensions/Aurora.so
#10 0x08219715 in zend_startup_module_ex (module=0x83a6fc0, tsrm_ls=0x835e018) 
at /src/php-5.1.1/Zend/zend_API.c:1341
#11 0x0821edf1 in zend_hash_apply (ht=0x835d5c0, apply_func=0x8219600 
<zend_startup_module_ex>, tsrm_ls=0x835e018)
    at /src/php-5.1.1/Zend/zend_hash.c:664
#12 0x0821afd1 in zend_startup_modules (tsrm_ls=0x835e018) at 
/src/php-5.1.1/Zend/zend_API.c:1388
#13 0x081d5c66 in php_module_startup (sf=0x835b360, additional_modules=0x0, 
num_additional_modules=0) at /src/php-5.1.1/main/main.c:1533
#14 0x08295d8a in main (argc=2, argv=0xbffff124) at 
/src/php-5.1.1/sapi/cli/php_cli.c:655
(gdb)                                                                           
                           

Reply via email to