{"action":"created","issue":{"url":"https://api.github.com/repos/lneuhaus/pyrpl/issues/340","repository_url":"https://api.github.com/repos/lneuhaus/pyrpl","labels_url":"https://api.github.com/repos/lneuhaus/pyrpl/issues/340/labels{/name}","comments_url":"https://api.github.com/repos/lneuhaus/pyrpl/issues/340/comments","events_url":"https://api.github.com/repos/lneuhaus/pyrpl/issues/340/events","html_url":"https://github.com/lneuhaus/pyrpl/issues/340","id":341303381,"node_id":"MDU6SXNzdWUzNDEzMDMzODE=","number":340,"title":"pyrpl/modules.py - Caught in recursive loop when trying to dig for pyrpl instance causing hanging on all r.scope.* calls ","user":{"login":"lneuhaus","id":18272943,"node_id":"MDQ6VXNlcjE4MjcyOTQz","avatar_url":"https://avatars2.githubusercontent.com/u/18272943?v=4","gravatar_id":"","url":"https://api.github.com/users/lneuhaus","html_url":"https://github.com/lneuhaus","followers_url":"https://api.github.com/users/lneuhaus/followers","following_url":"https://api.github.com/users/lneuhaus/following{/other_user}","gists_url":"https://api.github.com/users/lneuhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/lneuhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lneuhaus/subscriptions","organizations_url":"https://api.github.com/users/lneuhaus/orgs","repos_url":"https://api.github.com/users/lneuhaus/repos","events_url":"https://api.github.com/users/lneuhaus/events{/privacy}","received_events_url":"https://api.github.com/users/lneuhaus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-15T08:29:05Z","updated_at":"2018-07-15T08:40:12Z","closed_at":null,"author_association":"OWNER","body":"Issue comes from here: https://github.com/RedPitaya/RedPitaya/issues/150\r\n\r\nCopy-paste: \r\nForgive me if my format is terrible, I do not usually file issues.\r\n\r\nWhenever I call/assign any member of redpitaya.scope, my code hangs forever and I have traced it back to the pyrpl/modules.py in the pyrpl function. I do not have a good enough understanding of the code to make a suggestion but could this be a bug?\r\n\r\n```\r\ndef pyrpl(self):\r\n    \"\"\"\r\n    Recursively looks through patent modules untill pyrpl instance is\r\n    reached.\r\n    \"\"\"\r\n    from .pyrpl import Pyrpl\r\n    parent = self.parent\r\n    while (not isinstance(parent, Pyrpl)):\r\n        parent = parent.parent\r\n    return parent\r\n```"},"comment":{"url":"https://api.github.com/repos/lneuhaus/pyrpl/issues/comments/405076375","html_url":"https://github.com/lneuhaus/pyrpl/issues/340#issuecomment-405076375","issue_url":"https://api.github.com/repos/lneuhaus/pyrpl/issues/340","id":405076375,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTA3NjM3NQ==","user":{"login":"lneuhaus","id":18272943,"node_id":"MDQ6VXNlcjE4MjcyOTQz","avatar_url":"https://avatars2.githubusercontent.com/u/18272943?v=4","gravatar_id":"","url":"https://api.github.com/users/lneuhaus","html_url":"https://github.com/lneuhaus","followers_url":"https://api.github.com/users/lneuhaus/followers","following_url":"https://api.github.com/users/lneuhaus/following{/other_user}","gists_url":"https://api.github.com/users/lneuhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/lneuhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lneuhaus/subscriptions","organizations_url":"https://api.github.com/users/lneuhaus/orgs","repos_url":"https://api.github.com/users/lneuhaus/repos","events_url":"https://api.github.com/users/lneuhaus/events{/privacy}","received_events_url":"https://api.github.com/users/lneuhaus/received_events","type":"User","site_admin":false},"created_at":"2018-07-15T08:40:12Z","updated_at":"2018-07-15T08:40:12Z","author_association":"OWNER","body":"I agree this is while-loop bit smelly, so i suggest we implement a maximum recursion depth of 100 or so here. \r\n\r\nNevertheless, I would like to understand how there can be an infinite loop here. \r\n\r\nThe depth of any parent/child chain is necessarily finite, unless something is its own parent or the parent of something that appeared already in the chain. \r\n\r\nCould you please provide some extra context so we can try to debug this? I.e.:\r\n- did you modify the code, and how?\r\n- how did you get to this point, i.e. did you run pyrpl from the code of the current master branch of pyrpl, and on what python version are you working?\r\n- or simply hit Ctrl-C in a notebook/ipython console when this infinite loop occurs, type %debug, and scroll up and display the value of parent at each stage, to reconstruct what the parents of scope actually are - i would expect something like scope, redpitaya, scope, redpitaya, ..., which would indicate that scope is a parent of redpitaya, which would raise the question where this hypothetical setting comes from..\r\n\r\nThanks in advance!\r\n\r\nPS: If you have not played with the source code, I rather do not believe that the issue you describe is the reason for your problem, but of course we have to exclude this possibility first to be able to find the actual problem. "}}
{"actor":{"display_login":"lneuhaus"}}