Bug #75735 [NEW]: [embed SAPI] Segmentation fault in sapi_register_post_entry

From: Date: Tue, 26 Dec 2017 15:28:11 +0000
Subject: Bug #75735 [NEW]: [embed SAPI] Segmentation fault in sapi_register_post_entry
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213284@lists.php.net to get a copy of this message
From: volodymyr at wildwolf dot name Operating system: Ubuntu 17.04 x64 PHP version: 7.1.12 Package: Reproducible crash Bug Type: Bug Bug description:[embed SAPI] Segmentation fault in sapi_register_post_entry Description: ------------ Please see below — the second call to PHP_EMBED_START_BLOCK() crashes the application. Same happens in PHP 7.2.0 as well. Configure options: --with-config-file-path=/home/vladimir/.phpenv/versions/7.1.12-zts-debug/etc --with-config-file-scan-dir=/home/vladimir/.phpenv/versions/7.1.12-zts-debug/etc/conf.d --prefix=/home/vladimir/.phpenv/versions/7.1.12-zts-debug --libexecdir=/home/vladimir/.phpenv/versions/7.1.12-zts-debug/libexec --without-pear --with-gd --enable-sockets --with-jpeg-dir=/usr --with-png-dir=/usr --enable-exif --enable-zip --with-zlib --with-zlib-dir=/usr --with-kerberos --with-openssl --with-mcrypt=/usr --enable-soap --enable-xmlreader --with-xsl --enable-ftp --enable-cgi --with-curl=/usr --with-tidy --with-xmlrpc --enable-sysvsem --enable-sysvshm --enable-shmop --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pdo-sqlite --enable-pcntl --with-readline --enable-mbstring --disable-debug --disable-fpm --enable-embed --enable-bcmath --disable-phpdbg --enable-maintainer-zts --with-libdir=lib64 Test script: --------------- #include <sapi/embed/php_embed.h> int main() { PHP_EMBED_START_BLOCK(0, 0) PHP_EMBED_END_BLOCK(); PHP_EMBED_START_BLOCK(0, 0) PHP_EMBED_END_BLOCK(); return 0; } Expected result: ---------------- Program exits normally. Actual result: -------------- Program received signal SIGSEGV, Segmentation fault. 0x00007ffff73d826b in sapi_register_post_entry (post_entry=post_entry@entry=0x7ffff7dae160 <php_post_entries>) at /tmp/php-build/source/7.1.12/main/SAPI.c:951 951 if (SG(sapi_started) && EG(current_execute_data)) { (gdb) bt #0 0x00007ffff73d826b in sapi_register_post_entry (post_entry=post_entry@entry=0x7ffff7dae160 <php_post_entries>) at /tmp/php-build/source/7.1.12/main/SAPI.c:951 #1 0x00007ffff73d8362 in sapi_register_post_entries (post_entries=post_entries@entry=0x7ffff7dae160 <php_post_entries>) at /tmp/php-build/source/7.1.12/main/SAPI.c:940 #2 0x00007ffff73db5d0 in php_setup_sapi_content_types () at /tmp/php-build/source/7.1.12/main/php_content_types.c:64 #3 0x00007ffff73ca23c in ts_allocate_id (rsrc_id=rsrc_id@entry=0x7ffff7dd67b8 <sapi_globals_id>, size=size@entry=560, ctor=ctor@entry=0x7ffff73d5db0 <sapi_globals_ctor>, dtor=dtor@entry=0x7ffff73d5d90 <sapi_globals_dtor>) at /tmp/php-build/source/7.1.12/TSRM/TSRM.c:259 #4 0x00007ffff73d616c in sapi_startup (sf=sf@entry=0x7ffff7db7e40 <php_embed_module>) at /tmp/php-build/source/7.1.12/main/SAPI.c:84 #5 0x00007ffff74f2f74 in php_embed_init (argc=0, argv=0x0) at /tmp/php-build/source/7.1.12/sapi/embed/php_embed.c:182 #6 0x0000555555554a2e in main () at test.c:8 -- Edit bug report at https://bugs.php.net/bug.php?id=75735&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75735&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75735&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75735&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75735&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75735&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75735&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75735&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75735&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75735&r=support Expected behavior: https://bugs.php.net/fix.php?id=75735&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75735&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75735&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75735&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75735&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75735&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75735&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75735&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75735&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75735&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75735&r=mysqlcfg

« previous php.bugs (#213284) next »