Skip to content

[DI] Infinite loop in PhpDumper::analyzeCircularReferences() #25101

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ogizanagi opened this issue Nov 22, 2017 · 3 comments
Closed

[DI] Infinite loop in PhpDumper::analyzeCircularReferences() #25101

ogizanagi opened this issue Nov 22, 2017 · 3 comments

Comments

@ogizanagi
Copy link
Contributor

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.0-RC1

Trying to upgrade to the 3.4.0-RC1 version on an app, I'm getting a:

Allowed memory size of [...] in /vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php on line 369

The issue is an infinite loop in PhpDumper::analyzeCircularReferences(), introduced in #25055.

See ogizanagi/symfony-standard@13ec437 for a reproducer, which worked fine with 3.4.0-BETA4, or if there is only one nelmio_alice.faker.provider tagged service.

By dumping the $currentPath var, I infinitely get:

array:7 [
  "nelmio_alice.generator.caller" => "nelmio_alice.generator.caller"
  "nelmio_alice.generator.caller.simple" => "nelmio_alice.generator.caller.simple"
  "nelmio_alice.generator.resolver.value.registry" => "nelmio_alice.generator.resolver.value.registry"
  "nelmio_alice.generator.resolver.value.chainable.function_argument_resolver" => "nelmio_alice.generator.resolver.value.chainable.function_argument_resolver"
  "nelmio_alice.generator.resolver.value.chainable.php_value_resolver" => "nelmio_alice.generator.resolver.value.chainable.php_value_resolver"
  "nelmio_alice.generator.resolver.value.chainable.faker_value_resolver" => "nelmio_alice.generator.resolver.value.chainable.faker_value_resolver"
  "nelmio_alice.faker.generator" => "nelmio_alice.faker.generator"
]
array:6 [
  "nelmio_alice.generator.caller" => "nelmio_alice.generator.caller"
  "nelmio_alice.generator.caller.simple" => "nelmio_alice.generator.caller.simple"
  "nelmio_alice.generator.resolver.value.registry" => "nelmio_alice.generator.resolver.value.registry"
  "nelmio_alice.generator.resolver.value.chainable.function_argument_resolver" => "nelmio_alice.generator.resolver.value.chainable.function_argument_resolver"
  "nelmio_alice.generator.resolver.value.chainable.php_value_resolver" => "nelmio_alice.generator.resolver.value.chainable.php_value_resolver"
  "nelmio_alice.generator.resolver.value.chainable.faker_value_resolver" => "nelmio_alice.generator.resolver.value.chainable.faker_value_resolver"
]
@nicolas-grekas
Copy link
Member

Cool, one less bug very soon :)
Can you work on a fix, or do you need help?

@ogizanagi
Copy link
Contributor Author

I cannot work on a fix for now, that's why I opened the issue 😄

@Simperfit
Copy link
Contributor

I can work on a fix tomorrow morning if it's ok for you ;) @nicolas-grekas

@nicolas-grekas nicolas-grekas removed this from the 3.4 milestone Nov 22, 2017
nicolas-grekas added a commit that referenced this issue Nov 22, 2017
…grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix infinite loop when analyzing references

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25101
| License       | MIT
| Doc PR        | -

Commits
-------

f772d2f [DI] Fix infinite loop when analyzing references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants