On 05/08/2007 05:36 AM, Oliver Block wrote:
> Hello,
>
> I am getting a SIGSEGV when compiling php-5.2.2.
>
> gdb breaks up at the if statement of the following function
>
> static void php_apache_add_version(apr_pool_t *p)
> {
> TSRMLS_FETCH();
> if (PG(expose_php)) {
> ap_add_version_component(p, "PHP/" PHP_VERSION);
> }
> }
>
> It only occurs when --enable-maintainer-zts is used.
>
> main/php_globals.h:
> # define PG(v) TSRMG(core_globals_id, php_core_globals *, v)
> extern PHPAPI int core_globals_id;
> #else
> # define PG(v) (core_globals.v)
> extern ZEND_API struct _php_core_globals core_globals;
> #endif
>
> TSRM/TSRM.h
> #define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)
> #define TSRMG(id, type, element) (((type) (*((void ***) tsrm_ls))
> [TSRM_UNSHUFFLE_RSRC_ID(id)])->element)
>
> GDB tells me that core_globals_id == 0 which leads to an index of -1 -- if I
> interpret the results correctly.
Either GDB is wrong or your build is badly broken.
core_globals_id is initialized in main/main.c, line 1491
*rsrc_id = TSRM_SHUFFLE_RSRC_ID(id_count++);
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
--
Wbr,
Antony Dovgal