|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-07-22 13:12 UTC] anil at recoil dot org
Compile goes fine (--with-apxs=/usr/sbin/apxs --enable-versioning --without-mysql) until the very end: /bin/sh /usr/local/src/cvs/php4/libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I/usr/local/src/cvs/php4/ -I/usr/local/src/cvs/php4 -I/usr/local/src/cvs/php4/main -I/usr/lib/apache/include -I/usr/local/src/cvs/php4/Zend -I/usr/local/src/cvs/php4 -I/usr/local/src/cvs/php4/ext/xml/expat/xmltok -I/usr/local/src/cvs/php4/ext/xml/expat/xmlparse -DEAPI=1 -DXML_BYTE_ORDER=12 -g -O2 -c stub.c /bin/sh /usr/local/src/cvs/php4/libtool --silent --mode=link gcc -DHAVE_CONFIG_H -I. -I/usr/local/src/cvs/php4/ -I/usr/local/src/cvs/php4 -I/usr/local/src/cvs/php4/main -I/usr/lib/apache/include -I/usr/local/src/cvs/php4/Zend -I/usr/local/src/cvs/php4 -I/usr/local/src/cvs/php4/ext/xml/expat/xmltok -I/usr/local/src/cvs/php4/ext/xml/expat/xmlparse -DEAPI=1 -DXML_BYTE_ORDER=12 -g -O2 -o libphp4.la -rpath /usr/local/src/cvs/php4/libs -export-symbols /usr/local/src/cvs/php4/sapi/apache/php.sym -avoid-version stub.lo Zend/libZend.la sapi/apache/libsapi.la main/libmain.la regex/libregex.la ext/db/libdb.la ext/pcre/libpcre.la ext/posix/libposix.la ext/session/libsession.la ext/standard/libstandard.la ext/xml/libxml.la -lresolv -lm -lresolv *** Warning: inter-library dependencies are not known to be supported. *** All declared inter-library dependencies are being dropped. *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. ld: .libs/libphp4.lax/libsapi.al/mod_php4.lo: relocation must refer to global symbol at 0xf2b ld: .libs/libphp4.lax/libsapi.al/mod_php4.lo: relocation must refer to global symbol at 0xec8 ld: .libs/libphp4.lax/libsapi.al/mod_php4.lo: relocation must refer to global symbol at 0xe9b ld: .libs/libphp4.lax/libsapi.al/mod_php4.lo: relocation must refer to global symbol at 0xc22 Making all in pear Then, attempting to start Apache with a LoadModule causes a segfault. a gdb backtrace reveals nothing of use: Core was generated by `httpd'. Program terminated with signal 11, Segmentation fault. #0 0x0 in ?? () Ktracing the program and kdumping reveals: 29446 httpd NAMI "/var/www/logs/ssl_scache.db" 29446 httpd RET unlink -1 errno 2 No such file or directory 29446 httpd CALL unlink(0xad054) 29446 httpd NAMI "/var/www/logs/ssl_scache.db" 29446 httpd RET unlink -1 errno 2 No such file or directory 29446 httpd CALL unlink(0xad074) 29446 httpd NAMI "/var/www/logs/ssl_scache.dir" 29446 httpd RET unlink -1 errno 2 No such file or directory 29446 httpd CALL unlink(0xad094) 29446 httpd NAMI "/var/www/logs/ssl_scache.pag" 29446 httpd RET unlink -1 errno 2 No such file or directory 29446 httpd CALL unlink(0xad0b4) 29446 httpd NAMI "/var/www/logs/ssl_scache.db" 29446 httpd RET unlink -1 errno 2 No such file or directory 29446 httpd CALL unlink(0xbd134) 29446 httpd NAMI "/var/www/logs/ssl_scache" 29446 httpd RET unlink -1 errno 2 No such file or directory 29446 httpd CALL unlink(0xbd154) 29446 httpd NAMI "/var/www/logs/ssl_mutex.29446" 29446 httpd RET unlink -1 errno 2 No such file or directory 29446 httpd PSIG SIGSEGV SIG_DFL 29446 httpd NAMI "httpd.core" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 22:00:01 2026 UTC |
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 {