dl() breaks expectations regarding permanent or interned strings
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
Creating this ticket to keep track of some issues related to dl() and permanent / interned strings:
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 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.
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with zend_string.c around zend_string_init_interned and ext/opcache/ZendAccelerator.c around the linked implementations. Reproduce the dl() behavior in an RC_DEBUG build, then inspect the internal-enums-dl-crash test branch and determine the expected handling for persistent and interned strings across extensions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100