You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marion et Christophe JAILLET <ch...@wanadoo.fr> on 2015/11/03 15:38:01 UTC

re: svn commit: r1712294 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS server/scoreboard.c

 

 

 

 

 

> Message du 03/11/15 14:31
> De : minfrin@apache.org
> A : cvs@httpd.apache.org
> Copie à : 
> Objet : svn commit: r1712294 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS server/scoreboard.c
> 
> Author: minfrin
> Date: Tue Nov 3 13:31:28 2015
> New Revision: 1712294
> 
> URL: http://svn.apache.org/viewvc?rev=1712294&view=rev
> Log:
> core: Fix scoreboard crash (SIGBUS) on hardware requiring strict 64bit
> alignment (SPARC64, PPC64).
> Submitted by: ylavic
> Reviewed by: jim, minfrin
> 
[...]
> Modified: httpd/httpd/branches/2.4.x/server/scoreboard.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/scoreboard.c?rev=1712294&r1=1712293&r2=1712294&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.4.x/server/scoreboard.c (original)
> +++ httpd/httpd/branches/2.4.x/server/scoreboard.c Tue Nov 3 13:31:28 2015
> @@ -129,14 +129,19 @@ static apr_status_t ap_cleanup_shared_me
> return APR_SUCCESS;
> }
> 
> +#define SIZE_OF_scoreboard APR_ALIGN_DEFAULT(sizeof(scoreboard))
> +#define SIZE_OF_global_score APR_ALIGN_DEFAULT(sizeof(global_score))
> +#define SIZE_OF_process_score APR_ALIGN_DEFAULT(sizeof(process_score))
> +#define SIZE_OF_worker_score APR_ALIGN_DEFAULT(sizeof(worker_score))
> +
> AP_DECLARE(int) ap_calc_scoreboard_size(void)
> {
> ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
> ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &server_limit);
> 
> - scoreboard_size = sizeof(global_score);
> - scoreboard_size += sizeof(process_score) * server_limit;
> - scoreboard_size += sizeof(worker_score) * server_limit * thread_limit;
> + scoreboard_size = SIZE_OF_global_score;
> + scoreboard_size += SIZE_OF_process_score * server_limit;
> + scoreboard_size += SIZE_OF_worker_score * server_limit * thread_limit;
> 
> return scoreboard_size;
> }
> @@ -153,17 +158,17 @@ AP_DECLARE(void) ap_init_scoreboard(void
> 
> ap_calc_scoreboard_size();
> ap_scoreboard_image =
> - ap_calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *));
> + ap_calloc(1, SIZE_OF_scoreboard + server_limit * sizeof(worker_score *));
Should this also be SIZE_OF_worker_score also here ?

 

Best regards,

CJ

re: svn commit: r1712294 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS server/scoreboard.c

Posted by Marion et Christophe JAILLET <ch...@wanadoo.fr>.
> Message du 03/11/15 15:38
> De : "Marion et Christophe JAILLET" 
> A : dev@httpd.apache.org
> Copie à : 
> Objet : re: svn commit: r1712294 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS server/scoreboard.c
> 
>
>  

>  

>  

>  

>  

> Message du 03/11/15 14:31
> De : minfrin@apache.org
> A : cvs@httpd.apache.org
> Copie à : 
> Objet : svn commit: r1712294 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS server/scoreboard.c
> 
> Author: minfrin
> Date: Tue Nov 3 13:31:28 2015
> New Revision: 1712294
> 
> URL: http://svn.apache.org/viewvc?rev=1712294&view=rev
> Log:
> core: Fix scoreboard crash (SIGBUS) on hardware requiring strict 64bit
> alignment (SPARC64, PPC64).
> Submitted by: ylavic
> Reviewed by: jim, minfrin
> 
[...]
> Modified: httpd/httpd/branches/2.4.x/server/scoreboard.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/scoreboard.c?rev=1712294&r1=1712293&r2=1712294&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.4.x/server/scoreboard.c (original)
> +++ httpd/httpd/branches/2.4.x/server/scoreboard.c Tue Nov 3 13:31:28 2015
> @@ -129,14 +129,19 @@ static apr_status_t ap_cleanup_shared_me
> return APR_SUCCESS;
> }
> 
> +#define SIZE_OF_scoreboard APR_ALIGN_DEFAULT(sizeof(scoreboard))
> +#define SIZE_OF_global_score APR_ALIGN_DEFAULT(sizeof(global_score))
> +#define SIZE_OF_process_score APR_ALIGN_DEFAULT(sizeof(process_score))
> +#define SIZE_OF_worker_score APR_ALIGN_DEFAULT(sizeof(worker_score))
> +
> AP_DECLARE(int) ap_calc_scoreboard_size(void)
> {
> ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
> ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &server_limit);
> 
> - scoreboard_size = sizeof(global_score);
> - scoreboard_size += sizeof(process_score) * server_limit;
> - scoreboard_size += sizeof(worker_score) * server_limit * thread_limit;
> + scoreboard_size = SIZE_OF_global_score;
> + scoreboard_size += SIZE_OF_process_score * server_limit;
> + scoreboard_size += SIZE_OF_worker_score * server_limit * thread_limit;
> 
> return scoreboard_size;
> }
> @@ -153,17 +158,17 @@ AP_DECLARE(void) ap_init_scoreboard(void
> 
> ap_calc_scoreboard_size();
> ap_scoreboard_image =
> - ap_calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *));
> + ap_calloc(1, SIZE_OF_scoreboard + server_limit * sizeof(worker_score *));
> Should this also be SIZE_OF_worker_score also here ?

>  

> Best regards,

> CJ


 

Forget it, "sizeof(worker_score *)" is not "sizeof(worker_score)"

Sorry for the noise.

 

CJ