Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 22339 invoked from network); 17 Jan 2011 17:52:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jan 2011 17:52:24 -0000 Received: (qmail 61638 invoked by uid 500); 17 Jan 2011 17:52:23 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 61205 invoked by uid 500); 17 Jan 2011 17:52:21 -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 61197 invoked by uid 99); 17 Jan 2011 17:52:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jan 2011 17:52:20 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rainer.jung@kippdata.de designates 195.227.30.149 as permitted sender) Received: from [195.227.30.149] (HELO mailserver.kippdata.de) (195.227.30.149) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jan 2011 17:52:12 +0000 Received: from [195.227.30.209] (notebook-rj [195.227.30.209]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id p0HHpp3g005888 for ; Mon, 17 Jan 2011 18:51:51 +0100 (CET) Message-ID: <4D3481B2.9020503@kippdata.de> Date: Mon, 17 Jan 2011 18:51:46 +0100 From: Rainer Jung User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: "dev@httpd.apache.org" Subject: Slotmem patch for alignment Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hi, I wrote a small patch fixing an alignment issue for mod_slotmem: http://people.apache.org/~rjung/patches/mod_slotmem_shm_alignment.patch The problem is: mod_slotmem uses a header for meta data before the actual data slots. The addresses used for the data slots are offset by the size of the meta data. Currently this size is divisible by 4 but not by 8 and thus the data put into the slots is only aligned at 4 byte boudaries. If there is data inside the slots needing 8 byte alignment, then the compiler can not arrange for that. I fixed it by increasing the offset to the APR default alignment. Please check whether you think there's a problem with it. It tried it in combination with a separate proxy patch I'll post in a minute and both together fix the crashes observed on Solaris Sparc. One additional remark: I didn't actually understand the original code lines: apr_size_t basesize = (item_size * item_num); apr_size_t size = sizeof(sharedslotdesc_t) + (item_num * sizeof(char)) + basesize; What's the reason for the "(item_num * sizeof(char))" part? I can't actually see, where this part of the memory is being used. Regards, Rainer