|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-11-09 12:06 UTC] alex at buayacorp dot com
Description: ------------ We've noticed a few segmentation faults in some of our servers. I am able to consistently reproduce it in a debian wheezy vm with the test script below. alex@atoq-wheezy:~/php-7.0.12$ uname -a Linux atoq-wheezy 3.2.0-4-amd64 #1 SMP Debian 3.2.82-1 x86_64 GNU/Linux alex@atoq-wheezy:~/php-7.0.12$ locale LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= # PHP compiled with --disable-all flag. alex@atoq-wheezy:~/php-7.0.12$ sapi/cli/php -v PHP 7.0.12 (cli) (built: Nov 9 2016 11:29:49) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies The script works fine in the same VM under PHP 5.6.27. # PHP compiled with --disable-all flag. alex@atoq-wheezy:~/php-5.6.27$ sapi/cli/php ../segfault.php string(22) "<p>hola</p><p>hola</p>" Test script: --------------- https://gist.github.com/xknown/b0bdcfa87edf039e995822d86cfde441 Expected result: ---------------- string(22) "<p>hola</p><p>hola</p>" Actual result: -------------- alex@atoq-wheezy:~/php-7.0.12$ sapi/cli/php -dpcre.jit=0 ../segfault.php NULL alex@atoq-wheezy:~/php-7.0.12$ sapi/cli/php -dpcre.jit=1 ../segfault.php NULL Segmentation fault Patchesuse-regex-cache-key-with-locale (last revision 2016-11-10 15:32 UTC by alex at buayacorp dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 08:00:02 2025 UTC |
And a simpler reproduce script: <?php $regex = "#dummy#"; setlocale(LC_ALL, "C"); preg_replace_callback($regex, function (array $matches) use($regex) { setlocale(LC_ALL, "en_US"); preg_replace($regex, "A", "A"); setlocale(LC_ALL, "C"); }, "dummy");