Bug #78598 [NEW]: Changing array during undef index RW error segfaults

From: Date: Thu, 26 Sep 2019 10:44:45 +0000
Subject: Bug #78598 [NEW]: Changing array during undef index RW error segfaults
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222922@lists.php.net to get a copy of this message
From: nikic Operating system: PHP version: 7.2.22 Package: Scripting Engine problem Bug Type: Bug Bug description:Changing array during undef index RW error segfaults Description: ------------ After the undef index notice is thrown, we still assume that the variable is an array, even though the type might have changed in the meantime. Not really sure what we can do about this, especially when we're dealing with a deeply nested array that has been destroyed. Test script: --------------- <?php $my_var = null; set_error_handler(function() use(&$my_var) { $my_var = 0; }); $my_var[0] .= "xyz"; Actual result: -------------- php: /home/nikic/php-7.2/Zend/zend_hash.c:712: _zend_hash_index_add_or_update_i: Assertion `((ht)->gc.refcount == 1) || ((ht)->u.flags & (1<<6))' failed. Aborted nikic@MUNIT-271:~/php-7.2$ vim t036.php -- Edit bug report at https://bugs.php.net/bug.php?id=78598&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78598&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78598&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78598&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78598&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78598&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78598&r=support Expected behavior: https://bugs.php.net/fix.php?id=78598&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78598&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78598&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78598&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78598&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78598&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78598&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78598&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78598&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78598&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78598&r=mysqlcfg

« previous php.bugs (#222922) next »