Bug #75881 [Opn->Csd]: zend_hash_find_bucket() could not find existing hash entry

From: Date: Wed, 31 Jan 2018 10:29:41 +0000
Subject: Bug #75881 [Opn->Csd]: zend_hash_find_bucket() could not find existing hash entry
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213759@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75881&edit=1 ID: 75881 Updated by: sixd@php.net Reported by: tianfang dot yang at oracle dot com Summary: zend_hash_find_bucket() could not find existing hash entry -Status: Open +Status: Closed Type: Bug Package: Strings related Operating System: linux PHP Version: master-Git-2018-01-29 (Git) -Assigned To: +Assigned To: sixd Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Dmitry fixed the string compare BC break in http://git.php.net/?p=php-src.git;a=commitdiff;h=e43ac263561d8d748cb571905a5dabc2d6d5560e Previous Comments: ------------------------------------------------------------------------ [2018-01-29 01:14:07] danack@php.net That's interesting. Doesn't that imply a bug elsewhere, where the stored lengths of strings are being corrupted/otherwise stored improperly, if reverting to memcmp() makes the issue go away? ------------------------------------------------------------------------ [2018-01-29 00:43:04] tianfang dot yang at oracle dot com Description: ------------ OCI8 calls zend_hash_find() to look up existing connection in the hash table. However, with new string compare function zend_string_equal_content(), it failed to match a hash key: static zend_always_inline Bucket *zend_hash_find_bucket(const HashTable *ht, zend_string *key, zend_bool known_hash) { ... while (EXPECTED(idx != HT_INVALID_IDX)) { p = HT_HASH_TO_BUCKET_EX(arData, idx); if (EXPECTED(p->key == key)) { /* check for the same interned string */ return p; } else if (EXPECTED(p->h == h) && EXPECTED(p->key) && EXPECTED(zend_string_equal_content(p->key, key))) { return p; } ... } Revert zend_string_equal_content() to memcmp() resolved the issue. Test script: --------------- Reproducible testcase: ext/oci8/tests/drcp_connection1.phpt ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75881&edit=1

« previous php.bugs (#213759) next »