Bug #78630 [Opn]: PHP 7.3 preg_match(): JIT compilation failed: no more memory (need pcre.jit=0)

From: Date: Thu, 03 Oct 2019 20:17:31 +0000
Subject: Bug #78630 [Opn]: PHP 7.3 preg_match(): JIT compilation failed: no more memory (need pcre.jit=0)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223030@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78630&edit=1

 ID:                 78630
 Updated by:         nikic@php.net
 Reported by:        ilya at ilya dot pp dot ua
 Summary:            PHP 7.3 preg_match(): JIT compilation failed: no
                     more memory (need pcre.jit=0)
 Status:             Open
 Type:               Bug
 Package:            PCRE related
 Operating System:   openSuse Tumbleweed
 PHP Version:        7.3.10
 Block user comment: N
 Private report:     N

 New Comment:

Do you know how opensuse builds pcre2? Do they use the bundled PHP library, or do they build a
separate pcre2 library and link PHP against it? I'm assuming it's the latter.

Do you know if there is any security mechanism (such as SELinux) that might prevent the allocation
of writable executable memory?

If such a mechanism exists and is enabled by default, is pcre2 being compiled with
-DSLJIT_PROT_EXECUTABLE_ALLOCATOR=1, as is necessary to avoid W+X mmaps?

Finally, do you know whether the first preg_* call already fails, or are there any preg_* calls that
succeed before the first failure?


Previous Comments:
------------------------------------------------------------------------
[2019-10-03 20:08:57] ilya at ilya dot pp dot ua

Description:
------------
https://bugzilla.suse.com/show_bug.cgi?id=1124446
In PHP 7.3 using pcre2 and using by default JIT compilation (pcre.jit=1)
This leads to errors on phpMyAdmin login page like:
Warning in ./libraries/classes/Config.php#201 preg_match(): JIT compilation failed: no more memory
mod_fcgid: stderr: PHP Warning:  preg_replace_callback(): JIT compilation failed: no more memory
And for everything that uses preg_*() functions.

php: 7.3.10
pcre2: 10.33
Server: Apache (mpm_event) + mod_fcgid + php-fastcgi
If necessary, I will attach more information.

Test script:
---------------
phpMyAdmin latest version (4.9.1) login page and show this page and apache error_log
Server: Apache (mpm_event) + mod_fcgid + php-fastcgi

Expected result:
----------------
No errors.

Actual result:
--------------
Error on phpMyAdmin login page
Warning in ./libraries/classes/Config.php#201 preg_match(): JIT compilation failed: no more memory
And in apache error_log
mod_fcgid: stderr: PHP Warning:  preg_replace_callback(): JIT compilation failed: no more memory



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78630&edit=1


Thread (34 messages)

« previous php.bugs (#223030) next »