Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cross-reference alias for a service produces endless loop in php process #25338

Closed
@leotiger

Description

@leotiger
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.4.1

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.

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