summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-07-29 12:25:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 00:09:27 +0100
commit98ef970c8e2827a6e0fc923a49fcc00af52f878c (patch)
tree66573af17b280b022ea709d696afb7902ad3a5af /bitbake/lib
parent2ff892d87c6208abb672bd446c36b261690093f2 (diff)
downloadpoky-98ef970c8e2827a6e0fc923a49fcc00af52f878c.tar.gz
bitbake: toaster: prevent infinite loop when finding task dependencies
Toaster occasionally records a task which depends on itself. This causes a problem when trying to display that task if it is "covered" by itself, as the code does the following: for task A, find a task B which covers A; then, recursively find the task which covers B etc. If B == A, this loop becomes infinite and never terminates. To prevent this, add the condition that, when finding a task B which covers A, don't allow B == A. [YOCTO #9952] (Bitbake rev: 88c471c7e5995abb5bca62990b91650277b6c926) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index a40ceef942..34118060df 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -822,11 +822,21 @@ def _find_task_dep(task_object):
822def _find_task_revdep(task_object): 822def _find_task_revdep(task_object):
823 tdeps = Task_Dependency.objects.filter(depends_on=task_object).filter(task__order__gt=0) 823 tdeps = Task_Dependency.objects.filter(depends_on=task_object).filter(task__order__gt=0)
824 tdeps = tdeps.exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build") 824 tdeps = tdeps.exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
825
826 # exclude self-dependencies to prevent infinite dependency loop
827 # in generateCoveredList2()
828 tdeps = tdeps.exclude(task=task_object)
829
825 return [tdep.task for tdep in tdeps] 830 return [tdep.task for tdep in tdeps]
826 831
827def _find_task_revdep_list(tasklist): 832def _find_task_revdep_list(tasklist):
828 tdeps = Task_Dependency.objects.filter(depends_on__in=tasklist).filter(task__order__gt=0) 833 tdeps = Task_Dependency.objects.filter(depends_on__in=tasklist).filter(task__order__gt=0)
829 tdeps = tdeps.exclude(task__outcome=Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build") 834 tdeps = tdeps.exclude(task__outcome=Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
835
836 # exclude self-dependencies to prevent infinite dependency loop
837 # in generateCoveredList2()
838 tdeps = tdeps.exclude(task=F('depends_on'))
839
830 return [tdep.task for tdep in tdeps] 840 return [tdep.task for tdep in tdeps]
831 841
832def _find_task_provider(task_object): 842def _find_task_provider(task_object):