Skip to content
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

Cloned robot getattr access can easily cause *major* infinite recursion loop. #262

Closed
psigen opened this issue Jan 26, 2016 · 1 comment
Closed
Assignees
Labels

Comments

@psigen
Copy link
Member

psigen commented Jan 26, 2016

@mkoval @ClintLiddick: This is a big one.

Accessing any undefined attribute on a cloned robot causes infinite recursion.
I think this is because the 'canonical instance' query checks 'actions' or 'detector' causing them to query each other forever.

$ rosrun herbpy console.py --sim

from prpy import Clone, Cloned
with Clone(robot.GetEnv()) as cloned_env:
    cloned_robot = cloned_env.Cloned(robot)
    cloned_robot.banana
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
/home/pkv/ws/src/deps/planning/herbpy/scripts/console.py in <module>()
      1 with Clone(robot.GetEnv()) as cloned_env:
      2     cloned_robot = cloned_env.Cloned(robot)
----> 3     cloned_robot.banana
      4 

/home/pkv/ws/src/deps/planning/prpy/src/prpy/bind.pyc in intercept(self, name)
    112             # we explicitly invoke it on object.
    113             if hasattr(canonical_instance, '__getattr__'):
--> 114                 return canonical_instance.__getattr__(name)
    115             else:
    116                 raise

/home/pkv/ws/src/deps/planning/prpy/src/prpy/base/robot.pyc in __getattr__(self, name)
    112             return wrapper_method
    113         elif (name != 'actions'
--> 114               and hasattr(self, 'actions')
    115               and self.actions is not None
    116               and self.actions.has_action(name)):

/home/pkv/ws/src/deps/planning/prpy/src/prpy/bind.pyc in intercept(self, name)
    112             # we explicitly invoke it on object.
    113             if hasattr(canonical_instance, '__getattr__'):
--> 114                 return canonical_instance.__getattr__(name)
    115             else:
    116                 raise

/home/pkv/ws/src/deps/planning/prpy/src/prpy/base/robot.pyc in __getattr__(self, name)
    122             return wrapper_method
    123         elif (name != 'detector'
--> 124               and hasattr(self, 'detector')
    125               and self.detector is not None
    126               and self.detector.has_perception_method(name)):

/home/pkv/ws/src/deps/planning/prpy/src/prpy/bind.pyc in intercept(self, name)
    112             # we explicitly invoke it on object.
    113             if hasattr(canonical_instance, '__getattr__'):
--> 114                 return canonical_instance.__getattr__(name)
    115             else:
    116                 raise

/home/pkv/ws/src/deps/planning/prpy/src/prpy/base/robot.pyc in __getattr__(self, name)
    112             return wrapper_method
    113         elif (name != 'actions'
--> 114               and hasattr(self, 'actions')
    115               and self.actions is not None
    116               and self.actions.has_action(name)):

/home/pkv/ws/src/deps/planning/prpy/src/prpy/bind.pyc in intercept(self, name)
    112             # we explicitly invoke it on object.
    113             if hasattr(canonical_instance, '__getattr__'):
--> 114                 return canonical_instance.__getattr__(name)
    115             else:
    116                 raise

/home/pkv/ws/src/deps/planning/prpy/src/prpy/base/robot.pyc in __getattr__(self, name)
    122             return wrapper_method
    123         elif (name != 'detector'
--> 124               and hasattr(self, 'detector')
    125               and self.detector is not None
    126               and self.detector.has_perception_method(name)):
[...]
@psigen
Copy link
Member Author

psigen commented Jan 26, 2016

I think I may have fixed this with #263.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants