Bug #81647 [NEW]: regex times out when pcre.jit is enabled

From: Date: Sun, 21 Nov 2021 21:15:24 +0000
Subject: Bug #81647 [NEW]: regex times out when pcre.jit is enabled
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237899@lists.php.net to get a copy of this message
From:             jack dot johansson at yahoo dot com
Operating system: Windows 11 22000.194
PHP version:      8.1.0RC6
Package:          PCRE related
Bug Type:         Bug
Bug description:regex times out when pcre.jit is enabled

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 bug report at https://bugs.php.net/bug.php?id=81647&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81647&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81647&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81647&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81647&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81647&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81647&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81647&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81647&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81647&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81647&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81647&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81647&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81647&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81647&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81647&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81647&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81647&r=mysqlcfg


Thread (6 messages)

« previous php.bugs (#237899) next »