Bug #73973 [NEW]: debug_zval_dump() assertion error for resource consts with --enable-debug
| From: | tandre at ifwe dot co | Date: | Mon, 23 Jan 2017 00:40:04 +0000 |
| Subject: | Bug #73973 [NEW]: debug_zval_dump() assertion error for resource consts with --enable-debug | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-206866@lists.php.net to get a copy of this message | ||
From: tandre at ifwe dot co
Operating system: All/Linux
PHP version: 7.1.1
Package: Reproducible crash
Bug Type: Bug
Bug description:debug_zval_dump() assertion error for resource consts with --enable-debug
Description:
------------
This happens when a constant is define()d to be a value with the type
resource.
This affects php 7.0.14 and 7.1.0 and 7.1.1, other versions weren't
tested.
php-config used:
--prefix [/php-7.1.1-install]
--includes [-I/php-7.1.1-install/include/php
-I/php-7.1.1-install/include/php/main
-I/php-7.1.1-install/include/php/TSRM
-I/php-7.1.1-install/include/php/Zend
-I/php-7.1.1-install/include/php/ext
-I/php-7.1.1-install/include/php/ext/date/lib]
--ldflags [ -L/usr/lib/x86_64-linux-gnu]
--libs [-lcrypt -lexslt -ltidy -lresolv -lcrypt
-lreadline -ltermcap -lrt -lstdc++ -lpng -lz -lcurl -lbz2 -lz -lrt -lm
-ldl -lnsl -lapparmor -lpthread -lxml2 -lssl -lcrypto -lcurl -lxml2
-licui18n -licuuc -licudata -licuio -lxml2 -lxml2 -lcrypt -lxml2 -lxml2
-lxml2 -lxml2 -lxslt -lxml2 -lcrypt ]
--extension-dir
[/php-7.1.1-install/lib/php/extensions/debug-zts-20160303]
--include-dir [/php-7.1.1-install/include/php]
--man-dir [/php-7.1.1-install/php/man]
--php-binary [/php-7.1.1-install/bin/php]
--php-sapis [ cli fpm phpdbg cgi]
--configure-options [--prefix=/php-7.1.1-install --enable-debug
--enable-maintainer-zts --enable-fpm --enable-intl --with-pear --with-gd
--with-zlib --enable-soap --enable-xmlreader --with-xsl --with-curl
--with-tidy --with-xmlrpc --enable-sysvsem --enable-sysvshm
--enable-shmop --enable-pcntl --with-readline --enable-mbstring
--with-gettext --enable-sockets --with-bz2 --with-openssl
--enable-bcmath --enable-sysvmsg]
--version [7.1.1]
--vernum [70101]
Test script:
---------------
// In CLI, with --enable-debug --enable-maintainer-zts
define('myerr', fopen('php://stderr', 'w'));
var_dump(myerr);
// resource(2) of type (stream)
debug_zval_dump(myerr);
// php: /php-7.1.1/Zend/zend_types.h:822: zval_refcount_p: Assertion
`(((*(pz)).u1.v.type_flags & (1<<2)) != 0) || //
(((*(pz)).u1.v.type_flags & (1<<1)) != 0)' failed.
// [1] 4964 abort /php-7.1.1-install/bin/php -a
Expected result:
----------------
debug_zval_dump should print information about constant resource and
reference counting information without crashing. (When compiled with
--enable-debug)
Actual result:
--------------
php crashes because of an assertion error when debug_zval_dump is called
with a resource assigned to a constant. (Only when compiled with
--enable-debug)
--
Edit bug report at https://bugs.php.net/bug.php?id=73973&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73973&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73973&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73973&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73973&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73973&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73973&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73973&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73973&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73973&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73973&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73973&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73973&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73973&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73973&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73973&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73973&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73973&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73973&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73973&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73973&r=mysqlcfg