php / php/php-src

dl() breaks expectations regarding permanent or interned strings

未关闭
#9,196 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Category: Dynamic Loading Category: Engine Status: Verified
主要语言
C
星标
40.4k
派生
8.2k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 zend_string.c 中 zend_string_init_interned 附近以及 ext/opcache/ZendAccelerator.c 中相关实现附近开始。在 RC_DEBUG 构建中重现 dl() 的行为,然后检查 internal-enums-dl-crash 测试分支,确定跨扩展处理 persistent 和 interned 字符串的预期方式。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
backend
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。