From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86415 invoked by alias); 4 May 2017 14:39:44 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 86397 invoked by uid 89); 4 May 2017 14:39:43 -0000 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 Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 May 2017 14:39:42 +0000 Received: by mail-wm0-f47.google.com with SMTP id m123so18133798wma.0 for ; Thu, 04 May 2017 07:39:44 -0700 (PDT) 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) Received: from [192.168.1.6] (79-67-178-202.dynamic.dsl.as9105.com. [79.67.178.202]) by smtp.gmail.com with ESMTPSA id t2sm1779660wme.16.2017.05.04.07.39.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2017 07:39:41 -0700 (PDT) From: Richard H Lee Subject: [ATTN: PHP maintainer] Re: Fix for REAL_PAGE_SIZE in PHP To: cygwin@cygwin.com References: <528aeb1a-9a9d-0afd-7372-576e8c94ae81@gmail.com> Message-ID: Date: Thu, 04 May 2017 14:39:00 -0000 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> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00048.txt.bz2 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 # 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 # 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