Bug 382791 - Infinite loop in zest grid layout
Summary: Infinite loop in zest grid layout
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: unspecified   Edit
Hardware: All Linux
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-16 15:56 EDT by Armond Paiva CLA
Modified: 2012-07-26 19:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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