Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 934 invoked from network); 11 Feb 2006 01:25:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Feb 2006 01:25:27 -0000 Received: (qmail 60319 invoked by uid 500); 11 Feb 2006 01:25:26 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 60241 invoked by uid 500); 11 Feb 2006 01:25:25 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 60230 invoked by uid 99); 11 Feb 2006 01:25:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2006 17:25:25 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [128.195.23.9] (HELO straightwhiskey.ucf.ics.uci.edu) (128.195.23.9) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Feb 2006 17:25:24 -0800 Received: from jug.ucf.ics.uci.edu (jug.ucf.ics.uci.edu [128.195.23.240]) by straightwhiskey.ucf.ics.uci.edu (Postfix) with ESMTP id EBD60C27FD for ; Fri, 10 Feb 2006 17:25:03 -0800 (PST) Date: Fri, 10 Feb 2006 17:24:30 -0800 (PST) From: Dirk Groeneveld X-X-Sender: marvin@jug.ucf.ics.uci.edu To: dev@apr.apache.org Subject: bug in apr_shm_create? Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1014960105-238054465-1139621070=:23042" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1014960105-238054465-1139621070=:23042 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Hi! I think I found a bug in shmem/unix/shm.c around line 317. In line 302, the file is created with the flags APR_CREATE | APR_EXCL (among others), and in line 316 shmget is called with IPC_CREAT | IPC_EXCL, which fails because the first call already created the file. It seems to work without IPC_CREAT, but I am no expert on shmget and am not sure if this is the way to fix it. The attached patch takes out both the IPC_CREAT and IPC_EXCL flags. I wasn't sure whether to keep IPC_CREAT. It might make a difference if someone else is messing with the file at the same time, so I decided to prefer failing due to a missing file over continuing with potentially undefined results. Dirk ---1014960105-238054465-1139621070=:23042 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=apr_shm_double_create.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=apr_shm_double_create.patch SW5kZXg6IHNobWVtL3VuaXgvc2htLmMNCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0NCi0tLSBzaG1lbS91bml4L3NobS5jCShyZXZpc2lvbiAzNzY5MDEpDQor Kysgc2htZW0vdW5peC9zaG0uYwkod29ya2luZyBjb3B5KQ0KQEAgLTMxNCw3 ICszMTQsNyBAQA0KICAgICAgICAgfQ0KIA0KICAgICAgICAgaWYgKChuZXdf bS0+c2htaWQgPSBzaG1nZXQoc2hta2V5LCBuZXdfbS0+cmVhbHNpemUsDQot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSE1fUiB8IFNI TV9XIHwgSVBDX0NSRUFUIHwgSVBDX0VYQ0wpKSA8IDApIHsNCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNITV9SIHwgU0hNX1cpKSA8 IDApIHsNCiAgICAgICAgICAgICByZXR1cm4gZXJybm87DQogICAgICAgICB9 DQogDQo= ---1014960105-238054465-1139621070=:23042--