tmf.ui: fix Bug 479996 infinite loop
authorLoïc Prieur-Drevon <loic.prieurdrevon@gmail.com>
Wed, 7 Dec 2016 17:38:22 +0000 (12:38 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 13 Dec 2016 18:37:37 +0000 (13:37 -0500)
Opening an empty trace called queryFullStates an infinite number
of times resulting in OOM. Checking the arguments will avoid
this.

Bug 479996

Change-Id: I0ac29da7a883d154fffb5c4d24aa50db32796a6f
Signed-off-by: Loïc Prieur-Drevon <loic.prieurdrevon@gmail.com>
Reviewed-on: https://git.eclipse.org/r/86862
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractStateSystemTimeGraphView.java

index 5b24998db1e9445e2f10a33dc38b04f4ce65d60c..f0641af4f43ac85b8580f6ec75a7f3710f80c2fe 100644 (file)
@@ -344,6 +344,10 @@ public abstract class AbstractStateSystemTimeGraphView extends AbstractTimeGraph
      */
     protected void queryFullStates(ITmfStateSystem ss, long start, long end, long resolution,
             @NonNull IProgressMonitor monitor, @NonNull IQueryHandler handler) {
+        if (end < start) {
+            /* We have an empty trace, the state system will be empty: nothing to do here. */
+            return;
+        }
         List<List<ITmfStateInterval>> fullStates = new ArrayList<>();
         List<ITmfStateInterval> prevFullState = null;
         try {
This page took 0.025532 seconds and 5 git commands to generate.