To some extent minimal testcase in https://bugs.php.net/bug.php?id=78927 :/182864 # cat test.php <?php function regex() { preg_match('/(foo)(bar)(baz)/', 'foobarbaz', $matches, PREG_OFFSET_CAPTURE); } regex(); $pid = pcntl_fork(); if ($pid == -1) { die('error.'); } else if ($pid) { echo 'parent... '; pcntl_wait($pid); echo 'wait done'; } else { echo 'child.'; } ?> :/182864 # valgrind -q php test.php [..] parent... child. wait done ==21579== ==21579== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==21579== Bad permissions for mapped region at address 0x531E5C0 ==21579== at 0x4BAC4DB: ??? (in /usr/lib64/libpcre2-8.so.0.10.1) ==21579== by 0x4BE3FE2: ??? (in /usr/lib64/libpcre2-8.so.0.10.1) ==21579== by 0x4B92A19: pcre2_code_free_8 (in /usr/lib64/libpcre2-8.so.0.10.1) ==21579== by 0x76BC41: php_efree_pcre_cache (php_pcre.c:156) ==21579== by 0x91C06C: zend_hash_destroy (zend_hash.c:1541) ==21579== by 0x76D4AF: zm_deactivate_pcre.lto_priv.0 (php_pcre.c:483) ==21579== by 0x90B413: zend_deactivate_modules (zend_API.c:2636) ==21579== by 0x88D134: php_request_shutdown (main.c:1895) ==21579== by 0x9B77AA: do_cli (php_cli.c:1132) ==21579== by 0x743052: main (php_cli.c:1359) Segmentation fault (core dumped) :/182864 #