This commit should fix the problem 
https://github.com/php/php-src/commit/5ef10d08ec2d0823fb21ad189dacfb43d900a0b5


Thanks. Dmitry.

________________________________
From: Dmitry Stogov <dmi...@zend.com>
Sent: Monday, September 18, 2017 7:29:24 PM
To: Giovanni Giacobbi; PHP Internals List
Subject: Re: [PHP-DEV] PCRE JIT broken in PHP 7.2

[This sender failed our fraud detection checks and may not be who they appear 
to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]

The problem may be caused by "incorrect" dynamic linking to different libpcre 
instances.

e.g one libbcre is use by Apache or some Apache module and another is embedded 
into PHP.


The backtrace would be useful, to prove this guess.


Thanks. Dmitry.


________________________________
From: giovann...@gmail.com <giovann...@gmail.com> on behalf of Giovanni 
Giacobbi <giova...@giacobbi.net>
Sent: Monday, September 18, 2017 2:28:35 PM
To: PHP Internals List
Subject: [PHP-DEV] PCRE JIT broken in PHP 7.2

Greetings,

just an heads up, I started testing my project with PHP 7.2.0RC2 but it was
causing a segmentation fault.

I tracked down the problem to preg_match(), in particular when JIT is
enabled and ONLY when running through Apache2 with event MPM. This problem
does not occur with command line invocation.

Here are the versions I tested, same environment:
7.1.9  works with PCRE JIT enabled
7.2.0alpha1   broken
7.2.0rc2  broken

Build command line:
./configure \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --with-fpm-user=httpd \
  --with-fpm-group=httpd \
  --disable-cgi \
  --enable-intl \
  --with-layout=GNU \
  --enable-maintainer-zts \
  --with-gettext=static \
  --with-iconv \
  --with-mysqli=mysqlnd \
  --enable-exif \
  --with-openssl \
  --with-curl

The effect i observed is the following:

var_dump(preg_match('/^a/', "a"));    => int(0)
var_dump(preg_match('/a/', "a"));     => segmentation fault

If you need any further information let me know.

Kind regards

--
Giovanni Giacobbi

Reply via email to