Bug #81647 [Com]: regex times out when pcre.jit is enabled
| From: | jack dot johansson at yahoo dot com | Date: | Mon, 22 Nov 2021 09:58:13 +0000 |
| Subject: | Bug #81647 [Com]: regex times out when pcre.jit is enabled | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-237904@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81647&edit=1
ID: 81647
Comment by: jack dot johansson at yahoo dot com
Reported by: jack dot johansson at yahoo dot com
Summary: regex times out when pcre.jit is enabled
Status: Feedback
Type: Bug
Package: PCRE related
Operating System: Windows 11 22000.194
PHP Version: 8.1.0RC6
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I'm using the same version, 10.37 2021-05-26. It's bundled into this release on
windows.php.net:
https://windows.php.net/downloads/qa/php-8.1.0RC6-Win32-vs16-x64.zip
Would you please take a look at the issue on the github link that I posted? There was someone with a
similar issue too.
Previous Comments:
------------------------------------------------------------------------
[2021-11-22 09:34:55] cmb@php.net
I can't reproduce this with the bundled libpcre2[1]. Which
libpcre2 version do you use?
[1] <https://3v4l.org/WBdZJ>
------------------------------------------------------------------------
[2021-11-21 21:15:24] jack dot johansson at yahoo dot com
Description:
------------
I've recently installed PHP 8.1.0RC6 and Laravel 9 to test some new features. After requests
resulted in a connection reset, I've submitted this bug on the Laravel repository:
https://github.com/laravel/framework/issues/39716
Tracing the issue ended up to a regex, which crashed Apache when the pcre.jit was set to 1 in the
ini file ( or commented out ).
I'm using the latest version of Apache ( 2.4.51 ).
Turning off the pcre.jit solves the issue. I'm not sure if this is a PHP issue, but I'm
submitting a bug just in case.
Test script:
---------------
<?php
var_dump(
preg_match(
'(([\\r\\n]{1,1000})|([^\\S\\r\\n]{1,1000})|(\\\\)|(\')|(")|(\\#)|(\\$)|(([^(\\s\\\\\'"\\#\\$)]|\\(|\\)){1,1000}))A',
'Laravel',
$matches
)
);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81647&edit=1