Skip to content

JIT: Fix TLS access with SHM reattachment - #24355

Merged
arnaud-lb merged 2 commits into
php:PHP-8.5from
arnaud-lb:gh24185
Oct 16, 2026
Merged

arnaud-lb merged 2 commits into
php:PHP-8.5from
arnaud-lb:gh24185

Conversation

@arnaud-lb

@arnaud-lb arnaud-lb commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Should fix GH-24185.

Different processes may load modules in a different order, so TLS variables may have different offsets. This is an issue when JIT hard-codes those offsets into generated code that may be executed by other processes.

Fix by not resolving the TLS offsets when ZEND_OPCACHE_SHM_REATTACHMENT is defined, so that generated code falls back to runtime resolution.

@arnaud-lb
arnaud-lb changed the base branch from master to PHP-8.5 October 15, 2026 15:51
@arnaud-lb

Copy link
Copy Markdown
Member Author

@alvin0319 could you confirm that this fixes the issue for you?

@alvin0319

Copy link
Copy Markdown

@alvin0319 could you confirm that this fixes the issue for you?

Hi, thanks for letting me know. The PR fixed issue. I ran same tests on my side and it didn't crash, Awesome!

Thanks for your quick work on this!

@arnaud-lb
arnaud-lb marked this pull request as ready for review October 16, 2026 15:04
@arnaud-lb
arnaud-lb requested a review from dstogov as a code owner October 16, 2026 15:04
@arnaud-lb
arnaud-lb requested a review from ndossche October 16, 2026 15:05

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed: okay for 8.5

@arnaud-lb
arnaud-lb merged commit 03c5ad7 into php:PHP-8.5 Oct 16, 2026
1 of 2 checks passed
arnaud-lb added a commit that referenced this pull request Oct 16, 2026
* PHP-8.6:
  JIT: Fix TLS access with SHM reattachment (#24355)
shivammathur pushed a commit to shivammathur/php-src that referenced this pull request Oct 16, 2026
* PHP-8.5:
  JIT: Fix TLS access with SHM reattachment (php#24355)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.5+ Windows ZTS: random access violations with OPcache JIT in multi-process setups

3 participants