Re: apache2handler/SIGSEGV with apache2 (prefork)
| From: | Oliver Block | Date: | Tue, 08 May 2007 09:51:35 +0000 |
| Subject: | Re: apache2handler/SIGSEGV with apache2 (prefork) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-29317@lists.php.net to get a copy of this message | ||
Hello Tony,
according to my backtrace, this line (main/main.c:1491) is not processed.
366 if (PG(expose_php)) {
(gdb) p core_globals_id
$4 = 0
The backtrace follows:
Program received signal SIGSEGV, Segmentation fault.
0x40bb4449 in php_apache_add_version (p=0x80a40a8)
at /usr/local/src/php-5.2.2/sapi/apache2handler/sapi_apache2.c:366
366 if (PG(expose_php)) {
(gdb) bt full
#0 0x40bb4449 in php_apache_add_version (p=0x80a40a8)
at /usr/local/src/php-5.2.2/sapi/apache2handler/sapi_apache2.c:366
tsrm_ls = (void ***) 0x83a19b0
#1 0x40bb4537 in php_apache_server_startup (pconf=0x80a40a8, plog=0x80ce150,
ptemp=0x80d0158, s=0x80be308)
at /usr/local/src/php-5.2.2/sapi/apache2handler/sapi_apache2.c:417
data = (void *) 0x1
userdata_key = 0x40c704e7 "apache2hook_post_config"
#2 0x080691fd in ap_run_post_config ()
No symbol table info available.
#3 0x0806f622 in main ()
No symbol table info available.
Regards,
Oliver
Am Dienstag, 8. Mai 2007 10:21 schrieben Sie:
> 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)