Skip to content

bug(opcache): registered module entry is not visible when opcache is active in the process (persistent-heap request-cycle scenario) #243

Closed

Description

@lisachenko

Summary (corrected — originally mis-attributed to PHP 8.5.9)

With opcache active in the process, tests/Memory/scenarios/persistent-heap-request-cycle.php fails at the engine-entry-visible checkpoint: after module registration (no-silent-bootstrap, module-registered, module-is-singleton all pass), extension_loaded('zengine') returns false. Without opcache the scenario is green.

php8.4 -d ffi.enable=1 -d zend.assertions=1 -d assert.exception=1 -d report_memleaks=1 \
  -d display_errors=on \
  -d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.jit=off \
  tests/Memory/scenarios/persistent-heap-request-cycle.php
# STDERR: FAILED: engine-entry-visible, exit 1
# same command with opcache.enable_cli=0: exit 0

Reproduced on PHP 8.4.19 and 8.4.24 (CI, PR #244's opcache-active runner job) and 8.5.9 — both lines, deterministic. Opcache in the child is the only variable.

Why it was first blamed on 8.5.9

Same story as #242: the child spawn inherited opcache.enable_cli from php.ini, and Ubuntu's PHP 8.5 package ships it On while 8.4 ships Off. PR #244's opcache-active CI job reproduced it on PHP 8.4.24 and exposed the real variable. Since #244 the child pins -d opcache.enable_cli=0 (with a TODO(#243) to unpin); this issue tracks the underlying bug.

Suspected area

The module registration path (ExtensionManager/AbstractModule publishing the zend_module_entry into the engine's module registry) apparently does not become visible to extension_loaded() when opcache is active in the process. Whether the registry write is lost, the lookup consults a memoized structure, or registration takes a different path under opcache needs a root-cause pass.

Found while enabling the opcache-active runner CI job (opcache epic). Companion opcache-in-child failure from the same runs: #242.

Activity

  1. changed the title [-]bug(master): PersistentHeapRequestCycleTest fails on PHP 8.5.9 — "FAILED: engine-entry-visible" in the request-cycle scenario[/-] [+]bug(opcache): registered module entry is not visible when opcache is active in the process (persistent-heap request-cycle scenario)[/+] on Aug 19, 2026
  2. added
    opcacheIssue is related to opcache integration. Either doesn't work well or behaves incorrect.
    on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopcacheIssue is related to opcache integration. Either doesn't work well or behaves incorrect.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions