delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/05/04/10:40:02

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:subject:to:references:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=VsmOTPBQA3HFkhRO
pZCXhfh4LcwlwrmZ0Lf43OreYoZ6RVE6MI575ZvdHIVtsyGUNEhCk0iZxSOkSYyU
K/z1fV2DuzOX/5Y3x+82Y+9Z+ahTN8TRe++nn/hhDDWbnZJc9mmEsQBw7QJ+sCNv
oT9n0UT30sMEKk/pvl7yZJos9Xk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:subject:to:references:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=lsZCbCW24fFqjByJOKM8hG
dEOqg=; b=qPMAcNzdOPQ528Ytcq6LJKqxWA0Cd5fcYLvCeTp4+mh3DtimVl1q1p
IeoPes8dSrL2nehtv0aOYyN0of2Oc2iyxyEprXNXD1bxKz+s4Mb96kynj8BB4YW9
GHbe1ShV6AReWTqx+W8FswS2biyAcMf8w3uKWGjEvR07ESKBewFc0=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1455, ATTN, H*r:sk:16.2017, H*M:b8f5
X-HELO: mail-wm0-f47.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Odu4+iu5EPEVjmoR1m2q4C0i6HcLOjkK3YUDbGBMgm8=; b=McFI4eGDEc7yMYO77L9uvHMATkYaQtqjN3TgSAoXBoTllJxoAMm83PPyInAD0IeiRs 2iki8wotrDl3fpmIorfQ4NdMryjFK2wn57hivd1Xi0KWC7NGbn0qrLyy9KnNTb3nQTHl yYA4kLe1OF1Ei8TtYLfB0ENfwTULzH5+epbqqLMK2v3b4NkPgiHUjwRrjnugFQX+0Rc/ 2r6wvdjIN1ZeoSlW0GjjXQ7UWMkDZQVawxo1/mBfiGrmPZ7dgC8JJOR3Gpjh9szA35nB rKjit9sS4oPVcmaEoRmP0x+dh6JaoyNT/bQ35d+wL4a4zJcSm6MvyuQTO7FoMxAeJ/gb dzEQ==
X-Gm-Message-State: AN3rC/7yM7kOne4kWqK6yPpEt5GlBDmOJ4R3wozlV+5v98hZrQpK5UOx oaCa5RQ6s5QYIcedQoQ=
X-Received: by 10.28.213.132 with SMTP id m126mr2200292wmg.47.1493908782282; Thu, 04 May 2017 07:39:42 -0700 (PDT)
From: Richard H Lee <ricardohenrylee AT gmail DOT com>
Subject: [ATTN: PHP maintainer] Re: Fix for REAL_PAGE_SIZE in PHP
To: cygwin AT cygwin DOT com
References: <528aeb1a-9a9d-0afd-7372-576e8c94ae81 AT gmail DOT com>
Message-ID: <b2264fb1-2d41-b8f5-c762-a4adefeef053@gmail.com>
Date: Thu, 4 May 2017 15:39:34 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <528aeb1a-9a9d-0afd-7372-576e8c94ae81@gmail.com>
X-IsSubscribed: yes

Here is my proposed patch for this bug:

diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c
index 3fd7fa0..f5b9bea 100644
--- a/Zend/zend_stream.c
+++ b/Zend/zend_stream.c
@@ -30,7 +30,11 @@
  # if HAVE_UNISTD_H
  #  include <unistd.h>
  #  if defined(_SC_PAGESIZE)
+#   ifdef __CYGWIN__
+#    define REAL_PAGE_SIZE 4096
+#   else
  #    define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
+#   endif
  #  elif defined(_SC_PAGE_SIZE)
  #    define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
  #  endif
diff --git a/main/main.c b/main/main.c
index 01ed3a6..0909309 100644
--- a/main/main.c
+++ b/main/main.c
@@ -96,7 +96,11 @@
  # if HAVE_UNISTD_H
  #  include <unistd.h>
  #  if defined(_SC_PAGESIZE)
+#   ifdef __CYGWIN__
+#    define REAL_PAGE_SIZE 4096
+#   else
  #    define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
+#   endif
  #  elif defined(_SC_PAGE_SIZE)
  #    define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
  #  endif

This definition needs to be fixed in two places as there are two
different places where a PHP source file can be mmap()ed, depending on
whether it is loaded using php-cli or loaded when php is run from a library.

On 02/05/2017 11:28, Richard H Lee wrote:
> Should this fix go upstream to PHP or be submitted to the PHP
> package within Cygwin?

I ask this as partially accessibly memory pages I guess are a quirk of
Cygwin. But then again programs ideally should not read past the end of
the EOF in the region the file is mmap()ed to.


Richard

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019