You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to produce an endless loop in the underlying php process by establishing an alias cross-reference for a service in the services.yml. This is a sample portion that should allow to reproduce this behavior:
# default configuration for services in *this* file
_defaults:
# automatically injects dependencies in your services
autowire: true
# automatically registers your services as commands, event subscribers, etc.
autoconfigure: true
# this means you cannot fetch services directly from the container via $container->get()
# if you need to do this, you can override this setting on individual services
public: false
@app.something_doing: "@AppBundle\Something\DoesSomething"
AppBundle\Something\DoesSomething: "@app.something_doing"
AppBundle\:
resource: '../../src/AppBundle/*'
exclude: '../../src/AppBundle/{Entity,Repository,Tests,Something}'
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']
AppBundle\Something\DoesSomething:
arguments: ["@mailer", "@router"]
public: true
This breaks, at least in my setup, the composer update command as well as console commands, php process runs hot and never terminates. Probably the validator for the service definitions should check this to avoid the problem if you can reproduce it.
The text was updated successfully, but these errors were encountered:
leotiger
changed the title
Cross-reference alias produces endless loop in php process
Cross-reference alias for a service produces endless loop in php process
Dec 5, 2017
… `findDefinition` method (sroze)
This PR was merged into the 3.3 branch.
Discussion
----------
[DependencyInjection] Prevent a loop in aliases within the `findDefinition` method
| Q | A
| ------------- | ---
| Branch? | 3.3
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25338
| License | MIT
| Doc PR | ø
This prevents an infinite loop going when aliases reference themselves. This is based on 3.3 as the "normalized ID" changed to allow non-lowercase names. Fixing this in 2.7 would mean a merge conflict that IMO is not worth it.
Commits
-------
22f3523 Prevent a loop in aliases within the `findDefinition` method
It's possible to produce an endless loop in the underlying php process by establishing an alias cross-reference for a service in the services.yml. This is a sample portion that should allow to reproduce this behavior:
This breaks, at least in my setup, the
composer update
command as well as console commands, php process runs hot and never terminates. Probably the validator for the service definitions should check this to avoid the problem if you can reproduce it.The text was updated successfully, but these errors were encountered: