Bug #71443 [NEW]: Segfault using built-in webserver with intl using symfony

From: Date: Mon, 25 Jan 2016 00:29:03 +0000
Subject: Bug #71443 [NEW]: Segfault using built-in webserver with intl using symfony
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198864@lists.php.net to get a copy of this message
From:             wegvonhier+phpbugs at gmail dot com
Operating system: Linux
PHP version:      master-Git-2016-01-25 (Git)
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Segfault using built-in webserver with intl using symfony

Description:
------------
Using master@319e82838
Compiled using ./configure --enable-debug --enable-intl (Removing intl
solves the issue; Not sure if this should be filed under pecl/intl or
reproducible crash, as the crash happens in zend_ini/zend_string)

php.ini content:
zend_extension=<path>opcache.so
opcache.file_cache_only=1
opcache.file_cache=<path>php-op-cache
opcache.enable_cli=0


Test script:
---------------
Steps to reproduce:
Using a clean symfony 3 app generated using 'symfony new proj-name'.
Go to web/app_dev.php; Comment the call to Debug::enable(); and set the
first parameter of the AppKernel ctor to 'prod', but leave the second
parameter set to true.

Start the webserver using php -S <addr> in the web directory and request
<addr>/app_dev.php

If other files have been requested before the request behaves as
expected. If app_dev.php is the first file requested the php process
crashes with the backtrace posted below.

Actual result:
--------------
(gdb) run -S 127.0.0.1:8182
Starting program: /home/vm-user/php-src/sapi/cli/php -S 127.0.0.1:8182
Traceback (most recent call last):
PHP 7.1.0-dev Development Server started at Mon Jan 25 00:16:35 2016
Listening on http://127.0.0.1:8182
Document root is /home/vm-user/symf-proj/web
Press Ctrl-C to quit.
[Mon Jan 25 00:16:43 2016] 127.0.0.1:60070 [200]: /app_dev.php

Program received signal SIGSEGV, Segmentation fault.
0x00000000008aed40 in zend_string_release (s=0x7ffff3698dd8)
    at /home/vm-user/php-src/Zend/zend_string.h:269
269		if (!ZSTR_IS_INTERNED(s)) {
(gdb) bt
#0  0x00000000008aed40 in zend_string_release (s=0x7ffff3698dd8)
    at /home/vm-user/php-src/Zend/zend_string.h:269
#1  0x00000000008af033 in zend_restore_ini_entry_cb
(ini_entry=0x117d850, 
    stage=8) at /home/vm-user/php-src/Zend/zend_ini.c:67
#2  0x00000000008af0b7 in zend_restore_ini_entry_wrapper
(el=0x7ffff42634a0)
    at /home/vm-user/php-src/Zend/zend_ini.c:82
#3  0x00000000008a24ea in zend_hash_apply (ht=0x7ffff425b420, 
    apply_func=0x8af08f <zend_restore_ini_entry_wrapper>)
    at /home/vm-user/php-src/Zend/zend_hash.c:1521
#4  0x00000000008af25d in zend_ini_deactivate ()
    at /home/vm-user/php-src/Zend/zend_ini.c:142
#5  0x000000000088be74 in zend_deactivate ()
    at /home/vm-user/php-src/Zend/zend.c:989
#6  0x00000000007f8808 in php_request_shutdown (dummy=0x0)
    at /home/vm-user/php-src/main/main.c:1823
#7  0x000000000095746f in php_cli_server_request_shutdown (
    server=0x11049c0 <server>, client=0x12981b0)
    at /home/vm-user/php-src/sapi/cli/php_cli_server.c:2025
#8  0x0000000000957857 in php_cli_server_dispatch (server=0x11049c0
<server>, 
    client=0x12981b0) at
/home/vm-user/php-src/sapi/cli/php_cli_server.c:2106
#9  0x0000000000958071 in php_cli_server_recv_event_read_request (
    server=0x11049c0 <server>, client=0x12981b0)
    at /home/vm-user/php-src/sapi/cli/php_cli_server.c:2315



Different run:
Breakpoint 1, zend_restore_ini_entry_cb (ini_entry=0x117d850, stage=8)
    at /home/vm-user/php-src/Zend/zend_ini.c:51
51		int result = FAILURE;
(gdb) print *ini_entry
$6 = {name = 0x117d8b0, on_modify = 0x8b024d <OnUpdateStringUnempty>, 
  mh_arg1 = 0x10, mh_arg2 = 0x11054c0 <intl_globals>, mh_arg3 = 0x0, 
  value = 0x7ffff3698dd8, orig_value = 0x0, displayer = 0x0, modifiable
= 7, 
  orig_modifiable = 7, modified = 1, module_number = 12}
(gdb) print *ini_entry->value
Cannot access memory at address 0x7ffff3698dd8
(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00000000008aed40 in zend_string_release (s=0x7ffff3698dd8)
    at /home/vm-user/php-src/Zend/zend_string.h:269
269		if (!ZSTR_IS_INTERNED(s)) {


-- 
Edit bug report at https://bugs.php.net/bug.php?id=71443&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71443&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71443&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71443&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71443&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71443&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71443&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71443&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71443&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71443&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71443&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71443&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71443&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71443&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71443&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71443&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71443&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71443&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71443&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71443&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71443&r=mysqlcfg



Thread (5 messages)

« previous php.bugs (#198864) next »