- OPcache:
. Fixed bug #80002 (calc free space for new interned string is wrong).
(t-matsuno)
+ . Fixed bug #80046 (FREE for SWITCH_STRING optimized away). (Nikita)
+ . Fixed bug #79825 (opcache.file_cache causes SIGSEGV when custom opcode
+ handlers changed). (SammyK)
- PDO:
. Fixed bug #80027 (Terrible performance using $query->fetch on queries with
static void accel_gen_system_id(void)
{
PHP_MD5_CTX context;
- unsigned char digest[16], c;
- char *md5str = ZCG(system_id);
- int i;
+ unsigned char digest[16];
+ zend_module_entry *module;
+ zend_extension *extension;
+ zend_llist_position pos;
PHP_MD5Init(&context);
PHP_MD5Update(&context, PHP_VERSION, sizeof(PHP_VERSION)-1);
PHP_MD5Update(&context, __DATE__, sizeof(__DATE__)-1);
PHP_MD5Update(&context, __TIME__, sizeof(__TIME__)-1);
}
+ /* Modules may have changed after restart which can cause dangling pointers from
+ * custom opcode handlers in the second-level cache files
+ */
+ ZEND_HASH_FOREACH_PTR(&module_registry, module) {
+ PHP_MD5Update(&context, module->name, strlen(module->name));
+ PHP_MD5Update(&context, module->version, strlen(module->version));
+ } ZEND_HASH_FOREACH_END();
+ extension = (zend_extension *) zend_llist_get_first_ex(&zend_extensions, &pos);
+ while (extension) {
+ PHP_MD5Update(&context, extension->name, strlen(extension->name));
+ PHP_MD5Update(&context, extension->version, strlen(extension->version));
+ extension = (zend_extension *) zend_llist_get_next_ex(&zend_extensions, &pos);
+ }
PHP_MD5Final(digest, &context);
- for (i = 0; i < 16; i++) {
- c = digest[i] >> 4;
- c = (c <= 9) ? c + '0' : c - 10 + 'a';
- md5str[i * 2] = c;
- c = digest[i] & 0x0f;
- c = (c <= 9) ? c + '0' : c - 10 + 'a';
- md5str[(i * 2) + 1] = c;
- }
+ php_hash_bin2hex(accel_system_id, digest, sizeof digest);
}
#ifdef HAVE_HUGE_CODE_PAGES