|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81647 regex times out when pcre.jit is enabled
Submitted: 2021-11-21 21:15 UTC Modified: 2021-11-22 13:38 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jack dot johansson at yahoo dot com Assigned: cmb (profile)
Status: Not a bug Package: PCRE related
PHP Version: 8.1.0RC6 OS: Windows 11 22000.194
Private report: No CVE-ID: None
 [2021-11-21 21:15 UTC] jack dot johansson at yahoo dot com
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:

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:



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-22 09:34 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-11-22 09:34 UTC]
I can't reproduce this with the bundled libpcre2[1].  Which
libpcre2 version do you use?

[1] <>
 [2021-11-22 09:58 UTC] jack dot johansson at yahoo dot com
I'm using the same version, 10.37 2021-05-26. It's bundled into this release on

Would you please take a look at the issue on the github link that I posted? There was someone with a similar issue too.
 [2021-11-22 10:13 UTC]
-Status: Feedback +Status: Verified
 [2021-11-22 10:13 UTC]
Thanks for the swift reply!  I can confirm the crash when running
mod_php, but not on CLI.  I'll have a look.
 [2021-11-22 13:38 UTC]
-Status: Verified +Status: Not a bug
 [2021-11-22 13:38 UTC]
This is a stack overflow due to too deep nesting[1], because of
the nature of that regex.  It is not related to a recent patch to
our bundled libpcre2[2].  Consider to report it upstream[3], but
I'm not sure whether that can be fixed (by falling back to non JIT

[1] <>
[2] <>
[3] <>
 [2021-11-23 08:11 UTC] jack dot johansson at yahoo dot com
Thank you @cmb. I've posted an issue on their repository, alongside the links to this post and Laravel's. Here's a link for future reference:
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jan 26 09:03:33 2022 UTC