Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] fixed kernel re-init (when getting unserialized for eg.)#6326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
bamarni wants to merge1 commit intosymfony:masterfrombamarni:kernel-init
Closed

Conversation

bamarni
Copy link
Contributor

fixes#6254

This was happening to me because inapp/cache/dev/appDevUrlMatcher.php.meta I have aSymfony\Component\HttpKernel\Config\FileLocator serialized object, at some point a ConfigCache needs to unserialize this file, when it does, a Kernel gets unserialized too (because this FileLocator class depends on it), and it leads to re-initializing the kernel.

When a kernel object gets unserialized, it's being constructed, theninitialized, there shouldn't be any need to call the init methodtwice in a process, it basically only contains static callsaffecting some PHP ini settings or error handlers, actually it can leadto unexpected things if it's called more than once, for eg. havingduplicate error messages or registering DebugClassLoaders forDebugClassLoaders.Imo this method shouldn't even be publicly accessible, but I didn'twanted to break things.
@fabpot
Copy link
Member

I'd rather fix the root cause because IIUC, in your case, you then have 2 kernels.

@bamarni
Copy link
ContributorAuthor

Yes but I don't think this is specific to me, I can see the kernel has been designed to support serialization (it implements Serializable), so the same issue will likely occur anytime the kernel or a class depending on the kernel gets unserialized.

It looks related to some Symfony internals, here is the class causing me this issue :https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Config/FileLocator.php This class depends on the Kernel, and an instance of it is being serialized inapp/cache/dev/appDevUrlMatcher.php.meta.

If nobody can reproduce this I'll try to push something on github.

@bamarni
Copy link
ContributorAuthor

I'm getting this error with a fresh standard edition (latest and deps updated to their latest too) if I only remove the semi-colon at the end of this line for eg :https://github.com/symfony/symfony-standard/blob/master/src/Acme/DemoBundle/Controller/DemoController.php#L30 and request the/demo/hello/world path. It seems strange to me that you don't have it.

@mpdude
Copy link
Contributor

@bamarni#7230 might provide a solution. Do you still experience the issue and can you tell me which class in the.meta file is it that holds theFileLocator reference?

@bamarni
Copy link
ContributorAuthor

@mpdude : this "init()" method has been deprecated, so it's fixed now.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 issues with new fatal error displaying
3 participants
@bamarni@fabpot@mpdude

[8]ページ先頭

©2009-2025 Movatter.jp