Skip to content

PFA: Extend local pointer map after loading PFA from SHM - #23250

Open
arnaud-lb wants to merge 1 commit into
php:masterfrom
arnaud-lb:pfa-bug-1
Open

PFA: Extend local pointer map after loading PFA from SHM#23250
arnaud-lb wants to merge 1 commit into
php:masterfrom
arnaud-lb:pfa-bug-1

Conversation

@arnaud-lb

Copy link
Copy Markdown
Member

When loading a PFA from SHM we may need to extend the local pointer map because
the PFA may use pointers higher than CG(map_ptr_last). Similar synchronization
happens in inheritance cache 1 or when loading whole scripts 2.

The test reproduces under ASAN with Opcache enabled.

Bug found by Ryan @ Calif.io.

Footnotes

  1. https://github.com/php/php-src/blob/eaac14a17a3d64c52ef1a0778bb65828cfce4eda/ext/opcache/ZendAccelerator.c#L2538-L2545

  2. https://github.com/php/php-src/blob/7a2303f89bffa0ecc4b5877f1a701ce2d844c5a3/ext/opcache/zend_accelerator_util_funcs.c#L373-L375

When loading a PFA from SHM we may need to extend the local pointer map because
the PFA may use pointers higher than CG(map_ptr_last). Similar synchronization
happens in inheritance cache or when loading whole scripts.
@arnaud-lb
arnaud-lb marked this pull request as ready for review August 13, 2026 16:33
@arnaud-lb
arnaud-lb requested a review from dstogov as a code owner August 13, 2026 16:33
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.

1 participant