Skip to content

Segfault in DeployerActor.__init__() caused by infinite recursion #1165

@cygnusv

Description

@cygnusv

First, this is what TransactingPower.activate() does:

    def activate(self, password: str = None):
        """Be Consumed"""
        self.blockchain.connect(sync_now=False)
        self.unlock_account(password=password or self.__password)
        self.__password = None
        self.blockchain.transacting_power = self

That last line is going to cause trouble later. Moving on.

Now, the last part of the DeployerActor constructor does the following:

        blockchain.transacting_power = TransactingPower(blockchain=blockchain,
                                                        account=deployer_address,
                                                        password=client_password)
        blockchain.transacting_power.activate()

        # TODO: Does this class want to be a Character implementing PowerUp consumption?
        self.transacting_power = TransactingPower(blockchain=blockchain,
                                                  password=client_password,
                                                  account=deployer_address)
        self.transacting_power.activate()

The first call to activate() will produce an infinite recursion later, since it will create a closed loop of blockchain.transacting_power.blockchain.transacting_power.blockchain.transacting_power.blockchain.transacting_power.....
This closed loop causes a segfault the next time blockchain.transacting_power is called, during the second call toactivate()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛Broken functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions