php / php/php-src

dl() breaks expectations regarding permanent or interned strings

オープン
#9,196 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Category: Dynamic Loading Category: Engine Status: Verified
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

zend_string_init_interned 周辺の zend_string.c と、関連する実装周辺の ext/opcache/ZendAccelerator.c から始めます。RC_DEBUG ビルドで dl() の動作を再現し、その後 internal-enums-dl-crash テストブランチを調べ、拡張機能間で persistent および interned 文字列をどのように扱うべきかを判断します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
backend
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。