Bug #73483 [Opn->Ver]: Segmentation fault

From: Date: Wed, 09 Nov 2016 15:33:38 +0000
Subject: Bug #73483 [Opn->Ver]: Segmentation fault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205261@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73483&edit=1

 ID:                 73483
 Updated by:         cmb@php.net
 Reported by:        alex at buayacorp dot com
 Summary:            Segmentation fault
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            PCRE related
 Operating System:   debian wheezy
 PHP Version:        7.0.12
-Assigned To:        
+Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

This issue is apparently locale related. For instance, the script works
fine if the locale is "C", see <https://3v4l.org/4IVgb>. Alternatively,
commenting out line 58[1] will also let the script succeed.

Anyhow, the behavioral change had been introduced with commit
4514ba01[2].

Dmitry, can you please have a look at this issue?

[1] <https://gist.github.com/xknown/b0bdcfa87edf039e995822d86cfde441#file-segfault-php-L58>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=4514ba016ff158cd113deef1a215fcdcb6913b48>


Previous Comments:
------------------------------------------------------------------------
[2016-11-09 12:06:47] 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



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



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


Thread (8 messages)

« previous php.bugs (#205261) next »