Review main Work in progress Quiet

96068[WIP][TASK] Reproduce broken Extbase class schema cache entry

Stefan Bürk CR 0 V -1 Normal +188 −0 updated 09/25/26, 11:24

Commit message

ReflectionService::__destruct() writes the class schemata through the
cache frontend. When the garbage collector runs that destructor while
another serialize() call is in progress, the nested serialize()
continues the outer call's reference table: back references in the
written entry point into the outer graph, the entry is stored (with a
valid HMAC) and the next ReflectionService fails to unserialize it.

The added unit test reproduces that sequence with a non-transient
cache backend and fails until the class schemata are persisted
outside the destructor. It asserts that the collector destroyed the
service inside serialize(), so it cannot pass by accident.

Possible directions for a fix:

* Persist the class schemata outside the destructor, by an explicit
  flush at the end of a request (and of a test) or from a shutdown
  function, so the write never runs under the garbage collector.
* Independently, PHP could start a fresh serialization context when
  the collector runs a destructor inside serialize().

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 3
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/68/96068/3 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/68/96068/3 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V -1 Blocked
    • core-ci -1 CI

Merge conflicts 2

Issues 3

Files 4

Review log 36

  1. Stefan Bürk uploaded patch set 1 09/25/26, 10:46

  2. core-ci voted on patch set 1 V -1 09/25/26, 10:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109237

  3. Stefan Bürk updated the commit message in patch set 2 V -1 09/25/26, 11:01

  4. core-ci voted on patch set 2 V -1 09/25/26, 11:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109238

  5. Stefan Bürk updated the commit message in patch set 3 V -1 09/25/26, 11:13

  6. core-ci voted on patch set 3 V -1 09/25/26, 11:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109239