Re: [ATTN: Yaakov Selkowitz / PHP maintainer] Re: Composer segfault on multiple configurations

2017-05-30 Thread Vince Rice
>> On May 30, 2017, at 11:47 AM, Richard H Lee wrote:
>> 
>> Yaakov,
>> 
>> I probably should have copied you in on the last message to get your 
>> attention.
>> 
>> It's just a simple patch to fix this page size issue with php on Cygwin. 
>> Would be grateful if you could review and possibly accept this patch, as it 
>> has been confirmed and does affect several people.

> On May 30, 2017, at 1:59 PM, Vince Rice  wrote:
> 
> I'm sure he will tell you himself soon enough, but no you shouldn't have. 
> Emails re packages should go to the list, not to the package maintainers 
> directly. If you want to ping a previous message, ping the list, not the 
> person.

And of course I realized too late I TOFU'd… Sorry about that.
--
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



Re: [ATTN: Yaakov Selkowitz / PHP maintainer] Re: Composer segfault on multiple configurations

2017-05-30 Thread Vince Rice
I'm sure he will tell you himself soon enough, but no you shouldn't have. 
Emails re packages should go to the list, not to the package maintainers 
directly. If you want to ping a previous message, ping the list, not the person.


> On May 30, 2017, at 11:47 AM, Richard H Lee wrote:
> 
> Yaakov,
> 
> I probably should have copied you in on the last message to get your 
> attention.
> 
> It's just a simple patch to fix this page size issue with php on Cygwin. 
> Would be grateful if you could review and possibly accept this patch, as it 
> has been confirmed and does affect several people.
> 
> 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



Re: [ATTN: Yaakov Selkowitz / PHP maintainer] Re: Composer segfault on multiple configurations

2017-05-30 Thread Richard H Lee

Yaakov,

I probably should have copied you in on the last message to get your 
attention.


It's just a simple patch to fix this page size issue with php on Cygwin. 
Would be grateful if you could review and possibly accept this patch, as 
it has been confirmed and does affect several people.


Richard
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

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

Re: Memcache/d (Orig: Re: Composer segfault on multiple configurations)

2017-05-27 Thread Sky Diver
On Fri, May 26, 2017 at 12:11 AM, Richard H Lee wrote:
> On 25/05/2017 08:50, Sky Diver wrote:
> PHP 5.5.9, PHP 5.6.2 on Cygwin?
> Were they even released on Cygwin?
Sure did. Requires a bit of digging through the "cygwin time machine"
archive but they are all there.

> Unfortunately, I think memcache is a separate package from php and it would
> not be compiled in by cygports.
Due to an accident, I happened to delete my entire C:\cygwin\bin
directory a few days back when installing and re-installing various
cygwin versions.
Currently I can't get Memcache to work anymore, but I definitely had
Memcache-related code running under cygwin with no problems.

> For most websites memcache/d is optional. If the website detects that
> memcache/d is not present during setup, it simply does not use it.
I agree with that and I guess the fastest solution would be to use
Memcache (or Memcachd or apc_*()) if present or ignore if it's not.

Thank you.

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



Memcache/d (Orig: Re: Composer segfault on multiple configurations)

2017-05-25 Thread Richard H Lee

On 25/05/2017 08:50, Sky Diver wrote:

Since then I went back in time and installed PHP 5.5.9, PHP 5.6.20 but
the result is the same.

PHP 5.5.9, PHP 5.6.2 on Cygwin?
Were they even released on Cygwin?


So I might end up following your steps in order to build PHP, hoping I
could enable built-in memcache support while at it (Bash on Ubuntu on
Windows, for example, has memcache and memcached included out of the
box).
Unfortunately, I think memcache is a separate package from php and it 
would not be compiled in by cygports.


From what I read memcache is rather unmaintained and should be 
deprecated. Memcached should be used instead.

https://github.com/oerdnj/deb.sury.org/issues/186#issuecomment-186217296

Memcache can't really be compiled for php7. Memcached can be. Taking a 
quick look at memcached, the memcached server compiles fine on cygwin 
except for one minor printf statement. Libmemcached, which php-memcached 
relies upon, requires a little bit more work (it's that whole "undefined 
symbols in shared libraries" thing). You possibly may want to consider 
moving your code from memcache to memcached.


For most websites memcache/d is optional. If the website detects that 
memcache/d is not present during setup, it simply does not use it. 
Usually people just don't use it for development and then turn it on for 
production. That is unless you specifically want to run memcache/d code 
on Cygwin.


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



Re: Composer segfault on multiple configurations

2017-05-25 Thread Sky Diver
On Mon, May 22, 2017 at 9:38 PM, Richard H Lee wrote:
> Just in case Sky Diver or anyone else is interested in compiling php from
> Cygports, here are some simple steps to do so.

Thanks Richard, I may try this at some point, but am currently
experiencing other instabilities.
For some reason, I started getting the message "Class 'Memcache' not
found" when running memcache-aware PHP code.
Since then I went back in time and installed PHP 5.5.9, PHP 5.6.20 but
the result is the same.
There's no php-memcache extension to install (on Ubuntu, for example,
that's the way to add it).
I'm pretty sure I didn't go through the "pecl install memcache"
process, and doing so now fails during compilation.

So I might end up following your steps in order to build PHP, hoping I
could enable built-in memcache support while at it (Bash on Ubuntu on
Windows, for example, has memcache and memcached included out of the
box).

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



Re: Composer segfault on multiple configurations

2017-05-22 Thread Richard H Lee

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.




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
--- php.cygport 2017-05-14 09:27:04.0 +0100
+++ php-new.cygport 2017-05-20 18:18:45.937823600 +0100
@@ -35,6 +35,7 @@
5.6.6-fix-libtoolize.patch
5.6.9-apache2handler-zts.patch
7.0.17-pcre-jit-off.patch
+   php-7.0.19-page-size.patch
 "
 
 DIFF_EXCLUDES="aclocal.m4 configure generated_lists libtool.m4 lt*.m4 
ltmain.sh php_config.h.in php_version.h tests"
apache2-devel
c-client
cygport
libaspell-devel
libattr-devel
libcroco0.6-devel
libcurl-devel
libedit-devel
libenchant-devel
libfam-devel
libffi-devel
libgd-devel
libgdbm-devel
libglapi-devel
libgnutls-devel
libgs-devel
libgtk2.0-devel
libgts-devel
libguile1.8-devel
libguile2.0-devel
libgvc-devel
libhunspell-devel
libicu-devel
libidn2-devel
libisl-devel
libjasper-devel
libkrb5-devel
libLASi-devel
liblcms-devel
libllvm-devel
liblzo2-devel
libmcrypt-devel
libming-devel
libmpc-devel
libmpfr-devel
libnghttp2-devel
libnss-devel
libonig-devel
libopenjp2-devel
libopenjpeg-devel
libpng12-devel
libpoppler-devel
libpq-devel
libpsl-devel

[ATTN: Yaakov Selkowitz / PHP maintainer] Re: Composer segfault on multiple configurations

2017-05-19 Thread Richard H Lee

On 18/05/2017 08:42, Sky Diver wrote:

Any idea when your fix will get released as an official cygwin PHP
package?


Hi Yaakov,

I can see you're really busy with package maintenance and all, but I was
wondering if you could review and merge my patch for this issue. It's
basically changing the definition of the page size in two places.


Richard
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

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

Re: Composer segfault on multiple configurations

2017-05-18 Thread Sky Diver
On Thu, May 18, 2017 at 3:34 PM, Andrey Repin wrote:
> Please don't top-post, and don't quote raw email addresses.
Fair enough.

On Thu, May 18, 2017 at 3:59 PM, Richard H Lee wrote:
> On 18/05/2017 13:34, Andrey Repin wrote:
>>
>> Try turning pcre.jit off, it was known to be a problem in the past.
>
>
> This is already turned off in the cygport patches.

I'm not sure if Richard is referring to a released version or a
manually compiled one, but prior to posting my issue I already went
over earlier discussions regarding pcre.jit.
This is the configuration in my php.ini:
pcre.jit=0

I assume this means it's off.

On Thu, May 18, 2017 at 3:34 PM, Andrey Repin  wrote:
> Greetings, Sky Diver!
>
> Please don't top-post, and don't quote raw email addresses.
>
>> On Wed, May 17, 2017 at 11:24 PM, Richard H Lee wrote:
>>> On 17/05/2017 20:17, Sky Diver wrote:

 Running "composer install" with the following composer.json ends up in
 a segmentation fault.

 -- START ---
 {
  "require": {
  "propel/propel": "~2.0@dev"
  },
  "config": {
  "optimize-autoloader": true
  }
 }
 -- END -

 (*) Note: when "optimize-autoloader" is set to false the error doesn't
 occur.
>>>
>>> I think this may be to do with the 4096 error bug.
>>>
>>> Composer will pull in the files and run them. One of them is:
>>> vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php
>>>
>>> From you project directory, try running:
>>> php vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php
>>>
>>> That probably will give you a segfault. I'm not sure if changing the
>>> filesize will help, because composer probably will fetch a fresh copy of
>>> the file.
>>>
>>> I did provide a small patch a few weeks ago. That might help. You'd need
>>> to recompile and install php though cygports to use it.
>
>> Thanks Richard, you've hit the nail right on the head.
>> Running PHP on that specific file does produce the segfault.
>
>> I'm currently running composer via "Bash on Ubuntu on Windows". I may
>> compile PHP from cygports later but currently I need to make up for
>> lost time at work over this.
>> Any idea when your fix will get released as an official cygwin PHP package?
>
>> Thanks again.
>
> Try turning pcre.jit off, it was known to be a problem in the past.
>
>
> --
> With best regards,
> Andrey Repin
> Thursday, May 18, 2017 15:31:02
>
> Sorry for my terrible english...
>

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



Re: Composer segfault on multiple configurations

2017-05-18 Thread Richard H Lee

On 18/05/2017 13:34, Andrey Repin wrote:

Try turning pcre.jit off, it was known to be a problem in the past.


This is already turned off in the cygport patches.

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



Re: Composer segfault on multiple configurations

2017-05-18 Thread Andrey Repin
Greetings, Sky Diver!

Please don't top-post, and don't quote raw email addresses.

> On Wed, May 17, 2017 at 11:24 PM, Richard H Lee wrote:
>> On 17/05/2017 20:17, Sky Diver wrote:
>>>
>>> Running "composer install" with the following composer.json ends up in
>>> a segmentation fault.
>>>
>>> -- START ---
>>> {
>>>  "require": {
>>>  "propel/propel": "~2.0@dev"
>>>  },
>>>  "config": {
>>>  "optimize-autoloader": true
>>>  }
>>> }
>>> -- END -
>>>
>>> (*) Note: when "optimize-autoloader" is set to false the error doesn't
>>> occur.
>>
>> I think this may be to do with the 4096 error bug.
>>
>> Composer will pull in the files and run them. One of them is:
>> vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php
>>
>> From you project directory, try running:
>> php vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php
>>
>> That probably will give you a segfault. I'm not sure if changing the
>> filesize will help, because composer probably will fetch a fresh copy of
>> the file.
>>
>> I did provide a small patch a few weeks ago. That might help. You'd need
>> to recompile and install php though cygports to use it.

> Thanks Richard, you've hit the nail right on the head.
> Running PHP on that specific file does produce the segfault.

> I'm currently running composer via "Bash on Ubuntu on Windows". I may
> compile PHP from cygports later but currently I need to make up for
> lost time at work over this.
> Any idea when your fix will get released as an official cygwin PHP package?

> Thanks again.

Try turning pcre.jit off, it was known to be a problem in the past.


-- 
With best regards,
Andrey Repin
Thursday, May 18, 2017 15:31:02

Sorry for my terrible english...


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



Re: Composer segfault on multiple configurations

2017-05-18 Thread Sky Diver
Thanks Richard, you've hit the nail right on the head.
Running PHP on that specific file does produce the segfault.

I'm currently running composer via "Bash on Ubuntu on Windows". I may
compile PHP from cygports later but currently I need to make up for
lost time at work over this.
Any idea when your fix will get released as an official cygwin PHP package?

Thanks again.

On Wed, May 17, 2017 at 11:24 PM, Richard H Lee
 wrote:
> On 17/05/2017 20:17, Sky Diver wrote:
>>
>> Running "composer install" with the following composer.json ends up in
>> a segmentation fault.
>>
>> -- START ---
>> {
>>  "require": {
>>  "propel/propel": "~2.0@dev"
>>  },
>>  "config": {
>>  "optimize-autoloader": true
>>  }
>> }
>> -- END -
>>
>> (*) Note: when "optimize-autoloader" is set to false the error doesn't
>> occur.
>
> I think this may be to do with the 4096 error bug.
>
> Composer will pull in the files and run them. One of them is:
> vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php
>
> From you project directory, try running:
> php vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php
>
> That probably will give you a segfault. I'm not sure if changing the
> filesize will help, because composer probably will fetch a fresh copy of
> the file.
>
> I did provide a small patch a few weeks ago. That might help. You'd need
> to recompile and install php though cygports to use it.
>
> --
> 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
>

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



Re: Composer segfault on multiple configurations

2017-05-17 Thread Richard H Lee

On 17/05/2017 20:17, Sky Diver wrote:

Running "composer install" with the following composer.json ends up in
a segmentation fault.

-- START ---
{
 "require": {
 "propel/propel": "~2.0@dev"
 },
 "config": {
 "optimize-autoloader": true
 }
}
-- END -

(*) Note: when "optimize-autoloader" is set to false the error doesn't occur.

I think this may be to do with the 4096 error bug.

Composer will pull in the files and run them. One of them is:
vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php

From you project directory, try running:
php vendor/propel/propel/src/Propel/Runtime/DataFetcher/PDODataFetcher.php

That probably will give you a segfault. I'm not sure if changing the
filesize will help, because composer probably will fetch a fresh copy of
the file.

I did provide a small patch a few weeks ago. That might help. You'd need
to recompile and install php though cygports to use it.

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