Bug 382791

Summary: Infinite loop in zest grid layout
Product: [Tools] GEF Reporter: Armond Paiva <armondpaiva>
Component: GEF-Legacy ZestAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: critical    
Priority: P3 CC: armondpaiva, steeg
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:

Description Armond Paiva CLA 2012-06-16 15:56:25 EDT
Build Identifier: Version: 3.7.2 Build id: M20120208-0800

When 
   rows==1, and cols==1, and numChildren==1 

the following snippet of calculateNumberOfRowsAndCols_square results in an infinite loop.


			while (rows * cols > numChildren) {
				if (cols > 1)
					cols--;
				if (rows * cols > numChildren)
					if (rows > 1)
						rows--;
			}

Reproducible: Didn't try

Steps to Reproduce:
1.  It occurred upon launching eclipse when it opened a view containing a zest graph from the previous session. It appears the graph had no content.  (zero nodes or connections.)
Comment 1 Armond Paiva CLA 2012-06-16 16:07:15 EDT
Plugin version: 2.0.0.201206082202
Comment 2 Fabian Steeg CLA 2012-07-26 19:09:41 EDT
Thanks Armond. Unfortunately, this issue is hard to reproduce.

The code you pointed at should not produce an infinite loop with your preconditions (rows == 1, cols == 1, numChildren == 1), since the condition of the loop is never true (rows * cols > numChildren).

I also tried to reproduce the problem from the rest of your description here:

http://git.eclipse.org/c/gef/org.eclipse.zest.git/commit/?id=bf45e8fe50e620c4f3