Skip to content

Fix GH-22023 crash during ZTS thread startup#22027

Merged
shivammathur merged 1 commit into
php:PHP-8.5from
shivammathur:fix-issue-22023-php-8.5
May 18, 2026
Merged

Fix GH-22023 crash during ZTS thread startup#22027
shivammathur merged 1 commit into
php:PHP-8.5from
shivammathur:fix-issue-22023-php-8.5

Conversation

@shivammathur
Copy link
Copy Markdown
Member

Fixes GH-22023 by initializing last_fatal_error_backtrace in executor_globals_ctor().

On Apache + ZTS, zend_new_thread_end_handler() may refresh INI caches before init_executor() runs for the new thread. If session.use_trans_sid=1 triggers its startup deprecation in that window, zend_error_zstr_at() can destroy EG(last_fatal_error_backtrace) before it has been initialized, causing an access violation and Apache child restart.

This change makes the per-thread executor globals safe for that early warning path.

@paresy
Copy link
Copy Markdown
Contributor

paresy commented May 15, 2026

This might be similar to #17639 and a fix for #21303

@shivammathur shivammathur requested a review from arnaud-lb May 18, 2026 10:32
Copy link
Copy Markdown
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@shivammathur shivammathur merged commit 2c32bdf into php:PHP-8.5 May 18, 2026
19 checks passed
shivammathur added a commit that referenced this pull request May 18, 2026
* PHP-8.5:
  Fix GH-22023 crash during ZTS thread startup (#22027)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants