BUG IN 6.0: Infinite loop creating new page

By: Maxim - lazy-max
BUG IN 6.0: Infinite loop creating new page
2004-08-02 06:05
This is very serious bug in Jasper. I've found it in 0.5.3 and 0.6.0 too. I've create sample that reproduce this bug, but Teodor not answer on my letter.
I've put zip archive with my sample on http://kmax.nm.ru/Loop_bug_60.zip (10k)

By: Maxim - lazy-max
RE: BUG IN 6.0: Infinite loop creating new page
2004-08-13 05:13
Any ideas?

By: Teodor Danciu - teodord
RE: BUG IN 6.0: Infinite loop creating new pa
2004-08-13 13:43


Normally this is not a bug.

We get this message when there is a layout
problem probably related to the height of some
bands or the way group headers repeat or to
the way subreports are placed inside master reports.

As it says, the engine enters an infinite loop trying
to create page breaks due to the fact that the
current section it has to print does not seem to
fit on these new pages, because some repeating
group headers or something else occupy much of
the new page it just created.

I tried to debug the example you posted but have
not yet found the problem. I have some hardware
difficulties at the moment.

I hope this helps.

By: janr - janr6
RE: BUG IN 6.0: Infinite loop creating new page
2004-09-14 06:19

I just had the same problem in every jasper version I tried to use.
As I started to debug the 6.0 version, I found out that the infinite loop starts within the fillColumnBreak method of the JRVerticalFiller class.
In my case there is only one column I use in my report designs, so jasper wants to perform a page break, when the fillColumnBreak method is called.
This call turns into an infinite loop, when it is perfomed from the fillPageBreak method (via the fillGroupHeaderReprint call).
I solved the problem by adding a (bool) flag called isLastColumnReached in addition to the isCreatingNewPage flag.
This new flag is set in the fillColumnBreakMethod,
and checked in the fillGroupHeaderReprint method.

Could anyone tell me where to publish this try of a solution. Is it okay simply to post the relevant lines of the source code right here ?

Greetz, Jan

By: Brett Sutton - sbrettsutton
RE: BUG IN 6.0: Infinite loop creating new page
2004-09-21 21:14
I hate to disagree with you Teodor but this is a BUG and a big one. All software should (no MUST) be written to operate correctly regardless of user input (in this case the jasper xml and or datasource). If there is a flaw in the user input then the software must report the flaw to the user and stop the process (or better still correct the problem and continue). Jaspers approach of simply allowing the flawed input to be processed with the result that 100% of the available CPU is consumed and eventually 100% of available memory is not what I call good quality software design.

I can certainly see that this is not any easy problem to solve but I don't think it helps the discussion by pretending that its not a bug.

Now I'm prepared to put my time where my mouth is and create a patch which fixes the problem, but I will need some input as I'm not terribly familiar with Jaspers internals.

Clearly the problem can't be detected (for many scenarios) at compile time so what is needed is a runtime detection system.

What I'm proposing is something similar to the following:

When an overflow occurs mark the object that is being moved to the next page.

If a subsequent overflow occurs check the object that is to be moved to see if it has already been moved.

If an object has already been moved, then throw an appropriate exception and shut the report down.

From reading bug reports and forums it appears that the problem is occuring in several places (i.e. all sorts of objects can overflow). What I need to know, is there a logical spot/base class where the runtime detection could be placed.

If I can get some guidance on this I'm prepared to commit upto a week of development time in getting it fixed.

Sorry if I've been a bit brutal here, I do think Jasper is a great product and I think the work you do is inspiring, but a bug is a bug by any other name :).

ktrinad's picture
Joined: Aug 9 2006 - 2:36am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet