|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-12-07 13:42 UTC] ettore at themecraft dot studio
Description: ------------ I'm experiencing an intermittent issue with WordPress 5.0 running on PHP 7.3.0: [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/functions.php on line 4885 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/functions.php on line 4781 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/functions.php on line 4885 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/l10n.php on line 1202 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/functions.php on line 4885 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/l10n.php on line 1235 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/class-requests.php on line 563 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/Requests/IRI.php on line 329 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/Requests/IRI.php on line 764 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_replace_callback(): JIT compilation failed: no more memory in wp-includes/Requests/IRI.php on line 422 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/Requests/IRI.php on line 425 [07-Dec-2018 13:37:11 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/Requests/IDNAEncoder.php on line 115 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/class-requests.php on line 652 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/class-requests.php on line 654 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/class-requests.php on line 667 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/class-requests.php on line 752 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/functions.php on line 4885 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace_callback(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 4382 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace_callback(): JIT compilation failed: no more memory in wp-includes/kses.php on line 724 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/option.php on line 900 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/general-template.php on line 705 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match_all(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 229 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_split(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 235 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 289 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 295 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/admin-header.php on line 75 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/option.php on line 1021 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/admin-header.php on line 163 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/menu-header.php on line 14 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/menu-header.php on line 15 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/menu-header.php on line 16 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/menu-header.php on line 17 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/menu-header.php on line 108 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 4674 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 4549 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/functions.php on line 111 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/functions.php on line 112 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/functions.php on line 113 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/functions.php on line 114 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/functions.php on line 115 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-includes/functions.php on line 116 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/functions.php on line 122 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_split(): JIT compilation failed: no more memory in wp-admin/includes/class-core-upgrader.php on line 239 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_replace(): JIT compilation failed: no more memory in wp-admin/update-core.php on line 220 [07-Dec-2018 13:37:12 UTC] PHP Warning: preg_match(): JIT compilation failed: no more memory in wp-includes/formatting.php on line 4768 I am not able to reproduce the issue by singling out any specific preg_* function and parameters. The ony way I can reproduce the issue is with a clean install of WordPress 5.0. Below there's php -i: PHP Version => 7.3.0 System => Darwin iMac.local 17.7.0 Darwin Kernel Version 17.7.0: Wed Oct 10 23:06:14 PDT 2018; root:xnu-4570.71.13~1/RELEASE_X86_64 x86_64 Build Date => Dec 7 2018 12:22:53 Configure Command => './configure' '--prefix=/Users/ettore/.php/7.3.0' '--with-config-file-path=/Users/ettore/.php' '--enable-cli' '--with-apxs2' '--disable-cgi' '--without-pear' '--enable-pcntl' '--enable-bcmath' '--enable-mbstring' '--enable-intl' '--enable-soap' '--enable-zip' '--with-libzip' '--with-zlib-dir=/usr' '--with-pdo-mysql' '--with-mysqli' '--with-curl' '--with-openssl=/usr/local/opt/openssl' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-libedit' '--with-xsl' '--with-libxml-dir=/usr/local/opt/libxml2' '--with-xmlrpc' '--with-gmp' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /Users/ettore/.php Loaded Configuration File => /Users/ettore/.php/php.ini Scan this dir for additional .ini files => (none) Additional .ini files parsed => (none) PHP API => 20180731 PHP Extension => 20180731 Zend Extension => 320180731 Zend Extension Build => API320180731,NTS PHP Extension Build => API20180731,NTS Debug Build => no Thread Safety => disabled Zend Signal Handling => enabled Zend Memory Manager => enabled Zend Multibyte Support => provided by mbstring IPv6 Support => enabled DTrace Support => disabled Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2 Registered Stream Filters => zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk This program makes use of the Zend Scripting Language Engine: Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies php.ini: [PHP] short_open_tag = Off max_execution_time = 600 memory_limit = 512M post_max_size = 256M upload_max_filesize = 128M error_reporting = E_ALL display_errors = On display_startup_errors = On log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = On request_order = "GP" zend.assertions = 1 assert.exception = On pcre.jit = On [CLI Server] cli_server.color = On [mysqlnd] mysqlnd.collect_statistics = On mysqlnd.collect_memory_statistics = On [Xdebug] ;zend_extension = xdebug.so xdebug.remote_enable = 1 xdebug.profiler_output_dir=/Users/ettore/Workspace/xdebug_profiling xdebug.profiler_output_name=%u.%R xdebug.profiler_enable_trigger=1 ;xdebug.remote_log = /Users/ettore/Workspace/xdebug/xdebug.log xdebug.var_display_max_data = 2048 NOTICE that the issue appears with both XDebug 2.7.0beta1 disabled and enabled. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 00:00:02 2025 UTC |
I have same problem with php 7.3 installed via homebrew on mojave (both with bottle package or compiled from source). If i use xdebug extension no page can be viewed (php-fpm kill the child process). If use php from command line without xdebug php works but kill when I use pcre functions. Also if I use psysh (REPL cli) php crash on every command. In all cases the code "crashed on child side of fork pre-exec" on php_pcre2_jit_compile or php_pcre2_jit_match. This is a crash report: Process: php [24544] Path: /usr/local/Cellar/php/7.3.0/bin/php Identifier: php Version: 0 Code Type: X86-64 (Native) Parent Process: ??? [24543] Responsible: php [24544] User ID: 501 Date/Time: 2018-12-07 21:58:04.395 +0100 OS Version: Mac OS X 10.14.2 (18C54) Report Version: 12 Bridge OS Version: 3.2 (16P2542) System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000106928478 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [24544] VM Regions Near 0x106928478: MALLOC_LARGE 0000000106828000-0000000106918000 [ 960K] rw-/rwx SM=COW --> VM_ALLOCATE 0000000106a00000-0000000107000000 [ 6144K] rw-/rwx SM=COW Application Specific Information: crashed on child side of fork pre-exec Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 php 0x0000000102d4a4fe jit_compile + 42782 1 php 0x0000000102d3fd82 php_pcre2_jit_compile + 78 2 php 0x0000000102d8371b pcre_get_compiled_regex_cache + 1808 3 php 0x0000000102d8725b php_do_pcre_match + 203 4 php 0x00000001030f4116 ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER + 81 5 php 0x00000001030abd32 execute_ex + 98 6 php 0x00000001030abeae zend_execute + 318 7 php 0x0000000103070cfa zend_execute_scripts + 277 8 php 0x000000010301c58f php_execute_script + 639 9 php 0x000000010311c78b do_cli + 3857 10 php 0x000000010311b70c main + 1108 11 libdyld.dylib 0x00007fff7a21ced9 start + 1I'm afraid that this bug report has ended up as a meta-issues for all kinds of mmap failures in pcre jit, which may not all have the same root cause. I think the original problem and what is affecting macOS users is the fact that PCRE2 has introduced use of MAP_JIT to be compatible with macOS 10.14. However, MAP_JIT is badly broken on macOS 10.13. We need to backport the following diff from PCRE2 10.33 to the 7.3 branch: diff --git a/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c b/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c index 7c18578618cf..3b37a9751f81 100644 --- a/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c +++ b/ext/pcre/pcre2lib/sljit/sljitExecAllocator.c @@ -94,6 +94,46 @@ static SLJIT_INLINE void free_chunk(void *chunk, sljit_uw size) #else +#ifdef __APPLE__ +/* Configures TARGET_OS_OSX when appropriate */ +#include <TargetConditionals.h> + +#if TARGET_OS_OSX && defined(MAP_JIT) +#include <sys/utsname.h> +#endif /* TARGET_OS_OSX && MAP_JIT */ + +#ifdef MAP_JIT + +static SLJIT_INLINE int get_map_jit_flag() +{ +#if TARGET_OS_OSX + /* On macOS systems, returns MAP_JIT if it is defined _and_ we're running on a version + of macOS where it's OK to have more than one JIT block. On non-macOS systems, returns + MAP_JIT if it is defined. */ + static int map_jit_flag = -1; + + /* The following code is thread safe because multiple initialization + sets map_jit_flag to the same value and the code has no side-effects. + Changing the kernel version witout system restart is (very) unlikely. */ + if (map_jit_flag == -1) { + struct utsname name; + + uname(&name); + + /* Kernel version for 10.14.0 (Mojave) */ + map_jit_flag = (atoi(name.release) >= 18) ? MAP_JIT : 0; + } + + return map_jit_flag; +#else /* !TARGET_OS_OSX */ + return MAP_JIT; +#endif /* TARGET_OS_OSX */ +} + +#endif /* MAP_JIT */ + +#endif /* __APPLE__ */ + static SLJIT_INLINE void* alloc_chunk(sljit_uw size) { void *retval; @@ -103,17 +143,17 @@ static SLJIT_INLINE void* alloc_chunk(sljit_uw size) int flags = MAP_PRIVATE | MAP_ANON; #ifdef MAP_JIT - flags |= MAP_JIT; + flags |= get_map_jit_flag(); #endif retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, -1, 0); -#else +#else /* !MAP_ANON */ if (dev_zero < 0) { if (open_dev_zero()) return NULL; } retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, dev_zero, 0); -#endif +#endif /* MAP_ANON */ return (retval != MAP_FAILED) ? retval : NULL; }