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

From: Date: Mon, 29 Jan 2018 01:14:08 +0000
Subject: Bug #75881 [Opn]: zend_hash_find_bucket() could not find existing hash entry
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213728@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: danack@php.net Reported by: tianfang dot yang at oracle dot com Summary: zend_hash_find_bucket() could not find existing hash entry Status: Open Type: Bug Package: Strings related Operating System: linux PHP Version: master-Git-2018-01-29 (Git) Block user comment: N Private report: N New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [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 (#213728) next »