|
From: <php...@li...> - 2008-03-15 11:21:40
|
On Fri, 2008-03-14 at 18:11 +0100,
php...@li... wrote:
> Hi,
>
> the patch is invalid, and I doubt that this is a PHP or PHP/Java Bridge issue.
>
> Apache, when configured to use the prefork MPM, starts one Java process from the PHP MINIT() hook
> and terminates it in the PHP MSHUTDOWN() hook.
>
> The MINIT() hook must be called *before* any worker child is spawned. And the MSHUTDOWN() hook
> must be called *after* all childs have been terminated.
>
> Any stress test, which might kill childs at various levels, must not touch the Java child spawned
> from the MINIT() hook.
>
> This means that either:
>
> a) you have found a bug in Apache
>
> b) this is a misconfiguration: for example java.so loaded from the PHP dl() function
>
> c) this is a misconfiguration: for example mod_php.so running in a non PREFORK MPM.
>
>
> Regards,
> Jost Boekemeier
hi,
ok, you are right whith the patch. this is probalbe bougous..
but look this code (bind.c)
static void wait_for_daemon(void) {
....removed...
for(i=0; i<2; i++) {
struct timeval timeval = {2l, 0};
if(select(1+EXT_GLOBAL(cfg)->err, &rfds, 0, 0, &timeval) > 0)
break;
kill(EXT_GLOBAL(cfg)->cid, sig[i]);
}
if((read(EXT_GLOBAL(cfg)->err, &err, sizeof err))!=sizeof err) err=0;
//printf("VM terminated with code: %ld\n", err);
close(EXT_GLOBAL(cfg)->err);
EXT_GLOBAL(cfg)->err=0;
#else
s_kill(0); /* always -9 on windows */
#endif
}
what if select returns an error? you exit from loop and go ahead to
read, and this blocks if there are nothing to read. or?
anyway, i will make some test with debugging enabled...
some info:
java.so is loaded from php.ini with extension=java.so
i have only prefork mpm compiled, the apache configuration is a default
config with the following changes:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
Include conf/extra/httpd-info.conf is switched on with ExtendedStatus On
Attaching to program: `/usr/local/bin/httpd', process 58895.
Reading symbols for shared libraries +++++++++.................... done
0x00007fff82976384 in read ()
(gdb) whe
#0 0x00007fff82976384 in read ()
#1 0x00000001006e90d6 in java_shutdown_library ()
#2 0x00000001006de925 in zm_shutdown_java ()
#3 0x000000010128abfb in module_destructor ()
#4 0x0000000101292621 in zend_hash_apply_deleter ()
#5 0x0000000101292778 in zend_hash_graceful_reverse_destroy ()
#6 0x0000000101287397 in zend_shutdown ()
#7 0x0000000101241fdf in php_module_shutdown ()
#8 0x0000000101242089 in php_module_shutdown_wrapper ()
#9 0x000000010131e7f1 in php_apache_child_shutdown ()
#10 0x000000010022d299 in apr_pool_destroy ()
#11 0x0000000100057eb6 in clean_child_exit ()
#12 0x00000001000584d2 in child_main ()
#13 0x000000010005869a in make_child ()
#14 0x000000010005874b in startup_children ()
#15 0x0000000100059900 in ap_mpm_run ()
#16 0x0000000100007b68 in main ()
Server version: Apache/2.2.8 (Unix)
Server built: Mar 11 2008 16:13:40
Server's Module Magic Number: 20051115:11
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_FLOCK_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local"
-D SUEXEC_BIN="/usr/local/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
Loaded Modules:
core_module (static)
authn_file_module (static)
authn_default_module (static)
authz_host_module (static)
authz_groupfile_module (static)
authz_user_module (static)
authz_default_module (static)
auth_basic_module (static)
include_module (static)
filter_module (static)
log_config_module (static)
env_module (static)
unique_id_module (static)
setenvif_module (static)
ssl_module (static)
mpm_prefork_module (static)
http_module (static)
mime_module (static)
status_module (static)
autoindex_module (static)
asis_module (static)
cgi_module (static)
negotiation_module (static)
dir_module (static)
actions_module (static)
userdir_module (static)
alias_module (static)
so_module (static)
info_module (shared)
php5_module (shared)
php 5.2.5 configuration:
'./configure' '--prefix=/usr/local'
'--with-apxs2=/usr/local/bin/apxs'
'--with-pgsql=/usr/local'
'--enable-ftp'
'--with-zlib'
'--enable-mbstring'
'--enable-sockets'
'--with-iconv'
Best regards,
Attila Soki
|