Bug #70842 [NEW]: Persistent Stream Segmentation Fault
| From: | caleb dot champlin at gmail dot com | Date: | Mon, 02 Nov 2015 21:56:07 +0000 |
| Subject: | Bug #70842 [NEW]: Persistent Stream Segmentation Fault | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-196986@lists.php.net to get a copy of this message | ||
From: caleb dot champlin at gmail dot com
Operating system: Linux
PHP version: 7.0.0RC6
Package: Streams related
Bug Type: Bug
Bug description:Persistent Stream Segmentation Fault
Description:
------------
Using PHP-FPM and presumably the Apache module in certain situations
accessing persistent streams will result in a segmentation fault.
Build Configuration:
./configure --build=x86_64-alpine-linux-musl \
--host=x86_64-alpine-linux-musl \
--prefix=/usr \
--sysconfdir=/etc/php \
--localstatedir=/var \
--with-layout=GNU \
--with-config-file-path=/etc/php \
--with-config-file-scan-dir=/etc/php/conf.d \
--enable-inline-optimization \
--enable-debug \
--disable-rpath \
--disable-static \
--enable-shared \
--mandir=/usr/share/man \
--with-pic \
--disable-cli \
--enable-fpm \
--without-db1 \
--without-db2 \
--without-db3 \
--without-qdbm \
--with-pcre-regex=/usr \
Test script:
---------------
I have not been able to produce a script that will consistently
reproduce the segmentation fault.
General steps:
1) In php script call steam_socket_client with flags
STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT
2) call fwrite with socket resource
3) Execute page multiple times through fpm and php will segfault.
(With small test scripts I generally cannot reproduce, if I start
including php files with non-executed code (class definitions) at the
top of my test scripts then I can get crashes to occur consistently)
Actual result:
--------------
#0 0x00005634ca7c2c1e in php_sockop_write (stream=0x5634ccfb3700,
buf=0x7f2d06159ec0 "*2\r\n$6\r\nselect\r\n$1\r\n0\r\n", count=23) at
/home/test/php-src-php-7.0.0RC6/main/streams/xp_socket.c:111
111
php_stream_notify_progress_increment(PHP_STREAM_CONTEXT(stream),
didwrite, 0);
(gdb) bt
#0 0x00005634ca7c2c1e in php_sockop_write (stream=0x5634ccfb3700,
buf=0x7f2d06159ec0 "*2\r\n$6\r\nselect\r\n$1\r\n0\r\n", count=23) at
/home/test/php-src-php-7.0.0RC6/main/streams/xp_socket.c:111
#1 0x00005634ca7b163c in _php_stream_write_buffer
(stream=0x5634ccfb3700, buf=0x7f2d06159ec0
"*2\r\n$6\r\nselect\r\n$1\r\n0\r\n", count=23) at
/home/test/php-src-php-7.0.0RC6/main/streams/streams.c:1115
#2 0x00005634ca7b19f2 in _php_stream_write (stream=0x5634ccfb3700,
buf=0x7f2d06159ec0 "*2\r\n$6\r\nselect\r\n$1\r\n0\r\n", count=23) at
/home/test/php-src-php-7.0.0RC6/main/streams/streams.c:1230
#3 0x00005634ca70345a in zif_fwrite (execute_data=0x7f2d1be14160,
return_value=0x7f2d1be14140) at
/home/test/php-src-php-7.0.0RC6/ext/standard/file.c:1210
#4 0x00005634ca88b532 in ZEND_DO_ICALL_SPEC_HANDLER () at
/home/test/php-src-php-7.0.0RC6/Zend/zend_vm_execute.h:586
#5 0x00005634ca88af38 in execute_ex (ex=0x7f2d1be14030) at
/home/test/php-src-php-7.0.0RC6/Zend/zend_vm_execute.h:414
#6 0x00005634ca88b057 in zend_execute (op_array=0x7f2d1be6b000,
return_value=0x0) at
/home/test/php-src-php-7.0.0RC6/Zend/zend_vm_execute.h:458
#7 0x00005634ca8287af in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /home/test/php-src-php-7.0.0RC6/Zend/zend.c:1428
#8 0x00005634ca7920c2 in php_execute_script
(primary_file=0x7fff22149f90) at
/home/test/php-src-php-7.0.0RC6/main/main.c:2471
#9 0x00005634ca908200 in main (argc=1, argv=0x7fff2214a368) at
/home/test/php-src-php-7.0.0RC6/sapi/fpm/fpm/fpm_main.c:1944
--
Edit bug report at https://bugs.php.net/bug.php?id=70842&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70842&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70842&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70842&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70842&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70842&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70842&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70842&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70842&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70842&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70842&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70842&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70842&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70842&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70842&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70842&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70842&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70842&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70842&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70842&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70842&r=mysqlcfg