delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/05/22/14:39:25

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; q=dns; s=default; b=bGiJ
JqKNG/3mfEyA11RPFJBFvq76UpGKSP6ITSN+E01O21RW5+zEvzxn78BFTqbtxP04
7jEXG8tUhOMkwNid5+1BAmdpOV5wI4Y/X9oSF4IKVK9vyJasYeWam2fJD+JlC/CN
cv+5FswZjhFh/Av4tmm9ps3CJdeguLOcm8nrjz8=
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; s=default; bh=WjNFeUYqqI
JX4KAyLkCWQNr3mcU=; b=nUIKSDfmAck/b3JHptxyNUxXULocS+z1MFvy9kV+rT
kHaRXHcKBDe7Djc5XRpQ0K02Bw2E5SLOZ0NLpfP//gb8uIQdn1OLO+jXe2hJKYxO
KDyIO2JK9fT9b1tJCCt8Vn8MtdeXqCP75yM9PvD3xLcG2/pvIe685A+Hhos9J8IT
M=
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=-24.3 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=prep, downloading, UD:php
X-HELO: mail-wm0-f68.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-language; bh=ETNZ5pjOtUe6FXxctbcHH616kVnmVNo32/YsCyMne/8=; b=umlZKpGcXxEdBroGfEVkue7IqNwwfJu+0J36kha4JEkzZjNw4vUeDel8MMnIR5BtlF aULbMLAW2gfsuubXl7FKe31Cf0m27eS+WAOo2rnjrXQwrRa2wQG91fXLNUQwimZvtDxm 56JqVvCAlwBJQCYl+zCACxk+Go9ri4fKDicMpNm1S9+Pmg5be9e9K6MkoA6rioSZktbm qpS2gEqLNCaYYrjBo5b+o7rM4fFfu80zbZVADrmoGTtiO4gt15N893NWjOEYgU2XEcw1 MF1OCoMYUFJKYi9WUf94xhnumwxGDNRWg+GKdovbmLF57mi0iBE5gDtExcLTc9oU4Kgr Cexg==
X-Gm-Message-State: AODbwcDA5yN/Mmcrz5bABT8eunZVTP6GPd9nYzt2Yy8+sDRhZYxIEkSu iEA70PvwuvrfVU5EamM=
X-Received: by 10.28.109.195 with SMTP id b64mr1183256wmi.46.1495478313543; Mon, 22 May 2017 11:38:33 -0700 (PDT)
From: Richard H Lee <ricardohenrylee AT gmail DOT com>
Subject: Re: Composer segfault on multiple configurations
To: cygwin AT cygwin DOT com
References: <CADWQZEtfxD1HrfmmMyzn==qXVzc5dKVgajVzdtOcGwCfcQrcgQ AT mail DOT gmail DOT com> <d79e573f-5776-ed8e-da7e-667d04c54c7d AT gmail DOT com> <CADWQZEtXVU5GMitWn1qFqSrXYE4D5LtSBOSWsayv=suGBR0aBQ AT mail DOT gmail DOT com>
Message-ID: <a3e411e2-5b47-855a-c6ba-fbddb9d7d131@gmail.com>
Date: Mon, 22 May 2017 19:38:30 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <CADWQZEtXVU5GMitWn1qFqSrXYE4D5LtSBOSWsayv=suGBR0aBQ@mail.gmail.com>
X-IsSubscribed: yes

--------------3B4A87F4E885148F84806326
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 18/05/2017 08:42, Sky Diver wrote:
> I may compile php from cygports

Just in case Sky Diver or anyone else is interested in compiling php 
from Cygports, here are some simple steps to do so. It's not really 
difficult and most of the time it takes up is downloading the packages 
and compiling php. You'll probably want to do the compilation step 
during a lunch break or something.

If you just want to get a patched php running, just skip to the steps below.

But I'm also putting putting these instructions out here in case anyone 
wants to do some testing. The php devs asked for confirmation that (a) 
the bug exists and (b) this patch actually fixes it, before committing 
the patch.

The devs ask this as they have had problems setting up a dev environment 
for php. So they are unable recreate this bug or test the patch 
themselves. This is why I feel any Cygwin-specific patches for php 
should, for the moment be submitted to Cygwin rather than going to php.

To recreate the bug, create a 4096 bytes php file.
$ for i in $(seq 4096); do echo; done > test.php
Then execute it.
$ php test.php
This should immediately segfault. You can also test it through apache as 
there are two ways this bug can occur, through the php cli and through 
the apache php module. That is why the patch is against two different 
points in the source. By running apache in debug mode, you can see when 
the segfault occurs.
$ /usr/sbin/apachectl -X

Steps
=====

1. Install the php source from cygwin
Install php from the Cygwin installer as normal, except check the Src 
checkbox as well as the Bin checkbox.

2. cd into the source directory
$ cd /usr/src/php-7.0.19-1.src

3. Copy the attachments over in that directory
- dependencies
- php-7.0.19-page-size.patch
- php-cygport-page-size.patch

5. Install the dependencies
There are 59 packages required to build php with cygport, listed in the 
attachment "dependencies". You'll probably use the command line for this 
rather than manually pick out the packages by hand in Cygwin's setup. 
You can either use setup's command line -P option or apt-cyg.
I used apt-cyg, so for me I run:
$ xargs apt-cyg install < dependencies
It will take a while to download all these packages.

4. Patch the cygport file
$ patch < php-cygport-page-size.patch

6. Prepare the source for compilation
$ cygport php.cygport prep

7. Compile php
$ cygport php.cygport compile
Depending on your cpu, this will take a significant amount of time.

8. Install your compiled php into a staging directory
$ cygport php.cygport install

9. Copy the files over from staging into root
$ rsync -varlI php-7.0.19-1.x86_64/inst/. /

10. Rebase the dlls in cygwin
$ rebase-trigger full
Exit all Cygwin processes, command line and services.
Run Cygwin's setup to actually perform the rebase.

If you rerun "php test.php" you now should get 4096 newlines instead of 
a segfault.

Should the patch miss php 7.0.20 or whatever the next version of php is 
for Cygwin, you can rerun the steps and just change the path names in 
steps 2 and 9. But hopefully the path will be merged in by then.




--------------3B4A87F4E885148F84806326
Content-Type: text/plain; charset=UTF-8;
 name="php-7.0.19-page-size.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="php-7.0.19-page-size.patch"

ZGlmZiAtLWdpdCBhL1plbmQvemVuZF9zdHJlYW0uYyBiL1plbmQvemVuZF9z
dHJlYW0uYwppbmRleCAzZmQ3ZmEwLi5mNWI5YmVhIDEwMDY0NAotLS0gYS9a
ZW5kL3plbmRfc3RyZWFtLmMKKysrIGIvWmVuZC96ZW5kX3N0cmVhbS5jCkBA
IC0zMCw3ICszMCwxMSBAQAogIyBpZiBIQVZFX1VOSVNURF9ICiAjICBpbmNs
dWRlIDx1bmlzdGQuaD4KICMgIGlmIGRlZmluZWQoX1NDX1BBR0VTSVpFKQor
IyAgIGlmZGVmIF9fQ1lHV0lOX18KKyMgICAgZGVmaW5lIFJFQUxfUEFHRV9T
SVpFIDQwOTYKKyMgICBlbHNlCiAjICAgIGRlZmluZSBSRUFMX1BBR0VfU0la
RSBzeXNjb25mKF9TQ19QQUdFU0laRSk7CisjICAgZW5kaWYKICMgIGVsaWYg
ZGVmaW5lZChfU0NfUEFHRV9TSVpFKQogIyAgICBkZWZpbmUgUkVBTF9QQUdF
X1NJWkUgc3lzY29uZihfU0NfUEFHRV9TSVpFKTsKICMgIGVuZGlmCmRpZmYg
LS1naXQgYS9tYWluL21haW4uYyBiL21haW4vbWFpbi5jCmluZGV4IDAxZWQz
YTYuLjA5MDkzMDkgMTAwNjQ0Ci0tLSBhL21haW4vbWFpbi5jCisrKyBiL21h
aW4vbWFpbi5jCkBAIC05Niw3ICs5NiwxMSBAQAogIyBpZiBIQVZFX1VOSVNU
RF9ICiAjICBpbmNsdWRlIDx1bmlzdGQuaD4KICMgIGlmIGRlZmluZWQoX1ND
X1BBR0VTSVpFKQorIyAgIGlmZGVmIF9fQ1lHV0lOX18KKyMgICAgZGVmaW5l
IFJFQUxfUEFHRV9TSVpFIDQwOTYKKyMgICBlbHNlCiAjICAgIGRlZmluZSBS
RUFMX1BBR0VfU0laRSBzeXNjb25mKF9TQ19QQUdFU0laRSk7CisjICAgZW5k
aWYKICMgIGVsaWYgZGVmaW5lZChfU0NfUEFHRV9TSVpFKQogIyAgICBkZWZp
bmUgUkVBTF9QQUdFX1NJWkUgc3lzY29uZihfU0NfUEFHRV9TSVpFKTsKICMg
IGVuZGlmCg==

--------------3B4A87F4E885148F84806326
Content-Type: text/plain; charset=UTF-8;
 name="php-cygport-page-size.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="php-cygport-page-size.patch"

LS0tIHBocC5jeWdwb3J0CTIwMTctMDUtMTQgMDk6Mjc6MDQuMDAwMDAwMDAw
ICswMTAwCisrKyBwaHAtbmV3LmN5Z3BvcnQJMjAxNy0wNS0yMCAxODoxODo0
NS45Mzc4MjM2MDAgKzAxMDAKQEAgLTM1LDYgKzM1LDcgQEAKIAk1LjYuNi1m
aXgtbGlidG9vbGl6ZS5wYXRjaAogCTUuNi45LWFwYWNoZTJoYW5kbGVyLXp0
cy5wYXRjaAogCTcuMC4xNy1wY3JlLWppdC1vZmYucGF0Y2gKKwlwaHAtNy4w
LjE5LXBhZ2Utc2l6ZS5wYXRjaAogIgogCiBESUZGX0VYQ0xVREVTPSJhY2xv
Y2FsLm00IGNvbmZpZ3VyZSBnZW5lcmF0ZWRfbGlzdHMgbGlidG9vbC5tNCBs
dCoubTQgbHRtYWluLnNoIHBocF9jb25maWcuaC5pbiBwaHBfdmVyc2lvbi5o
IHRlc3RzIgo=

--------------3B4A87F4E885148F84806326
Content-Type: text/plain; charset=UTF-8;
 name="dependencies"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="dependencies"

YXBhY2hlMi1kZXZlbApjLWNsaWVudApjeWdwb3J0CmxpYmFzcGVsbC1kZXZl
bApsaWJhdHRyLWRldmVsCmxpYmNyb2NvMC42LWRldmVsCmxpYmN1cmwtZGV2
ZWwKbGliZWRpdC1kZXZlbApsaWJlbmNoYW50LWRldmVsCmxpYmZhbS1kZXZl
bApsaWJmZmktZGV2ZWwKbGliZ2QtZGV2ZWwKbGliZ2RibS1kZXZlbApsaWJn
bGFwaS1kZXZlbApsaWJnbnV0bHMtZGV2ZWwKbGliZ3MtZGV2ZWwKbGliZ3Rr
Mi4wLWRldmVsCmxpYmd0cy1kZXZlbApsaWJndWlsZTEuOC1kZXZlbApsaWJn
dWlsZTIuMC1kZXZlbApsaWJndmMtZGV2ZWwKbGliaHVuc3BlbGwtZGV2ZWwK
bGliaWN1LWRldmVsCmxpYmlkbjItZGV2ZWwKbGliaXNsLWRldmVsCmxpYmph
c3Blci1kZXZlbApsaWJrcmI1LWRldmVsCmxpYkxBU2ktZGV2ZWwKbGlibGNt
cy1kZXZlbApsaWJsbHZtLWRldmVsCmxpYmx6bzItZGV2ZWwKbGlibWNyeXB0
LWRldmVsCmxpYm1pbmctZGV2ZWwKbGlibXBjLWRldmVsCmxpYm1wZnItZGV2
ZWwKbGlibmdodHRwMi1kZXZlbApsaWJuc3MtZGV2ZWwKbGlib25pZy1kZXZl
bApsaWJvcGVuanAyLWRldmVsCmxpYm9wZW5qcGVnLWRldmVsCmxpYnBuZzEy
LWRldmVsCmxpYnBvcHBsZXItZGV2ZWwKbGlicHEtZGV2ZWwKbGlicHNsLWRl
dmVsCmxpYnJlYWRsaW5lLWRldmVsCmxpYnJzdmcyLWRldmVsCmxpYnNpZ3Nl
Z3YtZGV2ZWwKbGlic3FsaXRlMy1kZXZlbApsaWJzc2gyLWRldmVsCmxpYnN5
YmRiLWRldmVsCmxpYnRoYWktZGV2ZWwKbGlidGlkeS1kZXZlbApsaWJ0eGNf
ZHh0bi1kZXZlbApsaWJ1bmlzdHJpbmctZGV2ZWwKbGlidm9pa2tvLWRldmVs
CmxpYndlYnAtZGV2ZWwKbGlieHNsdC1kZXZlbApsaWJ6aXAtZGV2ZWwKcmVj
b2RlCg==


--------------3B4A87F4E885148F84806326
Content-Type: text/plain; charset=us-ascii


--
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
--------------3B4A87F4E885148F84806326--

- Raw text -


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