Skip to content

[Config] ResourceCheckerConfigCache metadata unserialize emits warning #59196

Closed
@simitter

Description

@simitter

Symfony version(s) affected

7.2.1

Description

The ResourceCheckerConfigCache may crash while in dev environement /debug mode on unserialize.

In ResourceCheckerConfigCache.php line 130:
Warning: unserialize(): Function spl_autoload_call() hasn't defined the class it was called for

This happens if there is an additional unserialize_callback_func set

ini_set('unserialize_callback_func', 'spl_autoload_call');

How to reproduce

https://github.com/simitter/symfony_config_unserialize_bug

Steps:
On an empty cache bin/console should trigger the bug

Possible Solution

Using the allowed_classes parameter of unserialize should force every class to be __Php_Incomoplete_Class before triggering unserialize_callback_func.

Only suppressing the error on unseralize would prevent the metadata json file to be written / contain the correct data.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions