[php-src] PR #25196: Fix GH-25195: smm_shared_globals left dangling without an SHM backend

From: Date: Thu, 05 Nov 2026 01:09:40 +0000
Subject: [php-src] PR #25196: Fix GH-25195: smm_shared_globals left dangling without an SHM backend
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-40306@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/25196 Author: lazerg When there is no SHM backend, zend_shared_alloc_startup() returned NO_SHM_BACKEND with smm_shared_globals still pointing at its local tmp_shared_globals. The other early returns already reset it to NULL. If the engine is started again in the same process with file_cache_only (embed SAPI), startup is skipped and zend_accel_in_shm() reads the dead stack frame. This resets it before that return too, as suggested in the issue. The early return was added in e4078a6a70, so this targets PHP-8.5. I checked it with the embed reproducer from the issue on an ASan build without SHM backends: the stack-use-after-return is gone and opcache_compile_file() returns true. Fixes #25195

« previous php.git-pulls (#40306) next »