Bug #77666 [NEW]: Segmentation fault on include file with very long string variable

From: Date: Mon, 25 Feb 2019 19:51:14 +0000
Subject: Bug #77666 [NEW]: Segmentation fault on include file with very long string variable
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219730@lists.php.net to get a copy of this message
From: alexxwiz at yandex dot ru Operating system: Ubuntu 14.04 PHP version: 7.1.26 Package: Reproducible crash Bug Type: Bug Bug description:Segmentation fault on include file with very long string variable Description: ------------ Reproducible on two versions at least: PHP 7.1.26-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 11 2019 14:35:37) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.1.26-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies and PHP 7.2.15-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb 8 2019 15:37:29) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.15-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans When I try to include file with very long (6.5Mb size) string variable I got segfault. Variable is like in example (generated by some cache engine). Test script: --------------- <?php include "test_long_string.php"; echo $datecreate; //file test_long_string.php is like 6.5 Mb in size: <?php $ser_content = 'a:2:{s:7:"CONTENT";s:0:"";s:4:"VARS";a:159:{i:2;a:24:{s:2:"ID";s:1:"2";s:6:"ACTIVE";s:1:"N";s:4:"NAME";s:35:"Фабрика - Вебмастер";s:4:"CODE";N;s:11:"DESCRIPTION";s:46:"Фабрика Фабрика Фабрика Фабрика ";s:4:"SORT";s:3:"100";s:7:"SITE_ID";s:2:"s1";s:6:"DOMAIN";s:11:"auto-mex.ru";s:8:"IS_HTTPS";s:1:"Y";s:6:"PLUGIN";s:16:"YANDEX_WEBMASTER";s:6:"FORMAT";s:23:"YANDEX_WEBMASTER_SIMPLE";s:14:"LAST_IBLOCK_ID";s:1:"1";s:17:"LAST_SETTINGS_TAB";s:17:"subtab_categories";s:6:"PARAMS";a:13:{s:11:"AUTO_DELETE";s:1:"Y";s:9:"SHOP_NAME";s:29:"Фабрика Фабрика ";s:12:"SHOP_COMPANY";s:29:"Фабрика Фабрика";s:8:"DELIVERY";a:3:{s:4:"COST";s:3:"275";s:4:"DAYS";s:1:"1";s:12:"ORDER_BEFORE";s:0:"";}s:21:"ENABLE_AUTO_DISCOUNTS";s:1:"N";s:16:"EXPORT_FILE_NAME";s:24:"/upload/webmaster-ya.xml";s:8:"ENCODING";s:5:"UTF-8";s:15:"COMPRESS_TO_ZIP";s:1:"N";s:17:"DELETE_XML_IF_ZIP";s:1:"N";s:18:"SHOW_JUST_CATALOGS";s:1:"Y";s:28:"CATEGORIES_REDEFINITION_MODE";s:1:"1";s:25:"CATEGORIES_EXPORT_PARENTS";s:1:"N";s:8:"CURRENCY";a:2:{s:15:"TARGET_CURRENCY";s:3:"RUB";s:12:"RATES_SOURCE";s:4:"CBRF";}}s:13:"AUTO_GENERATE";s:1:"Y";s:6:"LOCKED";s:1:"N";s:12:"DATE_CREATED";O:25:"Bitrix\\Main\\Type\\DateTime":1:{s:8:"'.chr(0).'*'.chr(0).'value";O:8:"DateTime":3:{s:4:"date";s:26:"2018-10-11 16:12:37.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:13:"Europe/Moscow";}}s:13:"DATE_MODIFIED";O:25:"Bitrix\\Main\\Type\\DateTime":1:{s:8:"'.chr(0).'*'.chr(0); Expected result: ---------------- If this string is too long I'll expect "out of memory" or "memory limit exceeded", but not segfault. Actual result: -------------- Segmentation fault (core dumped) -- Edit bug report at https://bugs.php.net/bug.php?id=77666&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77666&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77666&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77666&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77666&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77666&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77666&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77666&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77666&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77666&r=support Expected behavior: https://bugs.php.net/fix.php?id=77666&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77666&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77666&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77666&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77666&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77666&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77666&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77666&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77666&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77666&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77666&r=mysqlcfg

« previous php.bugs (#219730) next »