[php-src] Issue #9196: dl() breaks expectations regarding permanent or interned strings
| From: | arnaud-lb | Date: | Fri, 29 Jul 2022 19:23:00 +0000 |
| Subject: | [php-src] Issue #9196: dl() breaks expectations regarding permanent or interned strings | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242074@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9196
Author: arnaud-lb
### Description
Extensions loaded during a
dl() call will try to allocate persistent interned strings
for class names, function names, ini entries, etc. Normally, [this is not
allowed](https://github.com/php/php-src/blob/9e2de4c2d95b0a391f85121d0d077c8d6d5fdcae/Zend/zend_string.c#L239-L245)
during a request.
The default in-request implementation of zend_string_init_interned still allows it, but
the opcache implementation will simply [return a non-interned
string](https://github.com/php/php-src/blob/9e2de4c2d95b0a391f85121d0d077c8d6d5fdcae/ext/opcache/ZendAccelerator.c#L609-L614).
Calling dl() breaks in RC_DEBUG builds: https://github.com/php/php-src/pull/8606
This also breaks internal enums. The test in this branch will crash in debug builds: https://github.com/php/php-src/compare/master...arnaud-lb:php-src:internal-enums-dl-crash?expand=1
### PHP Version
PHP 8.0
### Operating System
_No response_