From f629df2a2efdf22eb3b0e569fd13a173e2583746 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 23 Nov 2008 00:33:59 +0000 Subject: [PATCH] When displaying anscestors of an unstatisfied dependency (code from bug #245358), avoid a potential infinite loop and memory leak triggered by circular dependencies. Thanks to Peter Weller for reporting. (trunk r12045) svn path=/main/branches/2.1.6/; revision=12046 --- pym/_emerge/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index e8bcd7cd0..c69998e67 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -5388,13 +5388,18 @@ class depgraph(object): print "\nemerge: there are no ebuilds to satisfy "+green(xinfo)+"." # Show parent nodes and the argument that pulled them in. + traversed_nodes = set() node = myparent msg = [] while node is not None: + traversed_nodes.add(node) msg.append('(dependency required by "%s" [%s])' % \ (colorize('INFORM', str(node.cpv)), node.type_name)) parent = None for parent in self.digraph.parent_nodes(node): + if parent in traversed_nodes: + parent = None + continue if isinstance(parent, DependencyArg): msg.append('(dependency required by "%s" [argument])' % \ (colorize('INFORM', str(parent)))) -- 2.26.2