Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 11D8B17206 for ; Fri, 16 Oct 2015 12:35:41 +0000 (UTC) Received: (qmail 47786 invoked by uid 500); 16 Oct 2015 12:35:40 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 47714 invoked by uid 500); 16 Oct 2015 12:35:40 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 47704 invoked by uid 99); 16 Oct 2015 12:35:40 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Oct 2015 12:35:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 216A31A2B94 for ; Fri, 16 Oct 2015 12:35:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.011 X-Spam-Level: X-Spam-Status: No, score=-0.011 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id lN1eIKwzFPuu for ; Fri, 16 Oct 2015 12:35:38 +0000 (UTC) Received: from mailserver.kippdata.de (capsella.kippdata.de [195.227.30.149]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id C996921277 for ; Fri, 16 Oct 2015 12:35:37 +0000 (UTC) Received: from [10.0.110.6] ([192.168.10.45]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id t9GCZan9004121 for ; Fri, 16 Oct 2015 14:35:37 +0200 (CEST) Subject: Re: 2.4.17 alignment issue sparc/ia64 To: dev@httpd.apache.org References: From: Rainer Jung Message-ID: <5620EF0E.7000109@kippdata.de> Date: Fri, 16 Oct 2015 14:35:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Am 16.10.2015 um 13:54 schrieb Yann Ylavic: > On Fri, Oct 16, 2015 at 10:02 AM, Yann Ylavic wrote: >> >> We should do something like the following patch: >> >> Index: server/scoreboard.c >> =================================================================== >> --- server/scoreboard.c (revision 1708095) >> +++ server/scoreboard.c (working copy) >> @@ -129,14 +129,19 @@ static apr_status_t ap_cleanup_shared_mem(void *d) >> 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)) > > Maybe the following would be more correct: > > +#define SCOREBOARD_ALIGN(size) APR_ALIGN((size),sizeof(void *)) > +#define SIZE_OF_scoreboard SCOREBOARD_ALIGN(sizeof(scoreboard)) > +#define SIZE_OF_global_score SCOREBOARD_ALIGN(sizeof(global_score)) > +#define SIZE_OF_process_score SCOREBOARD_ALIGN(sizeof(process_score)) > +#define SIZE_OF_worker_score SCOREBOARD_ALIGN(sizeof(worker_score)) > > since APR_ALIGN_DEFAULT seems to align to 8 bytes whatever the > platform requires... > > Maybe some APR_ALIGN_NATIVE macro is missing in APR, like: > #define APR_ALIGN_NATIVE(size) APR_ALIGN((size), APR_SIZEOF_VOIDP) > but that's another story :) I didn't yet have the time to reproduce and test your patch, but the APR_ALIGN((size),sizeof(void *)) align approach would not work. The problem here is that even or especially when building for 32 Bits and then using a 64 Bit data type, the alignment fails. So the pointer size would be 4 here, but the requirement alignment 8 bytes. Fun with hardware. Rainer