You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2012/02/29 02:52:17 UTC
svn commit: r1294936 - in /httpd/httpd/trunk: CHANGES include/mpm_common.h
include/scoreboard.h
Author: trawick
Date: Wed Feb 29 01:52:17 2012
New Revision: 1294936
URL: http://svn.apache.org/viewvc?rev=1294936&view=rev
Log:
Fix MPM DSO load failure on AIX.
Without the proper AP_DECLARE*, these functions used by MPMs
were not exported from httpd on AIX, resulting in symbol
resolution errors.
Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/include/mpm_common.h
httpd/httpd/trunk/include/scoreboard.h
Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1294936&r1=1294935&r2=1294936&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Feb 29 01:52:17 2012
@@ -1,6 +1,8 @@
-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) Fix MPM DSO load failure on AIX. [Jeff Trawick]
+
*) core: Add the port number to the vhost's name in the scoreboard.
[Stefan Fritsch]
Modified: httpd/httpd/trunk/include/mpm_common.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/mpm_common.h?rev=1294936&r1=1294935&r2=1294936&view=diff
==============================================================================
--- httpd/httpd/trunk/include/mpm_common.h (original)
+++ httpd/httpd/trunk/include/mpm_common.h Wed Feb 29 01:52:17 2012
@@ -102,8 +102,8 @@ typedef void ap_reclaim_callback_fn_t(in
* in the scoreboard as well as those currently registered via
* ap_register_extra_mpm_process().
*/
-void ap_reclaim_child_processes(int terminate,
- ap_reclaim_callback_fn_t *mpm_callback);
+AP_DECLARE(void) ap_reclaim_child_processes(int terminate,
+ ap_reclaim_callback_fn_t *mpm_callback);
/**
* Catch any child processes that have been spawned by the parent process
@@ -115,7 +115,7 @@ void ap_reclaim_child_processes(int term
* in the scoreboard as well as those currently registered via
* ap_register_extra_mpm_process().
*/
-void ap_relieve_child_processes(ap_reclaim_callback_fn_t *mpm_callback);
+AP_DECLARE(void) ap_relieve_child_processes(ap_reclaim_callback_fn_t *mpm_callback);
/**
* Tell ap_reclaim_child_processes() and ap_relieve_child_processes() about
@@ -128,7 +128,7 @@ void ap_relieve_child_processes(ap_recla
* ap_reclaim_child_processes(), remove it from the list of such processes
* by calling ap_unregister_extra_mpm_process().
*/
-void ap_register_extra_mpm_process(pid_t pid, ap_generation_t gen);
+AP_DECLARE(void) ap_register_extra_mpm_process(pid_t pid, ap_generation_t gen);
/**
* Unregister an MPM child process which was previously registered by a
@@ -138,10 +138,11 @@ void ap_register_extra_mpm_process(pid_t
* @param old_gen Set to the server generation of the process, if found.
* @return 1 if the process was found and removed, 0 otherwise
*/
-int ap_unregister_extra_mpm_process(pid_t pid, ap_generation_t *old_gen);
+AP_DECLARE(int) ap_unregister_extra_mpm_process(pid_t pid, ap_generation_t *old_gen);
/**
* Pool cleanup for end-generation hook implementation
+ * (core httpd function)
*/
apr_status_t ap_mpm_end_gen_helper(void *unused);
@@ -154,7 +155,7 @@ apr_status_t ap_mpm_end_gen_helper(void
* APR_EINVAL is returned if passed either an invalid (< 1) pid, or if
* the pid is not in the current process group
*/
-apr_status_t ap_mpm_safe_kill(pid_t pid, int sig);
+AP_DECLARE(apr_status_t) ap_mpm_safe_kill(pid_t pid, int sig);
/**
* Run the monitor hook (once every ten calls), determine if any child
@@ -166,8 +167,9 @@ apr_status_t ap_mpm_safe_kill(pid_t pid,
* @param p The pool to allocate out of
* @param s The server_rec to pass
*/
-void ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode, apr_proc_t *ret,
- apr_pool_t *p, server_rec *s);
+AP_DECLARE(void) ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode,
+ apr_proc_t *ret, apr_pool_t *p,
+ server_rec *s);
/**
* Log why a child died to the error log, if the child died without the
@@ -177,7 +179,7 @@ void ap_wait_or_timeout(apr_exit_why_e *
* @param status The status returned from ap_wait_or_timeout
* @return 0 on success, APEXIT_CHILDFATAL if MPM should terminate
*/
-int ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status);
+AP_DECLARE(int) ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status);
#if defined(TCP_NODELAY)
/**
@@ -289,14 +291,14 @@ AP_DECLARE(const char *) ap_check_mpm(vo
* The maximum number of requests each child thread or
* process handles before dying off
*/
-extern int ap_max_requests_per_child;
+AP_DECLARE_DATA extern int ap_max_requests_per_child;
const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
const char *arg);
/**
* The filename used to store the process id.
*/
-extern const char *ap_pid_fname;
+AP_DECLARE_DATA extern const char *ap_pid_fname;
const char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
const char *arg);
void ap_mpm_dump_pidfile(apr_pool_t *p, apr_file_t *out);
@@ -304,16 +306,16 @@ void ap_mpm_dump_pidfile(apr_pool_t *p,
/*
* The directory that the server changes directory to dump core.
*/
-extern char ap_coredump_dir[MAX_STRING_LEN];
-extern int ap_coredumpdir_configured;
+AP_DECLARE_DATA extern char ap_coredump_dir[MAX_STRING_LEN];
+AP_DECLARE_DATA extern int ap_coredumpdir_configured;
const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
const char *arg);
/**
* Set the timeout period for a graceful shutdown.
*/
-extern int ap_graceful_shutdown_timeout;
-const char *ap_mpm_set_graceful_shutdown(cmd_parms *cmd, void *dummy,
+AP_DECLARE_DATA extern int ap_graceful_shutdown_timeout;
+AP_DECLARE(const char *)ap_mpm_set_graceful_shutdown(cmd_parms *cmd, void *dummy,
const char *arg);
#define AP_GRACEFUL_SHUTDOWN_TIMEOUT_COMMAND \
AP_INIT_TAKE1("GracefulShutdownTimeout", ap_mpm_set_graceful_shutdown, NULL, \
@@ -324,16 +326,16 @@ AP_INIT_TAKE1("GracefulShutdownTimeout",
int ap_signal_server(int *, apr_pool_t *);
void ap_mpm_rewrite_args(process_rec *);
-extern AP_DECLARE_DATA apr_uint32_t ap_max_mem_free;
+AP_DECLARE_DATA extern apr_uint32_t ap_max_mem_free;
extern const char *ap_mpm_set_max_mem_free(cmd_parms *cmd, void *dummy,
const char *arg);
-extern apr_size_t ap_thread_stacksize;
+AP_DECLARE_DATA extern apr_size_t ap_thread_stacksize;
extern const char *ap_mpm_set_thread_stacksize(cmd_parms *cmd, void *dummy,
const char *arg);
-extern apr_status_t ap_fatal_signal_setup(server_rec *s, apr_pool_t *pconf);
-extern apr_status_t ap_fatal_signal_child_setup(server_rec *s);
+AP_DECLARE(apr_status_t) ap_fatal_signal_setup(server_rec *s, apr_pool_t *pconf);
+AP_DECLARE(apr_status_t) ap_fatal_signal_child_setup(server_rec *s);
/* core's implementation of child_status hook */
extern void ap_core_child_status(server_rec *s, pid_t pid, ap_generation_t gen,
Modified: httpd/httpd/trunk/include/scoreboard.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/scoreboard.h?rev=1294936&r1=1294935&r2=1294936&view=diff
==============================================================================
--- httpd/httpd/trunk/include/scoreboard.h (original)
+++ httpd/httpd/trunk/include/scoreboard.h Wed Feb 29 01:52:17 2012
@@ -156,14 +156,21 @@ typedef struct {
typedef struct ap_sb_handle_t ap_sb_handle_t;
+/*
+ * Creation and deletion (internal)
+ */
+int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e t);
+apr_status_t ap_cleanup_scoreboard(void *d);
+
+/*
+ * APIs for MPMs and other modules
+ */
AP_DECLARE(int) ap_exists_scoreboard_image(void);
AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sbh, request_rec *r);
-int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e t);
-apr_status_t ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm, int detached);
-void ap_init_scoreboard(void *shared_score);
+AP_DECLARE(apr_status_t) ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm, int detached);
+AP_DECLARE(void) ap_init_scoreboard(void *shared_score);
AP_DECLARE(int) ap_calc_scoreboard_size(void);
-apr_status_t ap_cleanup_scoreboard(void *d);
AP_DECLARE(void) ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p,
int child_num, int thread_num);
Re: svn commit: r1294936 - in /httpd/httpd/trunk: CHANGES
include/mpm_common.h include/scoreboard.h
Posted by Jeff Trawick <tr...@gmail.com>.
On Tue, Feb 28, 2012 at 10:01 PM, William A. Rowe Jr.
<wr...@rowe-clan.net> wrote:
> On 2/28/2012 8:11 PM, Jeff Trawick wrote:
>>
>> AP_DECLARE_DATA just affects visibility, but the switch to __stdcall
>> for AP_DECLARE() is an API change. (important, since AIX needs this
>> in 2.4.x)
>
> If they weren't AP_DECLARE()ed before, they weren't exported. Ergo they
> are only used internally.
>
> Sure, if someone has a checkout and doesn't rebuild-all, that would be
> an issue, but let's just assume that recompiling only half the sources
> between 2.4.1 and 2.4.2 is a non-starter.
>
> Remember function signatures need to match between the .h and .c. This
> commit was only half a change.
Thanks so much! (d'oh :) )
Re: svn commit: r1294936 - in /httpd/httpd/trunk: CHANGES include/mpm_common.h
include/scoreboard.h
Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
On 2/28/2012 8:11 PM, Jeff Trawick wrote:
>
> AP_DECLARE_DATA just affects visibility, but the switch to __stdcall
> for AP_DECLARE() is an API change. (important, since AIX needs this
> in 2.4.x)
If they weren't AP_DECLARE()ed before, they weren't exported. Ergo they
are only used internally.
Sure, if someone has a checkout and doesn't rebuild-all, that would be
an issue, but let's just assume that recompiling only half the sources
between 2.4.1 and 2.4.2 is a non-starter.
Remember function signatures need to match between the .h and .c. This
commit was only half a change.
Re: svn commit: r1294936 - in /httpd/httpd/trunk: CHANGES
include/mpm_common.h include/scoreboard.h
Posted by Jeff Trawick <tr...@gmail.com>.
On Tue, Feb 28, 2012 at 8:52 PM, <tr...@apache.org> wrote:
> Author: trawick
> Date: Wed Feb 29 01:52:17 2012
> New Revision: 1294936
>
> URL: http://svn.apache.org/viewvc?rev=1294936&view=rev
> Log:
> Fix MPM DSO load failure on AIX.
>
> Without the proper AP_DECLARE*, these functions used by MPMs
> were not exported from httpd on AIX, resulting in symbol
> resolution errors.
Windows:
AP_DECLARE_DATA just affects visibility, but the switch to __stdcall
for AP_DECLARE() is an API change. (important, since AIX needs this
in 2.4.x)
Bill, can you confirm that adding AP_DECLARE in 2.4.x is breakage on Windows?
(Many of these don't apply to Windows for one reason or another; I
haven't checked the exact list of APIs with a potential concern,
pending an answer from Bill or other Windows-savants.)
>
> Modified:
> httpd/httpd/trunk/CHANGES
> httpd/httpd/trunk/include/mpm_common.h
> httpd/httpd/trunk/include/scoreboard.h
>
> Modified: httpd/httpd/trunk/CHANGES
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1294936&r1=1294935&r2=1294936&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/CHANGES [utf-8] (original)
> +++ httpd/httpd/trunk/CHANGES [utf-8] Wed Feb 29 01:52:17 2012
> @@ -1,6 +1,8 @@
> -*- coding: utf-8 -*-
> Changes with Apache 2.5.0
>
> + *) Fix MPM DSO load failure on AIX. [Jeff Trawick]
> +
> *) core: Add the port number to the vhost's name in the scoreboard.
> [Stefan Fritsch]
>
>
> Modified: httpd/httpd/trunk/include/mpm_common.h
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/mpm_common.h?rev=1294936&r1=1294935&r2=1294936&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/include/mpm_common.h (original)
> +++ httpd/httpd/trunk/include/mpm_common.h Wed Feb 29 01:52:17 2012
> @@ -102,8 +102,8 @@ typedef void ap_reclaim_callback_fn_t(in
> * in the scoreboard as well as those currently registered via
> * ap_register_extra_mpm_process().
> */
> -void ap_reclaim_child_processes(int terminate,
> - ap_reclaim_callback_fn_t *mpm_callback);
> +AP_DECLARE(void) ap_reclaim_child_processes(int terminate,
> + ap_reclaim_callback_fn_t *mpm_callback);
>
> /**
> * Catch any child processes that have been spawned by the parent process
> @@ -115,7 +115,7 @@ void ap_reclaim_child_processes(int term
> * in the scoreboard as well as those currently registered via
> * ap_register_extra_mpm_process().
> */
> -void ap_relieve_child_processes(ap_reclaim_callback_fn_t *mpm_callback);
> +AP_DECLARE(void) ap_relieve_child_processes(ap_reclaim_callback_fn_t *mpm_callback);
>
> /**
> * Tell ap_reclaim_child_processes() and ap_relieve_child_processes() about
> @@ -128,7 +128,7 @@ void ap_relieve_child_processes(ap_recla
> * ap_reclaim_child_processes(), remove it from the list of such processes
> * by calling ap_unregister_extra_mpm_process().
> */
> -void ap_register_extra_mpm_process(pid_t pid, ap_generation_t gen);
> +AP_DECLARE(void) ap_register_extra_mpm_process(pid_t pid, ap_generation_t gen);
>
> /**
> * Unregister an MPM child process which was previously registered by a
> @@ -138,10 +138,11 @@ void ap_register_extra_mpm_process(pid_t
> * @param old_gen Set to the server generation of the process, if found.
> * @return 1 if the process was found and removed, 0 otherwise
> */
> -int ap_unregister_extra_mpm_process(pid_t pid, ap_generation_t *old_gen);
> +AP_DECLARE(int) ap_unregister_extra_mpm_process(pid_t pid, ap_generation_t *old_gen);
>
> /**
> * Pool cleanup for end-generation hook implementation
> + * (core httpd function)
> */
> apr_status_t ap_mpm_end_gen_helper(void *unused);
>
> @@ -154,7 +155,7 @@ apr_status_t ap_mpm_end_gen_helper(void
> * APR_EINVAL is returned if passed either an invalid (< 1) pid, or if
> * the pid is not in the current process group
> */
> -apr_status_t ap_mpm_safe_kill(pid_t pid, int sig);
> +AP_DECLARE(apr_status_t) ap_mpm_safe_kill(pid_t pid, int sig);
>
> /**
> * Run the monitor hook (once every ten calls), determine if any child
> @@ -166,8 +167,9 @@ apr_status_t ap_mpm_safe_kill(pid_t pid,
> * @param p The pool to allocate out of
> * @param s The server_rec to pass
> */
> -void ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode, apr_proc_t *ret,
> - apr_pool_t *p, server_rec *s);
> +AP_DECLARE(void) ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode,
> + apr_proc_t *ret, apr_pool_t *p,
> + server_rec *s);
>
> /**
> * Log why a child died to the error log, if the child died without the
> @@ -177,7 +179,7 @@ void ap_wait_or_timeout(apr_exit_why_e *
> * @param status The status returned from ap_wait_or_timeout
> * @return 0 on success, APEXIT_CHILDFATAL if MPM should terminate
> */
> -int ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status);
> +AP_DECLARE(int) ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status);
>
> #if defined(TCP_NODELAY)
> /**
> @@ -289,14 +291,14 @@ AP_DECLARE(const char *) ap_check_mpm(vo
> * The maximum number of requests each child thread or
> * process handles before dying off
> */
> -extern int ap_max_requests_per_child;
> +AP_DECLARE_DATA extern int ap_max_requests_per_child;
> const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
> const char *arg);
>
> /**
> * The filename used to store the process id.
> */
> -extern const char *ap_pid_fname;
> +AP_DECLARE_DATA extern const char *ap_pid_fname;
> const char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
> const char *arg);
> void ap_mpm_dump_pidfile(apr_pool_t *p, apr_file_t *out);
> @@ -304,16 +306,16 @@ void ap_mpm_dump_pidfile(apr_pool_t *p,
> /*
> * The directory that the server changes directory to dump core.
> */
> -extern char ap_coredump_dir[MAX_STRING_LEN];
> -extern int ap_coredumpdir_configured;
> +AP_DECLARE_DATA extern char ap_coredump_dir[MAX_STRING_LEN];
> +AP_DECLARE_DATA extern int ap_coredumpdir_configured;
> const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
> const char *arg);
>
> /**
> * Set the timeout period for a graceful shutdown.
> */
> -extern int ap_graceful_shutdown_timeout;
> -const char *ap_mpm_set_graceful_shutdown(cmd_parms *cmd, void *dummy,
> +AP_DECLARE_DATA extern int ap_graceful_shutdown_timeout;
> +AP_DECLARE(const char *)ap_mpm_set_graceful_shutdown(cmd_parms *cmd, void *dummy,
> const char *arg);
> #define AP_GRACEFUL_SHUTDOWN_TIMEOUT_COMMAND \
> AP_INIT_TAKE1("GracefulShutdownTimeout", ap_mpm_set_graceful_shutdown, NULL, \
> @@ -324,16 +326,16 @@ AP_INIT_TAKE1("GracefulShutdownTimeout",
> int ap_signal_server(int *, apr_pool_t *);
> void ap_mpm_rewrite_args(process_rec *);
>
> -extern AP_DECLARE_DATA apr_uint32_t ap_max_mem_free;
> +AP_DECLARE_DATA extern apr_uint32_t ap_max_mem_free;
> extern const char *ap_mpm_set_max_mem_free(cmd_parms *cmd, void *dummy,
> const char *arg);
>
> -extern apr_size_t ap_thread_stacksize;
> +AP_DECLARE_DATA extern apr_size_t ap_thread_stacksize;
> extern const char *ap_mpm_set_thread_stacksize(cmd_parms *cmd, void *dummy,
> const char *arg);
>
> -extern apr_status_t ap_fatal_signal_setup(server_rec *s, apr_pool_t *pconf);
> -extern apr_status_t ap_fatal_signal_child_setup(server_rec *s);
> +AP_DECLARE(apr_status_t) ap_fatal_signal_setup(server_rec *s, apr_pool_t *pconf);
> +AP_DECLARE(apr_status_t) ap_fatal_signal_child_setup(server_rec *s);
>
> /* core's implementation of child_status hook */
> extern void ap_core_child_status(server_rec *s, pid_t pid, ap_generation_t gen,
>
> Modified: httpd/httpd/trunk/include/scoreboard.h
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/scoreboard.h?rev=1294936&r1=1294935&r2=1294936&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/include/scoreboard.h (original)
> +++ httpd/httpd/trunk/include/scoreboard.h Wed Feb 29 01:52:17 2012
> @@ -156,14 +156,21 @@ typedef struct {
>
> typedef struct ap_sb_handle_t ap_sb_handle_t;
>
> +/*
> + * Creation and deletion (internal)
> + */
> +int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e t);
> +apr_status_t ap_cleanup_scoreboard(void *d);
> +
> +/*
> + * APIs for MPMs and other modules
> + */
> AP_DECLARE(int) ap_exists_scoreboard_image(void);
> AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sbh, request_rec *r);
>
> -int ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e t);
> -apr_status_t ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm, int detached);
> -void ap_init_scoreboard(void *shared_score);
> +AP_DECLARE(apr_status_t) ap_reopen_scoreboard(apr_pool_t *p, apr_shm_t **shm, int detached);
> +AP_DECLARE(void) ap_init_scoreboard(void *shared_score);
> AP_DECLARE(int) ap_calc_scoreboard_size(void);
> -apr_status_t ap_cleanup_scoreboard(void *d);
>
> AP_DECLARE(void) ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p,
> int child_num, int thread_num);
>
>
--
Born in Roswell... married an alien...