You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ext/date: MINIT reads a stale external tz database after an in-process module restart #24350
OnUpdate_date_timezone validates the value through DATE_TIMEZONEDB, which still holds whatever the previous
startup left there. When a SAPI shuts the engine down and starts it again in the same process, and a shared extension
had installed its own database with php_date_set_tzdb() (PECL timezonedb), that pointer refers to a .so that module_destructor() has already unloaded. The second startup then reads unmapped memory: a segfault, or a hang
where the SAPI's signal handling swallows it.
Neither the extension nor date's MSHUTDOWN clears the pointer, and the extension can't safely do it itself: php_date_set_tzdb(NULL) dereferences its argument.
Who hits it
Any SAPI that restarts the engine in-process with timezonedb loaded:
A minimal worker script with watch on one file; touch that file, then send one request. With only timezonedb
loaded, the restart never completed in 9 of 10 fresh containers. Without it, 0 of 10. With ZEND_DONT_UNLOAD_MODULES=1, which keeps the .so mapped, 0 of 20.
Suggested fix
Reset the pointer before the INI entries are registered (or in MSHUTDOWN):
Activity
Merge branch 'PHP-8.4' into fix/phpgh-24350-date-stale-tzdb
Fix phpGH-24350: Stale external tz database read after module restart (…
Merge branch 'PHP-8.4' into PHP-8.5
Merge branch 'PHP-8.5' into PHP-8.6
Merge branch 'PHP-8.6'