PHP 4.0 Bug #5734 Updated: Segfault when installed as DSO
| From: | Bug Database | Date: | Wed, 26 Jul 2000 20:28:55 +0000 |
| Subject: | PHP 4.0 Bug #5734 Updated: Segfault when installed as DSO | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-26379@lists.php.net to get a copy of this message | ||
ID: 5734
User Update by: anil@recoil.org
Old-Status: Analyzed
Status: Open
Bug Type: Installation problem
Description: Segfault when installed as DSO
Rob Black <rob@ivision.co.uk> and I tracked down this bug. It comes from a little bit of
confusion in the definition of the sapi_module_struct.
It is defined as an extern in main/SAPI.h, and a variable of the _same name_ is redefined as a
static in sapi/apache/mod_php4.c
The linker then fails to relocate this due to the confusion at dynamic link time. Below is a simple
patch to rename the static variable in mod_php4.c to sapi_module_conf, which removes the variable
conflict.
If this could be tested and committed soon it would enable the running of PHP4 as a DSO under
OpenBSD.
Index: sapi/apache/mod_php4.c
===================================================================
RCS file: /repository/php4/sapi/apache/mod_php4.c,v
retrieving revision 1.59
diff -u -r1.59 mod_php4.c
--- sapi/apache/mod_php4.c 2000/07/10 09:20:35 1.59
+++ sapi/apache/mod_php4.c 2000/07/26 20:29:09
@@ -321,7 +321,7 @@
}
-static sapi_module_struct sapi_module = {
+static sapi_module_struct sapi_module_conf = {
"apache", /* name */
"Apache", /* pretty name */
@@ -576,8 +576,8 @@
#ifdef ZTS
tsrm_startup(1, 1, 0);
#endif
- sapi_startup(&sapi_module);
- php_apache_startup(&sapi_module);
+ sapi_startup(&sapi_module_conf);
+ php_apache_startup(&sapi_module_conf);
}
per_dir_entry.type = mode;
@@ -661,7 +661,7 @@
static void apache_php_module_shutdown_wrapper(void)
{
apache_php_initialized = 0;
- sapi_module.shutdown(&sapi_module);
+ sapi_module.shutdown(&sapi_module_conf);
#if MODULE_MAGIC_NUMBER >= 19970728
/* This function is only called on server exit if the apache API
@@ -679,7 +679,7 @@
static void php_child_exit_handler(server_rec *s, pool *p)
{
/* apache_php_initialized = 0; */
- sapi_module.shutdown(&sapi_module);
+ sapi_module.shutdown(&sapi_module_conf);
#ifdef ZTS
tsrm_shutdown();
@@ -695,8 +695,8 @@
#ifdef ZTS
tsrm_startup(1, 1, 0);
#endif
- sapi_startup(&sapi_module);
- php_apache_startup(&sapi_module);
+ sapi_startup(&sapi_module_conf);
+ php_apache_startup(&sapi_module_conf);
}
#if MODULE_MAGIC_NUMBER >= 19980527
{
Full Bug description available at: http://bugs.php.net/?id=5734